Class: Lrama::Grammar::Reference

Inherits:
Struct
  • Object
show all
Defined in:
lib/lrama/grammar/reference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ex_tagObject

Returns the value of attribute ex_tag

Returns:

  • (Object)

    the current value of ex_tag



6
7
8
# File 'lib/lrama/grammar/reference.rb', line 6

def ex_tag
  @ex_tag
end

#first_columnObject

Returns the value of attribute first_column

Returns:

  • (Object)

    the current value of first_column



6
7
8
# File 'lib/lrama/grammar/reference.rb', line 6

def first_column
  @first_column
end

#last_columnObject

Returns the value of attribute last_column

Returns:

  • (Object)

    the current value of last_column



6
7
8
# File 'lib/lrama/grammar/reference.rb', line 6

def last_column
  @last_column
end

#position_in_rhsObject

Returns the value of attribute position_in_rhs

Returns:

  • (Object)

    the current value of position_in_rhs



6
7
8
# File 'lib/lrama/grammar/reference.rb', line 6

def position_in_rhs
  @position_in_rhs
end

#referring_symbolObject

Returns the value of attribute referring_symbol

Returns:

  • (Object)

    the current value of referring_symbol



6
7
8
# File 'lib/lrama/grammar/reference.rb', line 6

def referring_symbol
  @referring_symbol
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



6
7
8
# File 'lib/lrama/grammar/reference.rb', line 6

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



6
7
8
# File 'lib/lrama/grammar/reference.rb', line 6

def value
  @value
end

Instance Method Details

#tagObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lrama/grammar/reference.rb', line 7

def tag
  if ex_tag
    ex_tag
  else
    # FIXME: Remove this class check
    if referring_symbol.is_a?(Symbol)
      referring_symbol.tag
    else
      # Lrama::Lexer::Token (User_code) case
      nil
    end
  end
end