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

getter attr_writer setter attr_accessor getter y setter



6
7
8
9
10
# File 'lib/token.rb', line 6

def initialize(type,lineNum,colNum)
  @type = type  #Variable de instancia empieza 
  @line = lineNum #con @
  @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