Esempio n. 1
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;
	}
Esempio n. 2
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;
	}
Esempio n. 3
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;
	}