Module: ABNF::Parser::Controls::Compiler::Tokens
Instance Method Summary collapse
- #alternation_slash ⇒ Object
- #bin_val_range ⇒ Object
- #bin_val_sequence ⇒ Object
- #c_nl(comment = nil) ⇒ Object
- #c_wsp(abnf = nil) ⇒ Object
- #char_val(string = nil) ⇒ Object
- #dec_val_range ⇒ Object
- #dec_val_sequence ⇒ Object
- #defined_as(operator = nil) ⇒ Object
- #group_start ⇒ Object
- #group_stop ⇒ Object
- #hex_val_range ⇒ Object
- #hex_val_sequence(sequence = nil) ⇒ Object (also: #example, #foo, #num_val, #terminal)
- #option_start ⇒ Object
- #option_stop ⇒ Object
- #prose_val ⇒ Object
- #repeat_exact ⇒ Object
- #repeat_range(abnf = nil) ⇒ Object
- #rulename ⇒ Object
Instance Method Details
#alternation_slash ⇒ Object
8 9 10 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 8 def alternation_slash Parser::Compiler::Token.new 'alternation-SLASH', ' / ' end |
#bin_val_range ⇒ Object
12 13 14 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 12 def bin_val_range Parser::Compiler::Token.new 'bin-val-RANGE', '%b100000-100001' end |
#bin_val_sequence ⇒ Object
16 17 18 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 16 def bin_val_sequence Parser::Compiler::Token.new 'bin-val-SEQUENCE', '%b1100110.1101111.1101111' end |
#c_nl(comment = nil) ⇒ Object
20 21 22 23 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 20 def c_nl comment=nil abnf = "#{comment}\r\n" Parser::Compiler::Token.new 'c-nl', abnf end |
#c_wsp(abnf = nil) ⇒ Object
25 26 27 28 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 25 def c_wsp abnf=nil abnf ||= ' ' Parser::Compiler::Token.new 'c-wsp', abnf end |
#char_val(string = nil) ⇒ Object
30 31 32 33 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 30 def char_val string=nil string ||= 'foo' Parser::Compiler::Token.new 'char-val', string.inspect end |
#dec_val_range ⇒ Object
35 36 37 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 35 def dec_val_range Parser::Compiler::Token.new 'dec-val-RANGE', '%d32-33' end |
#dec_val_sequence ⇒ Object
39 40 41 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 39 def dec_val_sequence Parser::Compiler::Token.new 'dec-val-SEQUENCE', '%d102.111.111' end |
#defined_as(operator = nil) ⇒ Object
43 44 45 46 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 43 def defined_as operator=nil operator ||= '=' Parser::Compiler::Token.new 'defined-as', operator end |
#group_start ⇒ Object
48 49 50 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 48 def group_start Parser::Compiler::Token.new 'group-START', '( ' end |
#group_stop ⇒ Object
52 53 54 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 52 def group_stop Parser::Compiler::Token.new 'group-STOP', ' )' end |
#hex_val_range ⇒ Object
56 57 58 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 56 def hex_val_range Parser::Compiler::Token.new 'hex-val-RANGE', '%x20-21' end |
#hex_val_sequence(sequence = nil) ⇒ Object Also known as: example, foo, num_val, terminal
60 61 62 63 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 60 def hex_val_sequence sequence=nil sequence ||= ABNF.foo Parser::Compiler::Token.new 'hex-val-SEQUENCE', sequence end |
#option_start ⇒ Object
69 70 71 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 69 def option_start Parser::Compiler::Token.new 'option-START', '[ ' end |
#option_stop ⇒ Object
73 74 75 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 73 def option_stop Parser::Compiler::Token.new 'option-STOP', ' ]' end |
#prose_val ⇒ Object
77 78 79 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 77 def prose_val Parser::Compiler::Token.new 'prose-val', '<Some Prose>' end |
#repeat_exact ⇒ Object
81 82 83 |
# File 'lib/abnf/parser/controls/compiler/tokens.rb', line 81 def repeat_exact Parser::Compiler::Token.new 'repeat-EXACT', '1' end |