Class: TaskJuggler::TextParser::TokenDoc

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 22

def name
  @name
end

#patternObject

Returns the value of attribute pattern.



22
23
24
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 22

def pattern
  @pattern
end

#textObject (readonly)

Returns the value of attribute text.



21
22
23
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 21

def text
  @text
end

#typeSpecObject

Returns the value of attribute typeSpec.



22
23
24
# File 'lib/taskjuggler/TextParser/TokenDoc.rb', line 22

def typeSpec
  @typeSpec
end