Exemplo n.º 1
0
	bool parse(scanner_t& scanner, skip_t& skip_p) const
	{
		scanner.save();
		if (!stub.parse(scanner, skip_p))
			scanner.rollback();

		return true;
	}
Exemplo n.º 2
0
	bool parse(scanner_t& scanner, skip_t& skip_p) const
	{
		scanner.save();
		if (lhs.parse(scanner, skip_p) ||
			rhs.parse(scanner, skip_p))
		{
			scanner.commit();
			return true;
		}
		scanner.rollback();
		return false;
	}
Exemplo n.º 3
0
	bool parse(scanner_t& scanner, skip_t& ) const
	{
		scanner.save();
		const int value = scanner.read();
		if (value != -1 &&
			traits_type::to_char_type(value) == character)
		{
			scanner.commit();
			return true;
		}
		
		scanner.rollback();
		return false;
	}
Exemplo n.º 4
0
	bool parse(scanner_t& scanner, skip_t& skip_p) const
	{
		scanner.save();

		const int input = scanner.read();
		if (input != -1 &&
			traits_type::to_char_type(input) >= small &&
			traits_type::to_char_type(input) <= large)
		{
			scanner.commit();
			return true;
		}

		scanner.rollback();
		return false;
	}
Exemplo n.º 5
0
	bool parse(scanner_t& scanner, skip_t& ) const
	{
		scanner.save();
		
		for (typename string_type::const_iterator itor = literal.begin();
			 itor != literal.end(); ++itor)
		{
			const int val = scanner.read();
			if (val == -1 ||
				traits_type::to_char_type(val) != *itor)
			{
				scanner.rollback();
				return false;
			}
		}
		scanner.commit();
		return true;
	}