Module: ABNF::Compiler::Controls::AST

Extended by:
AST
Included in:
AST
Defined in:
lib/abnf/compiler/controls/ast.rb

Instance Method Summary collapse

Instance Method Details

#leaf(text = nil) ⇒ Object



7
8
9
10
# File 'lib/abnf/compiler/controls/ast.rb', line 7

def leaf text = nil
  text ||= 'some-string'
  Compiler::AST.leaf text
end

#repetitionObject



12
13
14
15
16
17
# File 'lib/abnf/compiler/controls/ast.rb', line 12

def repetition
  Compiler::AST.repetition(
    leaf('some-string'),
    leaf('other-string'),
  )
end

#sequenceObject



19
20
21
22
23
24
# File 'lib/abnf/compiler/controls/ast.rb', line 19

def sequence
  Compiler::AST.sequence(
    leaf('some-string'),
    leaf('other-string'),
  )
end