Class | RParsec::Keywords |
In: |
rparsec/keywords.rb
|
Parent: | Object |
This class helps building lexers and parsers for keywords.
keyword_symbol | [R] | The symbol used to identify a keyword token |
lexer | [R] | The lexer that parses all the keywords represented |
To create an instance that lexes the given keywords case insensitively. default_lexer is used to lex a token first, the token text is then compared with the given keywords. If it matches any of the keyword, a keyword token is generated instead using keyword_symbol. The block parameter, if present, is used to convert the token text to another object when the token is recognized during parsing phase.
To create an instance that lexes the given keywords case sensitively. default_lexer is used to lex a token first, the token text is then compared with the given keywords. If it matches any of the keyword, a keyword token is generated instead using keyword_symbol. The block parameter, if present, is used to convert the token text to another object when the token is recognized during grammar parsing phase.