Class: PLang::Parser::Token

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Token

Returns a new instance of Token.



10
11
12
# File 'lib/parser/token.rb', line 10

def initialize(type)
  @type = type
end

Instance Attribute Details

#iObject

Returns the value of attribute i.



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

def i
  @i
end

#lineObject

Returns the value of attribute line.



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

def line
  @line
end

#srcObject

Returns the value of attribute src.



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

def src
  @src
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/parser/token.rb', line 14

def to_s
  "\#{#{type.to_s}: #{value}}"
end