Class: BELParser::Language::Syntax::SyntaxError
- Inherits:
-
SyntaxResult
- Object
- SyntaxResult
- BELParser::Language::Syntax::SyntaxError
- Defined in:
- lib/bel_parser/language/syntax_error.rb
Overview
SyntaxError defines a SyntaxResult that should be regarded as an error with the expression.
Direct Known Subclasses
InvalidFunctionSyntaxError, InvalidRelationshipSyntaxError, UndefinedNamespaceError, Script::Syntax::InvalidRegexPatternError, Script::Syntax::UndefinedAnnotationError, Script::Syntax::UnresolvableNamespaceError
Instance Attribute Summary
Attributes inherited from SyntaxResult
#expression_node, #specification
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(expression_node, specification) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #msg ⇒ Object abstract
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(expression_node, specification) ⇒ SyntaxError
Returns a new instance of SyntaxError.
9 10 11 |
# File 'lib/bel_parser/language/syntax_error.rb', line 9 def initialize(expression_node, specification) super(expression_node, specification) end |
Instance Method Details
#failure? ⇒ Boolean
22 23 24 |
# File 'lib/bel_parser/language/syntax_error.rb', line 22 def failure? true end |
#msg ⇒ Object
This method is abstract.
Subclass and override #msg to provide the message.
14 15 16 |
# File 'lib/bel_parser/language/syntax_error.rb', line 14 def msg raise NotImplementedError, "#{__method__} is not implemented." end |
#success? ⇒ Boolean
18 19 20 |
# File 'lib/bel_parser/language/syntax_error.rb', line 18 def success? false end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/bel_parser/language/syntax_error.rb', line 26 def to_s "Error: #{msg}" end |