Class: Lrama::Grammar::Reference

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

Overview

type: :dollar or :at name: String (e.g. $$, $foo, $expr.right) number: Integer (e.g. $1) index: Integer ex_tag: “$<tag>1” (Optional)

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



10
11
12
# File 'lib/lrama/grammar/reference.rb', line 10

def ex_tag
  @ex_tag
end

#first_columnObject

Returns the value of attribute first_column

Returns:

  • (Object)

    the current value of first_column



10
11
12
# File 'lib/lrama/grammar/reference.rb', line 10

def first_column
  @first_column
end

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



10
11
12
# File 'lib/lrama/grammar/reference.rb', line 10

def index
  @index
end

#last_columnObject

Returns the value of attribute last_column

Returns:

  • (Object)

    the current value of last_column



10
11
12
# File 'lib/lrama/grammar/reference.rb', line 10

def last_column
  @last_column
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



10
11
12
# File 'lib/lrama/grammar/reference.rb', line 10

def name
  @name
end

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



10
11
12
# File 'lib/lrama/grammar/reference.rb', line 10

def number
  @number
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



10
11
12
# File 'lib/lrama/grammar/reference.rb', line 10

def type
  @type
end

Instance Method Details

#valueObject



11
12
13
# File 'lib/lrama/grammar/reference.rb', line 11

def value
  name || number
end