Class: Dhaka::PrecedenceBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/grammar/grammar.rb

Overview

The precedence builder defines three methods, left, right and nonassoc. These accept arrays of grammar symbols all of which have the same precedence level and associativity. This works almost exactly like Yacc.

See the arithmetic precedence grammar in the test suites for an example.

Instance Method Summary collapse

Constructor Details

#initialize(grammar) ⇒ PrecedenceBuilder

:nodoc:



42
43
44
45
# File 'lib/grammar/grammar.rb', line 42

def initialize(grammar) #:nodoc:
  @grammar = grammar
  @precedence_level = 0
end