Class: TokenParser::Marker

Inherits:
Object show all
Defined in:
lib/mega/tokenparser.rb

Overview

Token Marker

This is the superclas of Token, UnitToken and RawToken

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMarker

Returns a new instance of Marker.



152
153
154
# File 'lib/mega/tokenparser.rb', line 152

def initialize
  @content = []
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



150
151
152
# File 'lib/mega/tokenparser.rb', line 150

def content
  @content
end

#inner_rangeObject

Returns the value of attribute inner_range.



151
152
153
# File 'lib/mega/tokenparser.rb', line 151

def inner_range
  @inner_range
end

#matchObject

Returns the value of attribute match.



150
151
152
# File 'lib/mega/tokenparser.rb', line 150

def match
  @match
end

#outer_rangeObject

Returns the value of attribute outer_range.



151
152
153
# File 'lib/mega/tokenparser.rb', line 151

def outer_range
  @outer_range
end

#parentObject

Returns the value of attribute parent.



150
151
152
# File 'lib/mega/tokenparser.rb', line 150

def parent
  @parent
end

#tokenObject

Returns the value of attribute token.



150
151
152
# File 'lib/mega/tokenparser.rb', line 150

def token
  @token
end

Instance Method Details

#<<(content) ⇒ Object

array-like methods



156
# File 'lib/mega/tokenparser.rb', line 156

def <<( content ) ; @content << content ; end

#each(&blk) ⇒ Object



160
# File 'lib/mega/tokenparser.rb', line 160

def each(&blk) ; @content.each(&blk) ; end

#empty?Boolean

Returns:

  • (Boolean)


158
# File 'lib/mega/tokenparser.rb', line 158

def empty? ; @content.empty? ; end

#lastObject



157
# File 'lib/mega/tokenparser.rb', line 157

def last ; @content.empty? ? @content : @content.last ; end

#popObject



159
# File 'lib/mega/tokenparser.rb', line 159

def pop ; @content.pop ; end