Class: BELParser::Language::Semantics::SemanticMatch
- Inherits:
-
Object
- Object
- BELParser::Language::Semantics::SemanticMatch
- 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
-
#input_node ⇒ Object
readonly
Returns the value of attribute input_node.
-
#semantic_node ⇒ Object
readonly
Returns the value of attribute semantic_node.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(success, input_node, semantic_node) ⇒ SemanticMatch
constructor
A new instance of SemanticMatch.
- #success? ⇒ Boolean
- #to_s ⇒ Object
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_node ⇒ Object (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_node ⇒ Object (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
18 19 20 |
# File 'lib/bel_parser/language/semantics_match.rb', line 18 def failure? !@success end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/bel_parser/language/semantics_match.rb', line 14 def success? @success end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/bel_parser/language/semantics_match.rb', line 22 def to_s msg end |