Class: Parser::Marker
- Defined in:
- lib/carat/parser.rb,
lib/carat/parser-old.rb
Overview
Token Marker
This is the superclas of Token, UnitToken and RawToken
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#content ⇒ Object
Returns the value of attribute content.
-
#inner_range ⇒ Object
Returns the value of attribute inner_range.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#match ⇒ Object
Returns the value of attribute match.
-
#outer_range ⇒ Object
Returns the value of attribute outer_range.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#<<(content) ⇒ Object
array-like methods.
- #each(&blk) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(key, match, parent) ⇒ Marker
constructor
A new instance of Marker.
- #last ⇒ Object
- #pop ⇒ Object
Constructor Details
#initialize(key, match, parent) ⇒ Marker
Returns a new instance of Marker.
138 139 140 |
# File 'lib/carat/parser.rb', line 138 def initialize @content = [] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
299 300 301 |
# File 'lib/carat/parser-old.rb', line 299 def body @body end |
#content ⇒ Object
Returns the value of attribute content.
136 137 138 |
# File 'lib/carat/parser.rb', line 136 def content @content end |
#inner_range ⇒ Object
Returns the value of attribute inner_range.
137 138 139 |
# File 'lib/carat/parser.rb', line 137 def inner_range @inner_range end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
299 300 301 |
# File 'lib/carat/parser-old.rb', line 299 def key @key end |
#match ⇒ Object
Returns the value of attribute match.
136 137 138 |
# File 'lib/carat/parser.rb', line 136 def match @match end |
#outer_range ⇒ Object
Returns the value of attribute outer_range.
137 138 139 |
# File 'lib/carat/parser.rb', line 137 def outer_range @outer_range end |
#parent ⇒ Object
Returns the value of attribute parent.
136 137 138 |
# File 'lib/carat/parser.rb', line 136 def parent @parent end |
#token ⇒ Object
Returns the value of attribute token.
136 137 138 |
# File 'lib/carat/parser.rb', line 136 def token @token end |
Instance Method Details
#<<(content) ⇒ Object
array-like methods
142 |
# File 'lib/carat/parser.rb', line 142 def <<( content ) ; @content << content ; end |
#each(&blk) ⇒ Object
146 |
# File 'lib/carat/parser.rb', line 146 def each(&blk) ; @content.each(&blk) ; end |
#empty? ⇒ Boolean
144 |
# File 'lib/carat/parser.rb', line 144 def empty? ; @content.empty? ; end |
#last ⇒ Object
143 |
# File 'lib/carat/parser.rb', line 143 def last ; @content.empty? ? @content : @content.last ; end |
#pop ⇒ Object
145 |
# File 'lib/carat/parser.rb', line 145 def pop ; @content.pop ; end |