Module: Dhaka::LexerSupport
- Defined in:
- lib/dhaka/lexer/regex_grammar.rb,
lib/dhaka/lexer/dfa.rb,
lib/dhaka/lexer/state.rb,
lib/dhaka/lexer/alphabet.rb,
lib/dhaka/lexer/state_machine.rb,
lib/dhaka/lexer/accept_actions.rb,
lib/dhaka/lexer/regex_tokenizer.rb
Overview
:nodoc:all
Defined Under Namespace
Classes: ASTNode, AcceptAction, AcceptingNode, BinaryNode, CatNode, CheckpointAction, CheckpointNode, DFA, DFARun, InvalidRegexException, LeafNode, LookaheadAcceptAction, LookaheadAcceptingNode, LookaheadNode, OneOrMoreNode, OrNode, RegexGrammar, RegexParser, RegexTokenizer, RootNode, State, StateMachine, UnaryNode, ZeroOrMoreNode, ZeroOrOneNode
Constant Summary collapse
- DIGITS =
('0'..'9').to_a
- LOWERCASE_LETTERS =
('a'..'z').to_a
- UPPERCASE_LETTERS =
('A'..'Z').to_a
- LETTERS =
LOWERCASE_LETTERS + UPPERCASE_LETTERS
- WHITESPACE =
[" ", "\r", "\n", "\t"]
- SYMBOLS =
%w| ~ ` ! @ # % & _ = : ; " ' < , > - |
- CLASSES =
{'d' => DIGITS, 'w' => LETTERS, 's' => WHITESPACE}
- OPERATOR_CHARACTERS =
{'(' => 'open_parenth', ')' => 'close_parenth', '[' => 'open_square_bracket', ']' => 'close_square_bracket', '+' => 'plus', '*' => 'asterisk', '?' => 'question_mark', '.' => 'period', '\\' => 'back_slash', '|' => 'pipe', '{' => 'left_curly_brace', '}' => 'right_curly_brace', '/' => 'forward_slash', '^' => 'caret', '$' => 'dollar'}
- SET_OPERATOR_CHARACTERS =
%w| - ^ [ ] \\ |
- ALL_CHARACTERS =
DIGITS + LETTERS + SYMBOLS + WHITESPACE + OPERATOR_CHARACTERS.keys