Class: BELParser::Language::Semantics::SemanticMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/bel_parser/language/semantics_match.rb

Overview

SemanticMatch holds the results of an input AST to semantic AST match.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(success, input_node, semantic_node) ⇒ SemanticMatch

Returns a new instance of SemanticMatch.



8
9
10
11
12
# File 'lib/bel_parser/language/semantics_match.rb', line 8

def initialize(success, input_node, semantic_node)
  @success       = success
  @input_node    = input_node
  @semantic_node = semantic_node
end

Instance Attribute Details

#input_nodeObject (readonly)

Returns the value of attribute input_node.



6
7
8
# File 'lib/bel_parser/language/semantics_match.rb', line 6

def input_node
  @input_node
end

#semantic_nodeObject (readonly)

Returns the value of attribute semantic_node.



6
7
8
# File 'lib/bel_parser/language/semantics_match.rb', line 6

def semantic_node
  @semantic_node
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/bel_parser/language/semantics_match.rb', line 18

def failure?
  !@success
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/bel_parser/language/semantics_match.rb', line 14

def success?
  @success
end

#to_sObject



22
23
24
# File 'lib/bel_parser/language/semantics_match.rb', line 22

def to_s
  msg
end