Package org.oristool.lello.visitor
Class DefaultFormatter
java.lang.Object
org.oristool.lello.visitor.DefaultFormatter
- All Implemented Interfaces:
FormatVisitor
Formats a Lello expression according to a C-like syntax. This is an
implementation of the FormatVisitor interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalled by a binary expression.Called by a bracket expression.Called by a constant.Called by an expression when no other method is compatible.Called by a function call expression.Called by an unary expression.Called by a variable reference.
-
Constructor Details
-
DefaultFormatter
public DefaultFormatter()
-
-
Method Details
-
visitExpression
Description copied from interface:FormatVisitorCalled by an expression when no other method is compatible.- Specified by:
visitExpressionin interfaceFormatVisitor- Parameters:
e- The calling expression.- Returns:
- The formatted expression.
-
visitBinaryExpression
Description copied from interface:FormatVisitorCalled by a binary expression.- Specified by:
visitBinaryExpressionin interfaceFormatVisitor- Parameters:
e- The calling expression.- Returns:
- The formatted expression.
-
visitBrackets
Description copied from interface:FormatVisitorCalled by a bracket expression.- Specified by:
visitBracketsin interfaceFormatVisitor- Parameters:
e- The calling expression.- Returns:
- The formatted expression.
-
visitConstant
Description copied from interface:FormatVisitorCalled by a constant.- Specified by:
visitConstantin interfaceFormatVisitor- Parameters:
e- The calling expression.- Returns:
- The formatted expression.
-
visitFunctionCall
Description copied from interface:FormatVisitorCalled by a function call expression.- Specified by:
visitFunctionCallin interfaceFormatVisitor- Parameters:
e- The calling expression.- Returns:
- The formatted expression.
-
visitUnaryExpression
Description copied from interface:FormatVisitorCalled by an unary expression.- Specified by:
visitUnaryExpressionin interfaceFormatVisitor- Parameters:
e- The calling expression.- Returns:
- The formatted expression.
-
visitVariable
Description copied from interface:FormatVisitorCalled by a variable reference.- Specified by:
visitVariablein interfaceFormatVisitor- Parameters:
e- The calling expression.- Returns:
- The formatted expression.
-