java.lang.Object
dev.civl.abc.transform.IF.BaseTransformer
dev.civl.mc.transform.IF.IntOperationTransformer
- All Implemented Interfaces:
dev.civl.abc.transform.IF.Transformer
public class IntOperationTransformer
extends dev.civl.abc.transform.IF.BaseTransformer
This transformer is used to
- replace integer division ('/') and integer modulo ('%') in the program with $int_div(int, int) and $int_mod(int, int) functions respectively
- replace unsigned integer arithmetic operations with corresponding library functions: int $unsigned_add, int $unsigned_subtract, int $unsigned_multiply
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe code (short name) of this transformer.static final StringThe long name of the transformer.static final StringThe description of this transformer.Fields inherited from class dev.civl.abc.transform.IF.BaseTransformer
astFactory, code, longName, nodeFactory, shortDescription -
Constructor Summary
ConstructorsConstructorDescriptionIntOperationTransformer(dev.civl.abc.ast.IF.ASTFactory astFactory, Map<String, String> macros, CIVLConfiguration config) -
Method Summary
Methods inherited from class dev.civl.abc.transform.IF.BaseTransformer
getCode, getConfiguration, getShortDescription, newStringLiteralNode, toString
-
Field Details
-
CODE
The code (short name) of this transformer.- See Also:
-
LONG_NAME
The long name of the transformer.- See Also:
-
SHORT_DESCRIPTION
The description of this transformer.- See Also:
-
-
Constructor Details
-
IntOperationTransformer
public IntOperationTransformer(dev.civl.abc.ast.IF.ASTFactory astFactory, Map<String, String> macros, CIVLConfiguration config)
-
-
Method Details
-
transform
public dev.civl.abc.ast.IF.AST transform(dev.civl.abc.ast.IF.AST ast) throws dev.civl.abc.token.IF.SyntaxException - Throws:
dev.civl.abc.token.IF.SyntaxException
-