Class: CFG::Token
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from ASTNode
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(kind, text, value = nil) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(kind, text, value = nil) ⇒ Token
Returns a new instance of Token.
239 240 241 242 243 |
# File 'lib/CFG/config.rb', line 239 def initialize(kind, text, value = nil) super(kind) @text = text @value = value end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
236 237 238 |
# File 'lib/CFG/config.rb', line 236 def text @text end |
#value ⇒ Object
Returns the value of attribute value.
237 238 239 |
# File 'lib/CFG/config.rb', line 237 def value @value end |
Instance Method Details
#==(other) ⇒ Object
249 250 251 252 |
# File 'lib/CFG/config.rb', line 249 def ==(other) @kind == other.kind && @text == other.text && @value == other.value && @start == other.start && @end == other.end end |
#to_s ⇒ Object
245 246 247 |
# File 'lib/CFG/config.rb', line 245 def to_s "Token(#{@kind}, #{text.inspect}, #{value.inspect})" end |