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 int
ERR_ON_SYNTAX
The Constant ERR_ON_SYNTAX.(package private) java.util.List<ShaperError>
errorList
The error list.static int
LAST_SYNTAX_ERROR
The Constant LAST_SYNTAX_ERROR.(package private) org.antlr.runtime.TokenStream
lexerStream
The lexer stream.(package private) Shape
s
The s.static int
SEM_MAX_COORD
The Constant SEM_MAX_COORD.static int
SEM_RECT_PERPEN
The Constant SEM_RECT_PERPEN.static int
SEM_TRIANG_INEQ
The Constant SEM_TRIANG_INEQ.static int
TOKEN_ERROR
The Constant TOKEN_ERROR.static int
UNDEFINED
The 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.String
conversion()
Conversion.void
createShape(Shape in, Shape f)
Creates the shape.java.util.List<ShaperError>
getErrorList()
Gets the error list.Shape
getS()
Gets the s.(package private) void
handleError(java.lang.String[] tokenNames, org.antlr.runtime.RecognitionException e, java.lang.String h, java.lang.String m)
Handle error.void
printShape()
Prints the shape.void
semanticErrorHandler(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
-