Class: Rley::Syntax::NonTerminal
- Defined in:
- lib/rley/syntax/non_terminal.rb
Overview
A non-terminal symbol (sometimes called a syntactic variable) represents a composition of terminal or non-terminal symbols
Instance Attribute Summary collapse
-
#nullable ⇒ Object
writeonly
Sets the attribute nullable.
Attributes inherited from GrmSymbol
Instance Method Summary collapse
-
#initialize(aName) ⇒ NonTerminal
constructor
Constructor.
-
#nullable? ⇒ false/true
the empty string.
Methods inherited from GrmSymbol
Constructor Details
#initialize(aName) ⇒ NonTerminal
Constructor.
12 13 14 |
# File 'lib/rley/syntax/non_terminal.rb', line 12 def initialize(aName) super(aName) end |
Instance Attribute Details
#nullable=(value) ⇒ Object (writeonly)
Sets the attribute nullable
8 9 10 |
# File 'lib/rley/syntax/non_terminal.rb', line 8 def nullable=(value) @nullable = value end |
Instance Method Details
#nullable? ⇒ false/true
the empty string. As non-terminal symbol is nullable when it can can match to zero input token. The "nullability" of a non-terminal can practically be determined once all the production rules of the grammar are specified.
21 22 23 |
# File 'lib/rley/syntax/non_terminal.rb', line 21 def nullable?() return @nullable end |