Class ToStringVisitor

  • All Implemented Interfaces:
    Visitor<String>

    public class ToStringVisitor
    extends Object
    implements Visitor<String>
    Expression visitor for creating a string representation.
    Author:
    Herbert Prähofer
    • Constructor Detail

      • ToStringVisitor

        public ToStringVisitor()
    • Method Detail

      • visitLit

        public String visitLit​(Expr.Lit lit)
        Description copied from interface: Visitor
        Visits a literal.
        Specified by:
        visitLit in interface Visitor<String>
        Parameters:
        lit - the literal to visit
        Returns:
        the return value
      • visitVar

        public String visitVar​(Expr.Var vbl)
        Description copied from interface: Visitor
        Visits a variable.
        Specified by:
        visitVar in interface Visitor<String>
        Parameters:
        vbl - the variable to visit
        Returns:
        the return value
      • visitNot

        public String visitNot​(Expr.Not not)
        Description copied from interface: Visitor
        Visits a not-expression.
        Specified by:
        visitNot in interface Visitor<String>
        Parameters:
        not - the not-expression to visit
        Returns:
        the return value
      • visitAnd

        public String visitAnd​(Expr.And and)
        Description copied from interface: Visitor
        Visits an and-expression.
        Specified by:
        visitAnd in interface Visitor<String>
        Parameters:
        and - the and-expression to visit
        Returns:
        the return value
      • visitOr

        public String visitOr​(Expr.Or or)
        Description copied from interface: Visitor
        Visits an or-expression.
        Specified by:
        visitOr in interface Visitor<String>
        Parameters:
        or - the or-expression to visit
        Returns:
        the return value