Class: BELParser::Language::Semantics::SemanticFunctionOf
- Inherits:
-
SemanticASTNode
- Object
- AST::Node
- SemanticASTNode
- BELParser::Language::Semantics::SemanticFunctionOf
- Defined in:
- lib/bel_parser/language/semantics_ast.rb
Overview
AST node for FunctionOf is a semantic AST.
Instance Attribute Summary
Attributes inherited from AST::Node
Instance Method Summary collapse
- #functions ⇒ Object
-
#initialize(functions, **properties) ⇒ SemanticFunctionOf
constructor
A new instance of SemanticFunctionOf.
- #match(identifier, spec, will_match_partial = false) ⇒ Object
Methods inherited from SemanticASTNode
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(functions, **properties) ⇒ SemanticFunctionOf
Returns a new instance of SemanticFunctionOf.
638 639 640 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 638 def initialize(functions, **properties) super(:function_of, functions, properties) end |
Instance Method Details
#functions ⇒ Object
642 643 644 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 642 def functions children end |
#match(identifier, spec, will_match_partial = false) ⇒ Object
646 647 648 649 650 651 652 653 654 655 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 646 def match(identifier, spec, will_match_partial = false) return success(identifier, spec) if functions.include?(:*) function = spec.function(identifier.string_literal.to_sym) if functions.include?(function) success(identifier, spec) else invalid_function_warning(identifier, spec, functions) end end |