Package shaperCompiler
Class shaperGrammarHandler
java.lang.Object
shaperCompiler.shaperGrammarHandler
public class shaperGrammarHandler
extends java.lang.Object
The Class shaperGrammarHandler.
-
Field Summary
Fields Modifier and Type Field Description static intERR_ON_SYNTAXThe Constant ERR_ON_SYNTAX.(package private) java.util.List<ShaperError>errorListThe error list.static intLAST_SYNTAX_ERRORThe Constant LAST_SYNTAX_ERROR.(package private) org.antlr.runtime.TokenStreamlexerStreamThe lexer stream.(package private) ShapesThe s.static intSEM_MAX_COORDThe Constant SEM_MAX_COORD.static intSEM_RECT_PERPENThe Constant SEM_RECT_PERPEN.static intSEM_TRIANG_INEQThe Constant SEM_TRIANG_INEQ.static intTOKEN_ERRORThe Constant TOKEN_ERROR.static intUNDEFINEDThe Constant UNDEFINED. -
Constructor Summary
Constructors Constructor Description shaperGrammarHandler(org.antlr.runtime.TokenStream ls)Instantiates a new shaper grammar handler. -
Method Summary
Modifier and Type Method Description java.lang.Stringconversion()Conversion.voidcreateShape(Shape in, Shape f)Creates the shape.java.util.List<ShaperError>getErrorList()Gets the error list.ShapegetS()Gets the s.(package private) voidhandleError(java.lang.String[] tokenNames, org.antlr.runtime.RecognitionException e, java.lang.String h, java.lang.String m)Handle error.voidprintShape()Prints the shape.voidsemanticErrorHandler(int code, org.antlr.runtime.Token tk)Semantic error handler.
-
Field Details
-
TOKEN_ERROR
public static final int TOKEN_ERRORThe Constant TOKEN_ERROR.- See Also:
- Constant Field Values
-
ERR_ON_SYNTAX
public static final int ERR_ON_SYNTAXThe Constant ERR_ON_SYNTAX.- See Also:
- Constant Field Values
-
SEM_TRIANG_INEQ
public static final int SEM_TRIANG_INEQThe Constant SEM_TRIANG_INEQ.- See Also:
- Constant Field Values
-
SEM_MAX_COORD
public static final int SEM_MAX_COORDThe Constant SEM_MAX_COORD.- See Also:
- Constant Field Values
-
SEM_RECT_PERPEN
public static final int SEM_RECT_PERPENThe Constant SEM_RECT_PERPEN.- See Also:
- Constant Field Values
-
UNDEFINED
public static final int UNDEFINEDThe Constant UNDEFINED.- See Also:
- Constant Field Values
-
LAST_SYNTAX_ERROR
public static final int LAST_SYNTAX_ERRORThe Constant LAST_SYNTAX_ERROR.- See Also:
- Constant Field Values
-
errorList
java.util.List<ShaperError> errorListThe error list. -
lexerStream
org.antlr.runtime.TokenStream lexerStreamThe lexer stream. -
s
Shape sThe s.
-
-
Constructor Details
-
shaperGrammarHandler
public shaperGrammarHandler(org.antlr.runtime.TokenStream ls)Instantiates a new shaper grammar handler.- Parameters:
ls- the ls
-
-
Method Details
-
createShape
Creates the shape.- Parameters:
in- the inf- the f
-
getErrorList
Gets the error list.- Returns:
- the error list
-
printShape
public void printShape()Prints the shape. -
handleError
void handleError(java.lang.String[] tokenNames, org.antlr.runtime.RecognitionException e, java.lang.String h, java.lang.String m)Handle error.- Parameters:
tokenNames- the token namese- the eh- the hm- the m
-
conversion
public java.lang.String conversion()Conversion.- Returns:
- the string
-
semanticErrorHandler
public void semanticErrorHandler(int code, org.antlr.runtime.Token tk)Semantic error handler.- Parameters:
code- the codetk- the tk
-
getS
Gets the s.- Returns:
- the s
-