Class: Rattler::BackEnd::ParserGenerator::SkipGenerator

Inherits:
ExprGenerator
  • Object
show all
Includes:
PredicatePropogating, SkipPropogating, TokenPropogating
Defined in:
lib/rattler/back_end/parser_generator/skip_generator.rb

Direct Known Subclasses

NestedSkipGenerator, TopLevelSkipGenerator

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SkipPropogating

#gen_intermediate_skip, #gen_skip

Methods included from TokenPropogating

#gen_token

Methods included from PredicatePropogating

#gen_assert, #gen_disallow, #gen_intermediate_assert, #gen_intermediate_disallow

Methods inherited from ExprGenerator

#gen_intermediate_assert, #gen_intermediate_disallow, #gen_intermediate_skip, #gen_token, #initialize

Methods included from Parsers

define

Constructor Details

This class inherits a constructor from Rattler::BackEnd::ParserGenerator::ExprGenerator

Class Method Details

.nested(*args) ⇒ Object



41
42
43
# File 'lib/rattler/back_end/parser_generator/skip_generator.rb', line 41

def SkipGenerator.nested(*args)
  NestedSkipGenerator.new(*args)
end

.top_level(*args) ⇒ Object



51
52
53
# File 'lib/rattler/back_end/parser_generator/skip_generator.rb', line 51

def SkipGenerator.top_level(*args)
  TopLevelSkipGenerator.new(*args)
end

Instance Method Details

#gen_basic(skip, scope = {}) ⇒ Object



11
12
13
# File 'lib/rattler/back_end/parser_generator/skip_generator.rb', line 11

def gen_basic(skip, scope={})
  generate skip.child, :skip, scope
end

#gen_direct_action(skip, code, scope = {}) ⇒ Object



22
23
24
25
26
27
# File 'lib/rattler/back_end/parser_generator/skip_generator.rb', line 22

def gen_direct_action(skip, code, scope={})
  expr :block do
    gen_intermediate_skip skip, scope
    (@g << ' &&').newline << '(' << code.bind(scope, []) << ')'
  end
end

#gen_dispatch_action(skip, code, scope = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/rattler/back_end/parser_generator/skip_generator.rb', line 15

def gen_dispatch_action(skip, code, scope={})
  expr :block do
    gen_intermediate_skip skip, scope
    (@g << ' &&').newline << code.bind(scope, '[]')
  end
end

#gen_intermediate(skip, scope = {}) ⇒ Object



29
30
31
# File 'lib/rattler/back_end/parser_generator/skip_generator.rb', line 29

def gen_intermediate(skip, scope={})
  gen_intermediate_skip skip, scope
end