Class: RubyLexer::Token
- Inherits:
-
Object
- Object
- RubyLexer::Token
- Defined in:
- lib/rubylexer/token.rb,
lib/rubylexer/tokenprinter.rb
Overview
Direct Known Subclasses
EoiToken, IgnoreToken, MethNameToken, NewlineToken, NumberToken, RubyCode, StringToken, SubitemToken, SymbolToken, WToken
Instance Attribute Summary collapse
-
#allow_ooo_offset ⇒ Object
hack.
-
#as ⇒ Object
if defined, a KeywordToken which this token stands in for.
-
#ident ⇒ Object
Returns the value of attribute ident.
-
#offset ⇒ Object
file offset of start of this token.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
- #error ⇒ Object
- #has_no_block? ⇒ Boolean
-
#initialize(ident, offset = nil) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
- #ws_munge(tp) ⇒ Object
Constructor Details
#initialize(ident, offset = nil) ⇒ Token
Returns a new instance of Token.
33 34 35 36 |
# File 'lib/rubylexer/token.rb', line 33 def initialize(ident,offset=nil) @ident=ident @offset=offset end |
Instance Attribute Details
#allow_ooo_offset ⇒ Object
hack
31 32 33 |
# File 'lib/rubylexer/token.rb', line 31 def allow_ooo_offset @allow_ooo_offset end |
#as ⇒ Object
if defined, a KeywordToken which this token stands in for.
30 31 32 |
# File 'lib/rubylexer/token.rb', line 30 def as @as end |
#ident ⇒ Object
Returns the value of attribute ident.
25 26 27 |
# File 'lib/rubylexer/token.rb', line 25 def ident @ident end |
#offset ⇒ Object
file offset of start of this token
29 30 31 |
# File 'lib/rubylexer/token.rb', line 29 def offset @offset end |
#tag ⇒ Object
Returns the value of attribute tag.
42 43 44 |
# File 'lib/rubylexer/token.rb', line 42 def tag @tag end |
Instance Method Details
#error ⇒ Object
38 |
# File 'lib/rubylexer/token.rb', line 38 def error; end |
#has_no_block? ⇒ Boolean
40 |
# File 'lib/rubylexer/token.rb', line 40 def has_no_block?; false end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/rubylexer/token.rb', line 26 def to_s @ident || "<#{self.class.name}>" end |
#ws_munge(tp) ⇒ Object
96 97 98 |
# File 'lib/rubylexer/tokenprinter.rb', line 96 def ws_munge(tp) nil end |