Renamed 'Nop' to 'Epsilon' to match spirit. Debugged non-moving parsers. Added 'Wrap' rule that will allow a Rule to wrap a single other Rule and get a tree for the node.

This commit is contained in:
Jonathan Turner
2009-06-10 14:10:15 +00:00
parent c4e3328bb1
commit e7a0bf70fd
4 changed files with 92 additions and 27 deletions

View File

@@ -50,7 +50,10 @@ std::pair<Token_Iterator, bool> Plus_Rule
std::pair<Token_Iterator, bool> Optional_Rule
(Token_Iterator iter, Token_Iterator end, TokenPtr parent, bool keep, int new_id, struct Rule rule);
std::pair<Token_Iterator, bool> Nop_Rule
std::pair<Token_Iterator, bool> Epsilon_Rule
(Token_Iterator iter, Token_Iterator end, TokenPtr parent, bool keep, int new_id, struct Rule rule);
std::pair<Token_Iterator, bool> Wrap_Rule
(Token_Iterator iter, Token_Iterator end, TokenPtr parent, bool keep, int new_id, struct Rule rule);
struct Rule {
@@ -102,6 +105,7 @@ Rule Str(const std::string &text);
Rule Id(int id);
Rule Ign(Rule rule);
Rule Nop(Rule rule);
Rule Epsilon(Rule rule);
Rule Wrap(Rule rule);
#endif /* LANGKIT_PARSER_HPP_ */