Class: Rley::Syntax::VerbatimSymbol
- Defined in:
- lib/rley/syntax/verbatim_symbol.rb
Overview
A verbatim word is terminal symbol that represents one unique word in the language defined the grammar.
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
The exact text representation of the word.
Attributes inherited from GrmSymbol
Instance Method Summary collapse
-
#initialize(aText) ⇒ VerbatimSymbol
constructor
A new instance of VerbatimSymbol.
-
#to_s ⇒ String
The String representation of the verbatim symbol.
Methods inherited from Terminal
Methods inherited from GrmSymbol
Constructor Details
#initialize(aText) ⇒ VerbatimSymbol
Returns a new instance of VerbatimSymbol.
11 12 13 14 |
# File 'lib/rley/syntax/verbatim_symbol.rb', line 11 def initialize(aText) super(aText) # Do we need to separate the text from the name? @text = aText.dup end |
Instance Attribute Details
#text ⇒ Object (readonly)
The exact text representation of the word.
9 10 11 |
# File 'lib/rley/syntax/verbatim_symbol.rb', line 9 def text @text end |
Instance Method Details
#to_s ⇒ String
The String representation of the verbatim symbol
18 19 20 |
# File 'lib/rley/syntax/verbatim_symbol.rb', line 18 def to_s() return "'#{text}'" end |