Class: BELParser::Language::Semantics::MultipleSubjectObjectWarning

Inherits:
SemanticsWarning show all
Defined in:
lib/bel_parser/language/semantics/multiple_subject_object.rb

Overview

Represents a SemanticsWarning when a Parsers::AST::Statement includes the subject term as an argument of an object list term.

Instance Attribute Summary

Attributes inherited from SemanticsResult

#expression_node, #specification

Instance Method Summary collapse

Methods inherited from SemanticsWarning

#failure?, #success?

Methods inherited from SemanticsResult

#failure?, #msg, #success?

Constructor Details

#initialize(stmt_node, spec, rel) ⇒ MultipleSubjectObjectWarning

Returns a new instance of MultipleSubjectObjectWarning.



42
43
44
45
# File 'lib/bel_parser/language/semantics/multiple_subject_object.rb', line 42

def initialize(stmt_node, spec, rel)
  super(stmt_node, spec)
  @rel = rel
end

Instance Method Details

#to_sObject



47
48
49
50
51
52
# File 'lib/bel_parser/language/semantics/multiple_subject_object.rb', line 47

def to_s
  <<-MSG.gsub(/ {12}/, '').delete("\n")
    A "#{@rel.long}" statement cannot use the subject term as an
     object list() argument.
  MSG
end