Class: Parser::Token
- Inherits:
-
Object
- Object
- Parser::Token
- Defined in:
- lib/amy/parser/tokens.rb
Instance Attribute Summary collapse
-
#lineno ⇒ Object
Returns the value of attribute lineno.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value, lineno) ⇒ Token
constructor
A new instance of Token.
- #is_a?(type) ⇒ Boolean
- #is_c? ⇒ Boolean
- #is_ct? ⇒ Boolean
- #is_p? ⇒ Boolean
- #is_s? ⇒ Boolean
Constructor Details
#initialize(type, value, lineno) ⇒ Token
Returns a new instance of Token.
13 14 15 16 17 |
# File 'lib/amy/parser/tokens.rb', line 13 def initialize(type, value, lineno) @type = type @value = value @lineno = lineno end |
Instance Attribute Details
#lineno ⇒ Object
Returns the value of attribute lineno.
12 13 14 |
# File 'lib/amy/parser/tokens.rb', line 12 def lineno @lineno end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'lib/amy/parser/tokens.rb', line 12 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
12 13 14 |
# File 'lib/amy/parser/tokens.rb', line 12 def value @value end |
Instance Method Details
#is_a?(type) ⇒ Boolean
34 35 36 |
# File 'lib/amy/parser/tokens.rb', line 34 def is_a?(type) @type == type end |
#is_c? ⇒ Boolean
22 23 24 |
# File 'lib/amy/parser/tokens.rb', line 22 def is_c? Tokens::COMMENT == @type or Tokens::COMMENT_TAG == @type end |
#is_ct? ⇒ Boolean
19 20 21 |
# File 'lib/amy/parser/tokens.rb', line 19 def is_ct? Tokens::COMMENT_TAG == @type end |