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, will_match_partial = false) ⇒ Object
- #terminal? ⇒ Boolean
- #value_patterns ⇒ Object
Methods inherited from AST::Node
#==, #append, #concat, #dup, #eql?, #inspect, #to_a, #to_ast, #to_bel, #to_s, #to_sexp, #updated
Methods included from Parsers
Constructor Details
#initialize(children = [], **properties) ⇒ SemanticIdentifier
Returns a new instance of SemanticIdentifier.
513 514 515 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 513 def initialize(children = [], **properties) super(:identifier, children, properties) end |
Instance Method Details
#match(identifier, spec, will_match_partial = false) ⇒ Object
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 525 def match(identifier, spec, will_match_partial = false) 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
517 518 519 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 517 def terminal? true end |
#value_patterns ⇒ Object
521 522 523 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 521 def value_patterns children end |