Class: Token

Inherits:
Object
  • Object
show all
Defined in:
lib/token.rb

Direct Known Subclasses

LexicalToken

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, lineNum, colNum) ⇒ Token

Returns a new instance of Token.



4
5
6
7
8
# File 'lib/token.rb', line 4

def initialize(type,lineNum,colNum)
  @type = type
  @line = lineNum
  @col = colNum
end

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



2
3
4
# File 'lib/token.rb', line 2

def col
  @col
end

#lineObject (readonly)

Returns the value of attribute line.



2
3
4
# File 'lib/token.rb', line 2

def line
  @line
end

#typeObject (readonly)

Returns the value of attribute type.



2
3
4
# File 'lib/token.rb', line 2

def type
  @type
end