Class: BELParser::Language::Semantics::SemanticIdentifier
- Inherits:
-
SemanticASTNode
- Object
- AST::Node
- SemanticASTNode
- BELParser::Language::Semantics::SemanticIdentifier
- Defined in:
- lib/bel_parser/language/semantics_ast.rb
Overview
AST node for Identifier is a semantic AST.
Instance Attribute Summary
Attributes inherited from AST::Node
Instance Method Summary collapse
-
#initialize(children = [], **properties) ⇒ SemanticIdentifier
constructor
A new instance of SemanticIdentifier.
- #match(identifier, spec) ⇒ Object
- #terminal? ⇒ Boolean
- #value_patterns ⇒ Object
Methods inherited from AST::Node
#==, #append, #concat, #dup, #eql?, #inspect, #to_a, #to_ast, #to_sexp, #updated
Constructor Details
#initialize(children = [], **properties) ⇒ SemanticIdentifier
Returns a new instance of SemanticIdentifier.
514 515 516 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 514 def initialize(children = [], **properties) super(:identifier, children, properties) end |
Instance Method Details
#match(identifier, spec) ⇒ Object
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 526 def match(identifier, spec) return nil_node_warning( identifier, spec, BELParser::Parsers::AST::Identifier) if identifier.nil? if identifier.type != BELParser::Parsers::AST::Identifier.ast_type return type_warning( identifier, spec, BELParser::Parsers::AST::Identifier, identifier) end value_patterns.map { |pattern| pattern.match(identifier, spec) } end |
#terminal? ⇒ Boolean
518 519 520 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 518 def terminal? true end |
#value_patterns ⇒ Object
522 523 524 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 522 def value_patterns children end |