com.singularsys.jep
Interface PrintVisitor.PrintRulesI

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
PrintVisitor.StdElePrintRule, PrintVisitor.StdListPrintRule
Enclosing class:
PrintVisitor

public static interface PrintVisitor.PrintRulesI
extends java.io.Serializable

This interface specifies the method needed to implement a special print rule. A special rule must implement the append method, which should call pv.append to add a string to the output, call pv.printNoBrackets(node) to print a node with no bracket call pv.printBrackets(node) to print a node surrounded by round brackets.

For example

        pv.addSpecialRule(Operator op,new PrintVisitor.PrintRulesI()
        {
        public void append(Node node, PrintVisitor pv) throws ParseException
                {
                        pv.append("[");
                        for(int i=0;i0) pv.append(",");
                                node.jjtGetChild(i).jjtAccept(pv, null);
                        }
                        pv.append("]");
                }});
 

Author:
Rich Morris Created on 21-Feb-2004

Method Summary
 void append(Node node, PrintVisitor pv)
          The method called to append data for the rule.
 

Method Detail

append

void append(Node node,
            PrintVisitor pv)
            throws JepException
The method called to append data for the rule.

Throws:
JepException


Copyright © 2010 Singular Systems http://www.singularsys.com/jep