Class: Parser
Overview
Generic Parser class
Direct Known Subclasses
Constant Summary
Constants included from LogUtils
Instance Attribute Summary collapse
-
#figures ⇒ Object
readonly
Returns the value of attribute figures.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#initialize(tokens, semantics = 'ntk') ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(tokens, semantics = 'ntk') ⇒ Parser
Returns a new instance of Parser.
27 28 29 30 31 32 33 |
# File 'lib/sitac_parser.rb', line 27 def initialize(tokens, semantics = 'ntk') @tokens = tokens @name = @tokens.find { |token| token.type == ':figName' }.value.first.first @figures = [] semclass = semantics == 'ntk' ? NTKSemantics.new : MelissaSemantics.new @sems, @regexes = semclass.sems_and_regexes end |
Instance Attribute Details
#figures ⇒ Object (readonly)
Returns the value of attribute figures.
25 26 27 |
# File 'lib/sitac_parser.rb', line 25 def figures @figures end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
25 26 27 |
# File 'lib/sitac_parser.rb', line 25 def name @name end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
25 26 27 |
# File 'lib/sitac_parser.rb', line 25 def tokens @tokens end |