Class: Ruco::Token
- Inherits:
-
Object
- Object
- Ruco::Token
- Defined in:
- lib/ruco.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #generate(indent = 0) ⇒ Object
-
#initialize(name, prodset) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(name, prodset) ⇒ Token
Returns a new instance of Token.
45 46 47 |
# File 'lib/ruco.rb', line 45 def initialize(name, prodset) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
44 45 46 |
# File 'lib/ruco.rb', line 44 def name @name end |
Instance Method Details
#generate(indent = 0) ⇒ Object
49 50 51 |
# File 'lib/ruco.rb', line 49 def generate(indent=0) "#{("\t"*indent)}#{name} (. production->content = t->val; .)" end |