Class: LL::Terminal
- Inherits:
-
Object
- Object
- LL::Terminal
- Defined in:
- lib/ll/terminal.rb
Overview
Class containing details of a single terminal in a grammar.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
-
#source_line ⇒ Object
readonly
Returns the value of attribute source_line.
Instance Method Summary collapse
- #increment_references ⇒ Object
-
#initialize(name, source_line) ⇒ Terminal
constructor
A new instance of Terminal.
- #inspect ⇒ String
Constructor Details
#initialize(name, source_line) ⇒ Terminal
Returns a new instance of Terminal.
12 13 14 15 16 |
# File 'lib/ll/terminal.rb', line 12 def initialize(name, source_line) @name = name @source_line = source_line @references = 0 end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ll/terminal.rb', line 6 def name @name end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
6 7 8 |
# File 'lib/ll/terminal.rb', line 6 def references @references end |
#source_line ⇒ Object (readonly)
Returns the value of attribute source_line.
6 7 8 |
# File 'lib/ll/terminal.rb', line 6 def source_line @source_line end |
Instance Method Details
#increment_references ⇒ Object
18 19 20 |
# File 'lib/ll/terminal.rb', line 18 def increment_references @references += 1 end |
#inspect ⇒ String
25 26 27 |
# File 'lib/ll/terminal.rb', line 25 def inspect return "Terminal(name: #{name.inspect})" end |