Class: Rlex::Token
- Inherits:
-
Struct
- Object
- Struct
- Rlex::Token
- Defined in:
- lib/rlex/token.rb
Overview
Simple class to represent tokens matched from the input.
Instance Attribute Summary collapse
-
#col ⇒ Integer
readonly
Column position of the matched text.
-
#line ⇒ Integer
readonly
Line number of the matched text.
-
#type ⇒ Symbol
readonly
Type of the token, such as the name of the rule used to match it.
-
#value ⇒ String
readonly
Text matched from the input.
Instance Attribute Details
#col ⇒ Integer (readonly)
Column position of the matched text
12 13 14 |
# File 'lib/rlex/token.rb', line 12 def col @col end |
#line ⇒ Integer (readonly)
Line number of the matched text
12 13 14 |
# File 'lib/rlex/token.rb', line 12 def line @line end |
#type ⇒ Symbol (readonly)
Type of the token, such as the name of the rule used to match it
12 13 14 |
# File 'lib/rlex/token.rb', line 12 def type @type end |
#value ⇒ String (readonly)
Text matched from the input
12 13 14 |
# File 'lib/rlex/token.rb', line 12 def value @value end |