Class: Rley::Syntax::Terminal
- Defined in:
- lib/rley/syntax/terminal.rb
Overview
A terminal symbol represents a class of words in the language defined the grammar.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from GrmSymbol
Instance Method Summary collapse
-
#initialize(aName) ⇒ Terminal
constructor
Constructor.
-
#nullable? ⇒ false
the empty string.
-
#terminal? ⇒ Boolean
Return true iff the symbol is a terminal.
- #to_s ⇒ Object
Methods inherited from GrmSymbol
Constructor Details
#initialize(aName) ⇒ Terminal
Constructor.
12 13 14 15 |
# File 'lib/rley/syntax/terminal.rb', line 12 def initialize(aName) super(aName) self.generative = true end |
Instance Method Details
#nullable? ⇒ false
the empty string. As terminal symbol corresponds to a input token it is by definition non-nullable.
25 26 27 |
# File 'lib/rley/syntax/terminal.rb', line 25 def nullable? false end |
#terminal? ⇒ Boolean
Return true iff the symbol is a terminal
18 19 20 |
# File 'lib/rley/syntax/terminal.rb', line 18 def terminal? return true end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/rley/syntax/terminal.rb', line 29 def to_s name end |