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.
13 14 15 16 |
# File 'lib/rley/syntax/verbatim_symbol.rb', line 13 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.
11 12 13 |
# File 'lib/rley/syntax/verbatim_symbol.rb', line 11 def text @text end |
Instance Method Details
#to_s ⇒ String
The String representation of the verbatim symbol
20 21 22 |
# File 'lib/rley/syntax/verbatim_symbol.rb', line 20 def to_s "'#{text}'" end |