Class: BELParser::Language::Semantics::SemanticCovalentProteinModificationOf
- Inherits:
-
SemanticASTNode
- Object
- AST::Node
- SemanticASTNode
- BELParser::Language::Semantics::SemanticCovalentProteinModificationOf
- Defined in:
- lib/bel_parser/language/semantics_ast.rb
Overview
AST node for CovalentProteinModificationOf is a semantic AST.
Instance Attribute Summary
Attributes inherited from AST::Node
Instance Method Summary collapse
- #covalent_protein_modification_types ⇒ Object
-
#initialize(mod_types, **properties) ⇒ SemanticCovalentProteinModificationOf
constructor
A new instance of SemanticCovalentProteinModificationOf.
- #match(value_node, 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(mod_types, **properties) ⇒ SemanticCovalentProteinModificationOf
Returns a new instance of SemanticCovalentProteinModificationOf.
687 688 689 690 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 687 def initialize(mod_types, **properties) properties[:hashed] = Hash[mod_types.map { |t| [t, true] }] super(:covalent_protein_modification_of, mod_types, properties) end |
Instance Method Details
#covalent_protein_modification_types ⇒ Object
692 693 694 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 692 def covalent_protein_modification_types children end |
#match(value_node, spec, will_match_partial = false) ⇒ Object
696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 696 def match(value_node, spec, will_match_partial = false) string_literal_sym = value_node.children[0].string_literal.to_sym return success(value_node, spec) if @hashed[:*] if @hashed.key?(string_literal_sym) success(value_node, spec) else invalid_protein_modification_warning( value_node, spec, @hashed.keys) end end |