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
-
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:FormatVisitor
Called by an expression when no other method is compatible.- Specified by:
visitExpression
in interfaceFormatVisitor
- Parameters:
e
- The calling expression.- Returns:
- The formatted expression.
-
visitBinaryExpression
Description copied from interface:FormatVisitor
Called by a binary expression.- Specified by:
visitBinaryExpression
in interfaceFormatVisitor
- Parameters:
e
- The calling expression.- Returns:
- The formatted expression.
-
visitBrackets
Description copied from interface:FormatVisitor
Called by a bracket expression.- Specified by:
visitBrackets
in interfaceFormatVisitor
- Parameters:
e
- The calling expression.- Returns:
- The formatted expression.
-
visitConstant
Description copied from interface:FormatVisitor
Called by a constant.- Specified by:
visitConstant
in interfaceFormatVisitor
- Parameters:
e
- The calling expression.- Returns:
- The formatted expression.
-
visitFunctionCall
Description copied from interface:FormatVisitor
Called by a function call expression.- Specified by:
visitFunctionCall
in interfaceFormatVisitor
- Parameters:
e
- The calling expression.- Returns:
- The formatted expression.
-
visitUnaryExpression
Description copied from interface:FormatVisitor
Called by an unary expression.- Specified by:
visitUnaryExpression
in interfaceFormatVisitor
- Parameters:
e
- The calling expression.- Returns:
- The formatted expression.
-
visitVariable
Description copied from interface:FormatVisitor
Called by a variable reference.- Specified by:
visitVariable
in interfaceFormatVisitor
- Parameters:
e
- The calling expression.- Returns:
- The formatted expression.
-