Class: Dhaka::PrecedenceBuilder
- Inherits:
-
Object
- Object
- Dhaka::PrecedenceBuilder
- Defined in:
- lib/dhaka/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.
See the arithmetic precedence grammar in the test suites for an example of how this works.
Instance Method Summary collapse
-
#initialize(grammar) ⇒ PrecedenceBuilder
constructor
:nodoc:.
Constructor Details
#initialize(grammar) ⇒ PrecedenceBuilder
:nodoc:
42 43 44 45 |
# File 'lib/dhaka/grammar/grammar.rb', line 42 def initialize(grammar) #:nodoc: @grammar = grammar @precedence_level = 0 end |