org.grinvin.expr

Class ExpressionToFormula

Implemented Interfaces:
Expression.Visitor

public class ExpressionToFormula
extends java.lang.Object
implements Expression.Visitor

Visitor which converts an expression to a formula.

Note: This class is not thread safe.

Method Summary

TeXFormula
getFormula()
Return the resulting formula.
int
getStrength()
Return the strength of the resulting formula.
void
visitCompound(Compound compound)
void
visitIntegerLiteral(IntegerLiteral literal)
void
visitInvariant(Invariant invariant)

Method Details

getFormula

public TeXFormula getFormula()
Return the resulting formula.

getStrength

public int getStrength()
Return the strength of the resulting formula. (Used to determine whether parentheses are needed.)

visitCompound

public void visitCompound(Compound compound)
Specified by:
visitCompound in interface Expression.Visitor

visitIntegerLiteral

public void visitIntegerLiteral(IntegerLiteral literal)
Specified by:
visitIntegerLiteral in interface Expression.Visitor

visitInvariant

public void visitInvariant(Invariant invariant)
Specified by:
visitInvariant in interface Expression.Visitor