Class: TaskJuggler::TextParser::TokenDoc
- Defined in:
- lib/taskjuggler/TextParser/TokenDoc.rb
Overview
Utility class to store a name and a textual description of the meaning of a token used by the parser syntax tree. A specification of the variable type and a reference to a specific pattern are optional.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#typeSpec ⇒ Object
Returns the value of attribute typeSpec.
Instance Method Summary collapse
-
#initialize(name, arg) ⇒ TokenDoc
constructor
Construct a ParserTokenDoc object.
Constructor Details
#initialize(name, arg) ⇒ TokenDoc
Construct a ParserTokenDoc object. name and text are Strings that hold the name and textual description of the parser token.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 26 def initialize(name, arg) @name = name if arg.is_a?(String) @text = arg else @pattern = arg end @typeSpec = nil @pattern = nil end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 22 def name @name end |
#pattern ⇒ Object
Returns the value of attribute pattern.
22 23 24 |
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 22 def pattern @pattern end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
21 22 23 |
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 21 def text @text end |
#typeSpec ⇒ Object
Returns the value of attribute typeSpec.
22 23 24 |
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 22 def typeSpec @typeSpec end |