Class: SrcLexer::Token

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str, line_no, char_no) ⇒ Token

Returns a new instance of Token.



8
9
10
11
12
# File 'lib/src_lexer.rb', line 8

def initialize(str, line_no, char_no)
  @str = str
  @line_no = line_no
  @char_no = char_no
end

Instance Attribute Details

#char_noObject (readonly)

Returns the value of attribute char_no.



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

def char_no
  @char_no
end

#line_noObject (readonly)

Returns the value of attribute line_no.



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

def line_no
  @line_no
end

#strObject (readonly)

Returns the value of attribute str.



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

def str
  @str
end

Instance Method Details

#==(other_object) ⇒ Object



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

def ==(other_object)
  @str == other_object.str && @line_no == other_object.line_no && @char_no == other_object.char_no
end