Class TypedInterpreter<T>
java.lang.Object
quickparse.semantics.interpreters.typed.TypedInterpreter<T>
- All Implemented Interfaces:
Interpreter<T>
public abstract class TypedInterpreter<T> extends java.lang.Object implements Interpreter<T>
-
Constructor Summary
Constructors Constructor Description TypedInterpreter(Grammar grammar) -
Method Summary
Modifier and Type Method Description Tanalyze(SyntaxTree syntaxTree)protected SyntaxTreegetCurrentSyntaxNode()Gets the node that this interpreter is currently analyzing.
This method is useful to generate detailed semantic errors from inside the annotated methods of the interpreter.GrammargetGrammar()protected SyntaxTreegetSyntaxNodeByResult(java.lang.Object result)Gets the node whose interpretation generated the given result object.
This method is useful to generate detailed semantic errors from inside the annotated methods of the interpreter.
-
Constructor Details
-
Method Details
-
getGrammar
-
getCurrentSyntaxNode
Gets the node that this interpreter is currently analyzing.
This method is useful to generate detailed semantic errors from inside the annotated methods of the interpreter.- Returns:
- A
syntax node
-
getSyntaxNodeByResult
Gets the node whose interpretation generated the given result object.
This method is useful to generate detailed semantic errors from inside the annotated methods of the interpreter.- Parameters:
result- a result object generated by an annotated method of this interpreter- Returns:
- A
syntax node - Throws:
java.lang.IllegalArgumentException- if the given result object is not the direct result of the analysis of a syntax node
-
analyze
- Specified by:
analyzein interfaceInterpreter<T>- Throws:
SemanticsException
-