Class: SystemRDL::Parser::Position

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, line, column) ⇒ Position

Returns a new instance of Position.



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

def initialize(filename, line, column)
  @filename = filename
  @line = line
  @column = column
  freeze
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



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

def column
  @column
end

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



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

def line
  @line
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/systemrdl/parser/token.rb', line 17

def to_s
  "filename: #{filename} line: #{line} column: #{column}"
end