Module: Rattler::Parsers::Semantic

Included in:
NodeAction, SemanticAction
Defined in:
lib/rattler/parsers/semantic.rb

Overview

Semantic describes parsers that perform a semantic action

Instance Method Summary collapse

Instance Method Details

#bind(scope) ⇒ String

Returns ruby code that performs the action.

Parameters:

  • scope (ParserScope)

    the scope of captures to bind in the code

Returns:

  • (String)

    ruby code that performs the action



10
11
12
# File 'lib/rattler/parsers/semantic.rb', line 10

def bind(scope)
  bindable_code.bind(scope)
end

#bindable_codeObject

Returns an object that be bound to a parser scope to return ruby code that performs the action.

Returns:

  • an object that be bound to a parser scope to return ruby code that performs the action



16
17
18
# File 'lib/rattler/parsers/semantic.rb', line 16

def bindable_code
  @bindable_code ||= create_bindable_code
end

#semantic?Boolean

Returns true.

Returns:

  • (Boolean)

    true



21
22
23
# File 'lib/rattler/parsers/semantic.rb', line 21

def semantic?
  true
end