class BELParser::Language::Semantics::SemanticASTNode
SemanticASTNode
represents a node in the semantic tree structure.
Public Class Methods
new(type, children = [], **properties)
click to toggle source
Calls superclass method
AST::Node::new
# File lib/bel_parser/language/semantics_ast.rb, line 172 def initialize(type, children = [], **properties) super(type, children, properties) end
Public Instance Methods
terminal?()
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 176 def terminal? false end
Protected Instance Methods
argument_length_warning(node, spec, expected, actual)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 210 def argument_length_warning(node, spec, expected, actual) [SemanticsArgumentLengthWarning.new(node, spec, expected, actual)] end
invalid_amino_acid_range_warning(node, spec)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 246 def invalid_amino_acid_range_warning(node, spec) [SemanticsInvalidAminoAcidRangeWarning.new(node, spec)] end
invalid_amino_acid_warning(node, spec, expected)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 242 def invalid_amino_acid_warning(node, spec, expected) [SemanticsInvalidAminoAcidWarning.new(node, spec, expected)] end
invalid_encoding_warning(node, spec, expected)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 226 def invalid_encoding_warning(node, spec, expected) [SemanticsInvalidEncodingWarning.new(node, spec, expected)] end
invalid_function_warning(node, spec, expected)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 230 def invalid_function_warning(node, spec, expected) [SemanticsInvalidFunctionWarning.new(node, spec, expected)] end
invalid_namespace(node, spec, expected)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 218 def invalid_namespace(node, spec, expected) [SemanticsInvalidNamespaceWarning.new(node, spec, expected)] end
invalid_protein_modification_warning(node, spec, expected)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 238 def invalid_protein_modification_warning(node, spec, expected) [SemanticsInvalidProteinModificationWarning.new(node, spec, expected)] end
invalid_return_type_warning(node, spec, expected)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 234 def invalid_return_type_warning(node, spec, expected) [SemanticsInvalidReturnTypeWarning.new(node, spec, expected)] end
invalid_sequence_position_warning(node, spec)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 250 def invalid_sequence_position_warning(node, spec) [SemanticsInvalidSequencePositionWarning.new(node, spec)] end
missing_encoding_warning(node, spec)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 222 def missing_encoding_warning(node, spec) [SemanticsMissingEncodingWarning.new(node, spec)] end
missing_namespace_warning(node, spec)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 214 def missing_namespace_warning(node, spec) [SemanticsMissingNamespaceWarning.new(node, spec)] end
nil_node_warning(node, spec, expected)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 198 def nil_node_warning(node, spec, expected) [SemanticsNilNodeWarning.new(node, spec, expected)] end
not_nil_node_warning(node, spec)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 202 def not_nil_node_warning(node, spec) [SemanticsNotNilNodeWarning.new(node, spec)] end
success(node, spec)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 194 def success(node, spec) [SemanticsResult.new(node, spec)] end
type_warning(node, spec, expected, actual)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 206 def type_warning(node, spec, expected, actual) [SemanticsTypeWarning.new(node, spec, expected, actual)] end
updated(_ = nil, children = nil, properties = nil)
click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 182 def updated(_ = nil, children = nil, properties = nil) new_children = children || @children new_properties = properties || {} if @children == new_children && properties.nil? self else # Maybe change call? original_dup.send :initialize, new_children, new_properties end end