Class: Aurum::Grammar::SyntaxRules::Production
- Inherits:
-
Struct
- Object
- Struct
- Aurum::Grammar::SyntaxRules::Production
- Defined in:
- lib/aurum/grammar/syntax_rules.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#nonterminal ⇒ Object
Returns the value of attribute nonterminal.
-
#symbols ⇒ Object
Returns the value of attribute symbols.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
65 66 67 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 65 def name @name end |
#nonterminal ⇒ Object
Returns the value of attribute nonterminal
64 65 66 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 64 def nonterminal @nonterminal end |
#symbols ⇒ Object
Returns the value of attribute symbols
64 65 66 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 64 def symbols @symbols end |
Instance Method Details
#inspect ⇒ Object
72 73 74 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 72 def inspect "#{nonterminal.inspect} -> #{symbols.map {|symbol| symbol.inspect}.join(' ')}" end |
#precedence ⇒ Object
67 68 69 70 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 67 def precedence terminals = symbols.find_all {|symbol| symbol.is_terminal && symbol.precedence} terminals.size == 1 ? terminals.first.precedence : Precedence::Highest end |