JML

org.multijava.mjc
Class MjcPrettyPrinter

java.lang.Object
  extended byorg.multijava.util.Utils
      extended byorg.multijava.mjc.MjcPrettyPrinter
All Implemented Interfaces:
Cloneable, Constants, Constants, MjcVisitor
Direct Known Subclasses:
JspPrettyPrinter, RacPrettyPrinter

public class MjcPrettyPrinter
extends Utils
implements Constants, MjcVisitor

This class implements a Java pretty printer


Field Summary
protected  boolean forInit
           
protected  ModifierUtility modUtil
           
protected  boolean nl
           
protected  TabbedPrintWriter p
           
protected  int pos
           
protected  int TAB_SIZE
           
protected  int WIDTH
           
 
Fields inherited from class org.multijava.util.Utils
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO
 
Fields inherited from interface org.multijava.mjc.Constants
ACC_MODIFIER_FLAGS_MASK, ACC_NON_NULL, ACC_NON_NULL_BY_DEFAULT, ACC_NULLABLE, ACC_NULLABLE_BY_DEFAULT, ACC_PURE, ACCESS_FLAG_ARRAY, ACCESS_FLAG_NAMES, AMID_JAVA_MATH, AMID_MAX, AMID_SAFE_MATH, CMP_VERSION, IMPLICITLY_NON_NULL, JAV_ASSERTION_ERROR, JAV_CLASS, JAV_CLASSLOADER, JAV_CLASSNOTFOUND_EXCEPTION, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_NOCLASSDEFFOUND_ERROR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RMJ_RUNTIME_EXCEPTION, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_SERIALIZABLE, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_SUPER, JAV_THIS, JAV_THROWABLE, MJ_ANCHOR, NULLITY_MODS, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LAND, OPE_LE, OPE_LNOT, OPE_LOR, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_MAX, TID_SHORT, TID_VOID, UNIV_ARRAY_TMP, UNIV_TMP
 
Fields inherited from interface org.multijava.util.classfile.Constants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VOLATILE, ATT_ANCHOR, ATT_BRIDGE, ATT_CODE, ATT_CONSTANTVALUE, ATT_DEPRECATED, ATT_DISPATCHER, ATT_EXCEPTIONS, ATT_GENERIC, ATT_GENERIC_FUNCTIONS, ATT_INNERCLASSES, ATT_LINENUMBERTABLE, ATT_LOCALVARIABLETABLE, ATT_MM_BODY, ATT_REDIRECTOR, ATT_RMJ_GLUE, ATT_RMJ_SIGNATURE, ATT_RUNTIME_VISIBLE_ANNOTATIONS, ATT_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS, ATT_SIGNATURE, ATT_SOURCEFILE, ATT_SYNTHETIC, ATT_UNIVERSE_FIELD, ATT_UNIVERSE_METHOD, ATT_UNIVERSE_VERSION, CST_CLASS, CST_DOUBLE, CST_FIELD, CST_FLOAT, CST_INTEGER, CST_INTERFACEMETHOD, CST_LONG, CST_METHOD, CST_NAMEANDTYPE, CST_STRING, CST_UTF8, ENV_DEBUG_MODE, ENV_USE_CACHE, JAVA_MAGIC, JAVA_MAJOR, JAVA_MINOR, MAX_CODE_PER_METHOD, opc_aaload, opc_aastore, opc_aconst_null, opc_aload, opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3, opc_anewarray, opc_areturn, opc_arraylength, opc_astore, opc_astore_0, opc_astore_1, opc_astore_2, opc_astore_3, opc_athrow, opc_baload, opc_bastore, opc_bipush, opc_caload, opc_castore, opc_checkcast, opc_d2f, opc_d2i, opc_d2l, opc_dadd, opc_daload, opc_dastore, opc_dcmpg, opc_dcmpl, opc_dconst_0, opc_dconst_1, opc_ddiv, opc_dload, opc_dload_0, opc_dload_1, opc_dload_2, opc_dload_3, opc_dmul, opc_dneg, opc_drem, opc_dreturn, opc_dstore, opc_dstore_0, opc_dstore_1, opc_dstore_2, opc_dstore_3, opc_dsub, opc_dup, opc_dup2, opc_dup2_x1, opc_dup2_x2, opc_dup_x1, opc_dup_x2, opc_f2d, opc_f2i, opc_f2l, opc_fadd, opc_faload, opc_fastore, opc_fcmpg, opc_fcmpl, opc_fconst_0, opc_fconst_1, opc_fconst_2, opc_fdiv, opc_fload, opc_fload_0, opc_fload_1, opc_fload_2, opc_fload_3, opc_fmul, opc_fneg, opc_frem, opc_freturn, opc_fstore, opc_fstore_0, opc_fstore_1, opc_fstore_2, opc_fstore_3, opc_fsub, opc_getfield, opc_getstatic, opc_goto, opc_goto_w, opc_i2b, opc_i2c, opc_i2d, opc_i2f, opc_i2l, opc_i2s, opc_iadd, opc_iaload, opc_iand, opc_iastore, opc_iconst_0, opc_iconst_1, opc_iconst_2, opc_iconst_3, opc_iconst_4, opc_iconst_5, opc_iconst_m1, opc_idiv, opc_if_acmpeq, opc_if_acmpne, opc_if_icmpeq, opc_if_icmpge, opc_if_icmpgt, opc_if_icmple, opc_if_icmplt, opc_if_icmpne, opc_ifeq, opc_ifge, opc_ifgt, opc_ifle, opc_iflt, opc_ifne, opc_ifnonnull, opc_ifnull, opc_iinc, opc_iload, opc_iload_0, opc_iload_1, opc_iload_2, opc_iload_3, opc_imul, opc_ineg, opc_instanceof, opc_invokeinterface, opc_invokespecial, opc_invokestatic, opc_invokevirtual, opc_ior, opc_irem, opc_ireturn, opc_ishl, opc_ishr, opc_istore, opc_istore_0, opc_istore_1, opc_istore_2, opc_istore_3, opc_isub, opc_iushr, opc_ixor, opc_jsr, opc_jsr_w, opc_l2d, opc_l2f, opc_l2i, opc_ladd, opc_laload, opc_land, opc_lastore, opc_lcmp, opc_lconst_0, opc_lconst_1, opc_ldc, opc_ldc2_w, opc_ldc_w, opc_ldiv, opc_lload, opc_lload_0, opc_lload_1, opc_lload_2, opc_lload_3, opc_lmul, opc_lneg, opc_lookupswitch, opc_lor, opc_lrem, opc_lreturn, opc_lshl, opc_lshr, opc_lstore, opc_lstore_0, opc_lstore_1, opc_lstore_2, opc_lstore_3, opc_lsub, opc_lushr, opc_lxor, opc_monitorenter, opc_monitorexit, opc_multianewarray, opc_new, opc_newarray, opc_nop, opc_pop, opc_pop2, opc_putfield, opc_putstatic, opc_ret, opc_return, opc_saload, opc_sastore, opc_sipush, opc_swap, opc_tableswitch, opc_wide, opc_xxxunusedxxx, POO_ASCII_CONSTANT, POO_CLASS_CONSTANT, POO_DOUBLE_CONSTANT, POO_FLOAT_CONSTANT, POO_INTEGER_CONSTANT, POO_LONG_CONSTANT, POO_NAT_CONSTANT, POO_REF_CONSTANT, POO_STRING_CONSTANT, TYP_ADDRESS, TYP_DOUBLE, TYP_FLOAT, TYP_INT, TYP_LONG, TYP_REFERENCE, TYP_VOID
 
Constructor Summary
MjcPrettyPrinter(File file, ModifierUtility modUtil)
          construct a pretty printer object for java code
MjcPrettyPrinter(Writer wr, ModifierUtility modUtil)
          construct a pretty printer object for java code
MjcPrettyPrinter(String fileName, ModifierUtility modUtil)
          construct a pretty printer object for java code
MjcPrettyPrinter(TabbedPrintWriter p)
          construct a pretty printer object for java code
 
Method Summary
protected  void acceptAll(ArrayList all)
           
 void close()
          Close the stream at the end
protected  void newLine()
           
protected  void print(boolean s)
           
protected  void print(char s)
           
protected  void print(double s)
           
protected  void print(int s)
           
protected  void print(Object s)
           
protected  void print(String s)
           
protected  void print(CType t)
           
protected  void printClassModifiers(JClassDeclaration self, long modifiers)
           
protected  void printInterfaceModifiers(JInterfaceDeclaration self, long modifiers)
           
private  void printVariableDefinition(JVariableDefinition self, boolean typeAndMod)
          Prints the given variable definition, self.
 void setPos(int pos)
           
protected  String toString(CType type)
          Returns the string for the given type.
 void visitAddExpression(JAddExpression self)
          visits an add expression
protected  void visitArgs(JExpression[] args)
          prints a list of arguments
 void visitArrayAccessExpression(JArrayAccessExpression self)
          prints an array length expression
 void visitArrayDimsAndInit(JArrayDimsAndInits self)
          prints an array dimension and initialization expression
 void visitArrayInitializer(JArrayInitializer self)
          prints an array initializer expression
 void visitArrayLengthExpression(JArrayLengthExpression self)
          prints an array length expression
 void visitAssertStatement(JAssertStatement self)
          Prints a assert statement
 void visitAssignmentExpression(JAssignmentExpression self)
          prints an assignment expression
protected  void visitBinaryExpression(JBinaryExpression self, String oper)
          prints a binary expression with the given operator
 void visitBitwiseExpression(JBitwiseExpression self)
          prints a compound assignment expression
 void visitBlockStatement(JBlock self)
          prints an expression statement
 void visitBooleanLiteral(JBooleanLiteral self)
          prints a boolean literal
 void visitBreakStatement(JBreakStatement self)
          prints a break statement
protected  void visitByteLiteral(byte value)
          prints a byte literal
 void visitCastExpression(JCastExpression self)
          prints a cast expression
 void visitCatchClause(JCatchClause self)
          prints a catch clause
 void visitCharLiteral(JCharLiteral self)
          prints a character literal
 void visitClassBlock(JClassBlock self)
          prints a class block (initializer)
protected  void visitClassBody(ArrayList inners, ArrayList methods, JPhylum[] fieldsAndInits)
           
 void visitClassDeclaration(JClassDeclaration self)
          prints a class declaration
 void visitClassExpression(JClassExpression self)
          prints a class expression
 void visitClassOrGFImport(JClassOrGFImport self)
          prints a class import declaration
protected  void visitComment(JavaStyleComment comment)
          prints an array length expression
protected  void visitComments(JavaStyleComment[] comments)
          prints an array length expression
 void visitCompilationUnit(JCompilationUnit self)
          prints a compilation unit
 void visitCompoundAssignmentExpression(JCompoundAssignmentExpression self)
          prints a compound expression
 void visitCompoundStatement(JCompoundStatement self)
          prints a compound statement
 void visitCompoundStatement(JStatement[] body)
          prints a compound statement
 void visitConditionalAndExpression(JConditionalAndExpression self)
          visits a boolean AND expression
 void visitConditionalExpression(JConditionalExpression self)
          prints a conditional expression
 void visitConditionalOrExpression(JConditionalOrExpression self)
          visits a boolean OR expression
 void visitConstructorBlock(JConstructorBlock self)
          prints an expression statement
 void visitConstructorDeclaration(JConstructorDeclaration self)
          prints a constructor declaration
 void visitContinueStatement(JContinueStatement self)
          prints a continue statement
 void visitDivideExpression(JDivideExpression self)
          visits a divide expression
 void visitDoStatement(JDoStatement self)
          prints a do statement
protected  void visitDoubleLiteral(double value)
          prints a double literal
 void visitEmptyStatement(JEmptyStatement self)
          prints a empty statement
 void visitEqualityExpression(JEqualityExpression self)
          prints an equality expression
 void visitExplicitConstructorInvocation(JExplicitConstructorInvocation self)
          prints an explicit constructor invocation
 void visitExpressionListStatement(JExpressionListStatement self)
          prints an expression list statement
 void visitExpressionStatement(JExpressionStatement self)
          prints an expression statement
 void visitFieldDeclaration(JFieldDeclaration self)
          prints a field declaration
 void visitFieldExpression(JClassFieldExpression self)
          prints a field expression
protected  void visitFloatLiteral(float value)
          prints a float literal
 void visitFormalParameters(JFormalParameter self)
          prints a formal parameter
 void visitForStatement(JForStatement self)
          prints a for statement
 void visitGenericFunctionDecl(MJGenericFunctionDecl self)
          prints a generic function anchor
 void visitIfStatement(JIfStatement self)
          prints a if statement
 void visitInitializerDeclaration(JInitializerDeclaration self)
          prints an initializer declaration
 void visitInstanceofExpression(JInstanceofExpression self)
          prints an instanceof expression
protected  void visitInterfaceBody(ArrayList methods, JPhylum[] fieldsAndInits, ArrayList inners)
           
 void visitInterfaceDeclaration(JInterfaceDeclaration self)
          prints an interface declaration
protected  void visitIntLiteral(int value)
          prints a int literal
protected  void visitJavadoc(JavadocComment comment)
          prints a javadoc comment
 void visitLabeledStatement(JLabeledStatement self)
          prints a labeled statement
 void visitLocalVariableExpression(JLocalVariableExpression self)
          prints a local variable expression
protected  void visitLongLiteral(long value)
          prints a long literal
 void visitMathModeExpression(MJMathModeExpression self)
          prints a math mode expression
 void visitMethodCallExpression(JMethodCallExpression self)
          prints a method call expression
 void visitMethodDeclaration(JMethodDeclaration self)
          prints a method declaration
 void visitMinusExpression(JMinusExpression self)
          visits a minus expression
 void visitModuloExpression(JModuloExpression self)
          visits a modulo division expression
 void visitMultExpression(JMultExpression self)
          visits a multiplication expression
 void visitNameExpression(JNameExpression self)
          prints a name expression
 void visitNewAnonymousClassExpression(JNewAnonymousClassExpression self)
          prints an object allocator expression for an anonymous class
 void visitNewArrayExpression(JNewArrayExpression self)
          prints an array allocator expression
 void visitNewObjectExpression(JNewObjectExpression self)
          prints an object allocator expression
 void visitNullLiteral(JNullLiteral self)
          prints a null literal
 void visitOrdinalLiteral(JOrdinalLiteral self)
          prints an ordinal literal
 void visitPackageImport(JPackageImport self)
          prints a package import declaration
 void visitPackageName(JPackageName self)
          prints a package name statement
 void visitParenthesedExpression(JParenthesedExpression self)
          prints a parenthesed expression
 void visitPostfixExpression(JPostfixExpression self)
          prints a postfix expression
 void visitPrefixExpression(JPrefixExpression self)
          prints a prefix expression
 void visitRealLiteral(JRealLiteral self)
          prints a real literal
 void visitRelationalExpression(JRelationalExpression self)
          prints a shift expressiona
 void visitReturnStatement(JReturnStatement self)
          prints a return statement
 void visitShiftExpression(JShiftExpression self)
          prints a shift expression
protected  void visitShortLiteral(short value)
          prints a short literal
 void visitStringLiteral(JStringLiteral self)
          prints a string literal
 void visitSuperExpression(JSuperExpression self)
          prints a super expression
 void visitSwitchGroup(JSwitchGroup self)
          prints a switch group
 void visitSwitchLabel(JSwitchLabel self)
          prints a switch label
 void visitSwitchStatement(JSwitchStatement self)
          prints a switch statement
 void visitSynchronizedStatement(JSynchronizedStatement self)
          prints a synchronized statement
 void visitThisExpression(JThisExpression self)
          prints a this expression
 void visitThrowStatement(JThrowStatement self)
          prints a throw statement
 void visitTLMethodBody(JBlock body)
           
 void visitTopLevelMethodDeclaration(MJTopLevelMethodDeclaration self)
          prints an external method declaration
 void visitTryCatchStatement(JTryCatchStatement self)
          prints a try-catch statement
 void visitTryFinallyStatement(JTryFinallyStatement self)
          prints a try-finally statement
 void visitTypeDeclarationStatement(JTypeDeclarationStatement self)
          prints a type declaration statement
 void visitTypeNameExpression(JTypeNameExpression self)
          prints a type name expression
 void visitUnaryExpression(JUnaryExpression self)
          prints an unary expression
 void visitUnaryPromoteExpression(JUnaryPromote self)
          prints a cast expression
 void visitVariableDeclarationStatement(JVariableDeclarationStatement self)
          prints a variable declaration statement
 void visitVariableDefinition(JVariableDefinition self)
          prints a variable declaration statement
 void visitWarnExpression(MJWarnExpression self)
          prints a warn expression
 void visitWhileStatement(JWhileStatement self)
          prints a while statement
 
Methods inherited from class org.multijava.util.Utils
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

forInit

protected boolean forInit

TAB_SIZE

protected int TAB_SIZE

WIDTH

protected int WIDTH

pos

protected int pos

p

protected TabbedPrintWriter p

nl

protected boolean nl

modUtil

protected ModifierUtility modUtil
Constructor Detail

MjcPrettyPrinter

public MjcPrettyPrinter(Writer wr,
                        ModifierUtility modUtil)
construct a pretty printer object for java code


MjcPrettyPrinter

public MjcPrettyPrinter(String fileName,
                        ModifierUtility modUtil)
construct a pretty printer object for java code

Parameters:
fileName - the file into which the code is generated

MjcPrettyPrinter

public MjcPrettyPrinter(File file,
                        ModifierUtility modUtil)
construct a pretty printer object for java code

Parameters:
file - the file into which the code is generated

MjcPrettyPrinter

public MjcPrettyPrinter(TabbedPrintWriter p)
construct a pretty printer object for java code

Parameters:
p - the file into which the code is generated
Method Detail

close

public void close()
Close the stream at the end


setPos

public void setPos(int pos)

visitCompilationUnit

public void visitCompilationUnit(JCompilationUnit self)
prints a compilation unit

Specified by:
visitCompilationUnit in interface MjcVisitor

visitClassDeclaration

public void visitClassDeclaration(JClassDeclaration self)
prints a class declaration

Specified by:
visitClassDeclaration in interface MjcVisitor

printClassModifiers

protected void printClassModifiers(JClassDeclaration self,
                                   long modifiers)

visitClassBody

protected void visitClassBody(ArrayList inners,
                              ArrayList methods,
                              JPhylum[] fieldsAndInits)

visitInterfaceDeclaration

public void visitInterfaceDeclaration(JInterfaceDeclaration self)
prints an interface declaration

Specified by:
visitInterfaceDeclaration in interface MjcVisitor

printInterfaceModifiers

protected void printInterfaceModifiers(JInterfaceDeclaration self,
                                       long modifiers)

visitInterfaceBody

protected void visitInterfaceBody(ArrayList methods,
                                  JPhylum[] fieldsAndInits,
                                  ArrayList inners)

visitGenericFunctionDecl

public void visitGenericFunctionDecl(MJGenericFunctionDecl self)
prints a generic function anchor

Specified by:
visitGenericFunctionDecl in interface MjcVisitor

visitFieldDeclaration

public void visitFieldDeclaration(JFieldDeclaration self)
prints a field declaration

Specified by:
visitFieldDeclaration in interface MjcVisitor

visitMethodDeclaration

public void visitMethodDeclaration(JMethodDeclaration self)
prints a method declaration

Specified by:
visitMethodDeclaration in interface MjcVisitor

visitInitializerDeclaration

public void visitInitializerDeclaration(JInitializerDeclaration self)
prints an initializer declaration

Specified by:
visitInitializerDeclaration in interface MjcVisitor

visitTopLevelMethodDeclaration

public void visitTopLevelMethodDeclaration(MJTopLevelMethodDeclaration self)
prints an external method declaration

Specified by:
visitTopLevelMethodDeclaration in interface MjcVisitor

visitTLMethodBody

public void visitTLMethodBody(JBlock body)

visitConstructorDeclaration

public void visitConstructorDeclaration(JConstructorDeclaration self)
prints a constructor declaration

Specified by:
visitConstructorDeclaration in interface MjcVisitor

visitWhileStatement

public void visitWhileStatement(JWhileStatement self)
prints a while statement

Specified by:
visitWhileStatement in interface MjcVisitor

visitVariableDeclarationStatement

public void visitVariableDeclarationStatement(JVariableDeclarationStatement self)
prints a variable declaration statement

Specified by:
visitVariableDeclarationStatement in interface MjcVisitor

printVariableDefinition

private void printVariableDefinition(JVariableDefinition self,
                                     boolean typeAndMod)
Prints the given variable definition, self. If the argument, typeAndMod is true, the type and modifiers are also printed; otherwise, they are not printed.


visitVariableDefinition

public void visitVariableDefinition(JVariableDefinition self)
prints a variable declaration statement

Specified by:
visitVariableDefinition in interface MjcVisitor

visitTryCatchStatement

public void visitTryCatchStatement(JTryCatchStatement self)
prints a try-catch statement

Specified by:
visitTryCatchStatement in interface MjcVisitor

visitTryFinallyStatement

public void visitTryFinallyStatement(JTryFinallyStatement self)
prints a try-finally statement

Specified by:
visitTryFinallyStatement in interface MjcVisitor

visitThrowStatement

public void visitThrowStatement(JThrowStatement self)
prints a throw statement

Specified by:
visitThrowStatement in interface MjcVisitor

visitSynchronizedStatement

public void visitSynchronizedStatement(JSynchronizedStatement self)
prints a synchronized statement

Specified by:
visitSynchronizedStatement in interface MjcVisitor

visitSwitchStatement

public void visitSwitchStatement(JSwitchStatement self)
prints a switch statement

Specified by:
visitSwitchStatement in interface MjcVisitor

visitReturnStatement

public void visitReturnStatement(JReturnStatement self)
prints a return statement

Specified by:
visitReturnStatement in interface MjcVisitor

visitLabeledStatement

public void visitLabeledStatement(JLabeledStatement self)
prints a labeled statement

Specified by:
visitLabeledStatement in interface MjcVisitor

visitIfStatement

public void visitIfStatement(JIfStatement self)
prints a if statement

Specified by:
visitIfStatement in interface MjcVisitor

visitForStatement

public void visitForStatement(JForStatement self)
prints a for statement

Specified by:
visitForStatement in interface MjcVisitor

visitCompoundStatement

public void visitCompoundStatement(JCompoundStatement self)
prints a compound statement

Specified by:
visitCompoundStatement in interface MjcVisitor

visitCompoundStatement

public void visitCompoundStatement(JStatement[] body)
prints a compound statement


visitExpressionStatement

public void visitExpressionStatement(JExpressionStatement self)
prints an expression statement

Specified by:
visitExpressionStatement in interface MjcVisitor

visitExpressionListStatement

public void visitExpressionListStatement(JExpressionListStatement self)
prints an expression list statement

Specified by:
visitExpressionListStatement in interface MjcVisitor

visitEmptyStatement

public void visitEmptyStatement(JEmptyStatement self)
prints a empty statement

Specified by:
visitEmptyStatement in interface MjcVisitor

visitDoStatement

public void visitDoStatement(JDoStatement self)
prints a do statement

Specified by:
visitDoStatement in interface MjcVisitor

visitContinueStatement

public void visitContinueStatement(JContinueStatement self)
prints a continue statement

Specified by:
visitContinueStatement in interface MjcVisitor

visitBreakStatement

public void visitBreakStatement(JBreakStatement self)
prints a break statement

Specified by:
visitBreakStatement in interface MjcVisitor

visitAssertStatement

public void visitAssertStatement(JAssertStatement self)
Prints a assert statement

Specified by:
visitAssertStatement in interface MjcVisitor

visitBlockStatement

public void visitBlockStatement(JBlock self)
prints an expression statement

Specified by:
visitBlockStatement in interface MjcVisitor

visitConstructorBlock

public void visitConstructorBlock(JConstructorBlock self)
prints an expression statement

Specified by:
visitConstructorBlock in interface MjcVisitor

visitClassBlock

public void visitClassBlock(JClassBlock self)
prints a class block (initializer)

Specified by:
visitClassBlock in interface MjcVisitor

visitTypeDeclarationStatement

public void visitTypeDeclarationStatement(JTypeDeclarationStatement self)
prints a type declaration statement

Specified by:
visitTypeDeclarationStatement in interface MjcVisitor

visitUnaryExpression

public void visitUnaryExpression(JUnaryExpression self)
prints an unary expression

Specified by:
visitUnaryExpression in interface MjcVisitor

visitTypeNameExpression

public void visitTypeNameExpression(JTypeNameExpression self)
prints a type name expression

Specified by:
visitTypeNameExpression in interface MjcVisitor

visitThisExpression

public void visitThisExpression(JThisExpression self)
prints a this expression

Specified by:
visitThisExpression in interface MjcVisitor

visitSuperExpression

public void visitSuperExpression(JSuperExpression self)
prints a super expression

Specified by:
visitSuperExpression in interface MjcVisitor

visitShiftExpression

public void visitShiftExpression(JShiftExpression self)
prints a shift expression

Specified by:
visitShiftExpression in interface MjcVisitor

visitRelationalExpression

public void visitRelationalExpression(JRelationalExpression self)
prints a shift expressiona

Specified by:
visitRelationalExpression in interface MjcVisitor

visitPrefixExpression

public void visitPrefixExpression(JPrefixExpression self)
prints a prefix expression

Specified by:
visitPrefixExpression in interface MjcVisitor

visitPostfixExpression

public void visitPostfixExpression(JPostfixExpression self)
prints a postfix expression

Specified by:
visitPostfixExpression in interface MjcVisitor

visitParenthesedExpression

public void visitParenthesedExpression(JParenthesedExpression self)
prints a parenthesed expression

Specified by:
visitParenthesedExpression in interface MjcVisitor

visitNewArrayExpression

public void visitNewArrayExpression(JNewArrayExpression self)
prints an array allocator expression

Specified by:
visitNewArrayExpression in interface MjcVisitor

visitNameExpression

public void visitNameExpression(JNameExpression self)
prints a name expression

Specified by:
visitNameExpression in interface MjcVisitor

visitBinaryExpression

protected void visitBinaryExpression(JBinaryExpression self,
                                     String oper)
prints a binary expression with the given operator


visitAddExpression

public void visitAddExpression(JAddExpression self)
visits an add expression

Specified by:
visitAddExpression in interface MjcVisitor

visitConditionalAndExpression

public void visitConditionalAndExpression(JConditionalAndExpression self)
visits a boolean AND expression

Specified by:
visitConditionalAndExpression in interface MjcVisitor

visitConditionalOrExpression

public void visitConditionalOrExpression(JConditionalOrExpression self)
visits a boolean OR expression

Specified by:
visitConditionalOrExpression in interface MjcVisitor

visitDivideExpression

public void visitDivideExpression(JDivideExpression self)
visits a divide expression

Specified by:
visitDivideExpression in interface MjcVisitor

visitMinusExpression

public void visitMinusExpression(JMinusExpression self)
visits a minus expression

Specified by:
visitMinusExpression in interface MjcVisitor

visitModuloExpression

public void visitModuloExpression(JModuloExpression self)
visits a modulo division expression

Specified by:
visitModuloExpression in interface MjcVisitor

visitMultExpression

public void visitMultExpression(JMultExpression self)
visits a multiplication expression

Specified by:
visitMultExpression in interface MjcVisitor

visitMethodCallExpression

public void visitMethodCallExpression(JMethodCallExpression self)
prints a method call expression

Specified by:
visitMethodCallExpression in interface MjcVisitor

visitLocalVariableExpression

public void visitLocalVariableExpression(JLocalVariableExpression self)
prints a local variable expression

Specified by:
visitLocalVariableExpression in interface MjcVisitor

visitInstanceofExpression

public void visitInstanceofExpression(JInstanceofExpression self)
prints an instanceof expression

Specified by:
visitInstanceofExpression in interface MjcVisitor

visitEqualityExpression

public void visitEqualityExpression(JEqualityExpression self)
prints an equality expression

Specified by:
visitEqualityExpression in interface MjcVisitor

visitConditionalExpression

public void visitConditionalExpression(JConditionalExpression self)
prints a conditional expression

Specified by:
visitConditionalExpression in interface MjcVisitor

visitCompoundAssignmentExpression

public void visitCompoundAssignmentExpression(JCompoundAssignmentExpression self)
prints a compound expression

Specified by:
visitCompoundAssignmentExpression in interface MjcVisitor

visitFieldExpression

public void visitFieldExpression(JClassFieldExpression self)
prints a field expression

Specified by:
visitFieldExpression in interface MjcVisitor

visitClassExpression

public void visitClassExpression(JClassExpression self)
prints a class expression

Specified by:
visitClassExpression in interface MjcVisitor

visitCastExpression

public void visitCastExpression(JCastExpression self)
prints a cast expression

Specified by:
visitCastExpression in interface MjcVisitor

visitUnaryPromoteExpression

public void visitUnaryPromoteExpression(JUnaryPromote self)
prints a cast expression

Specified by:
visitUnaryPromoteExpression in interface MjcVisitor

visitBitwiseExpression

public void visitBitwiseExpression(JBitwiseExpression self)
prints a compound assignment expression

Specified by:
visitBitwiseExpression in interface MjcVisitor

visitAssignmentExpression

public void visitAssignmentExpression(JAssignmentExpression self)
prints an assignment expression

Specified by:
visitAssignmentExpression in interface MjcVisitor

visitArrayLengthExpression

public void visitArrayLengthExpression(JArrayLengthExpression self)
prints an array length expression

Specified by:
visitArrayLengthExpression in interface MjcVisitor

visitArrayAccessExpression

public void visitArrayAccessExpression(JArrayAccessExpression self)
prints an array length expression

Specified by:
visitArrayAccessExpression in interface MjcVisitor

visitComments

protected void visitComments(JavaStyleComment[] comments)
prints an array length expression


visitComment

protected void visitComment(JavaStyleComment comment)
prints an array length expression


visitJavadoc

protected void visitJavadoc(JavadocComment comment)
prints a javadoc comment


visitSwitchLabel

public void visitSwitchLabel(JSwitchLabel self)
prints a switch label

Specified by:
visitSwitchLabel in interface MjcVisitor

visitSwitchGroup

public void visitSwitchGroup(JSwitchGroup self)
prints a switch group

Specified by:
visitSwitchGroup in interface MjcVisitor

visitCatchClause

public void visitCatchClause(JCatchClause self)
prints a catch clause

Specified by:
visitCatchClause in interface MjcVisitor

visitBooleanLiteral

public void visitBooleanLiteral(JBooleanLiteral self)
prints a boolean literal

Specified by:
visitBooleanLiteral in interface MjcVisitor

visitCharLiteral

public void visitCharLiteral(JCharLiteral self)
prints a character literal

Specified by:
visitCharLiteral in interface MjcVisitor

visitOrdinalLiteral

public void visitOrdinalLiteral(JOrdinalLiteral self)
prints an ordinal literal

Specified by:
visitOrdinalLiteral in interface MjcVisitor

visitByteLiteral

protected void visitByteLiteral(byte value)
prints a byte literal


visitIntLiteral

protected void visitIntLiteral(int value)
prints a int literal


visitLongLiteral

protected void visitLongLiteral(long value)
prints a long literal


visitShortLiteral

protected void visitShortLiteral(short value)
prints a short literal


visitRealLiteral

public void visitRealLiteral(JRealLiteral self)
prints a real literal

Specified by:
visitRealLiteral in interface MjcVisitor

visitDoubleLiteral

protected void visitDoubleLiteral(double value)
prints a double literal


visitFloatLiteral

protected void visitFloatLiteral(float value)
prints a float literal


visitStringLiteral

public void visitStringLiteral(JStringLiteral self)
prints a string literal

Specified by:
visitStringLiteral in interface MjcVisitor

visitNullLiteral

public void visitNullLiteral(JNullLiteral self)
prints a null literal

Specified by:
visitNullLiteral in interface MjcVisitor

visitPackageName

public void visitPackageName(JPackageName self)
prints a package name statement

Specified by:
visitPackageName in interface MjcVisitor

visitPackageImport

public void visitPackageImport(JPackageImport self)
prints a package import declaration

Specified by:
visitPackageImport in interface MjcVisitor

visitClassOrGFImport

public void visitClassOrGFImport(JClassOrGFImport self)
prints a class import declaration

Specified by:
visitClassOrGFImport in interface MjcVisitor

visitFormalParameters

public void visitFormalParameters(JFormalParameter self)
prints a formal parameter

Specified by:
visitFormalParameters in interface MjcVisitor

visitExplicitConstructorInvocation

public void visitExplicitConstructorInvocation(JExplicitConstructorInvocation self)
prints an explicit constructor invocation

Specified by:
visitExplicitConstructorInvocation in interface MjcVisitor

visitNewObjectExpression

public void visitNewObjectExpression(JNewObjectExpression self)
prints an object allocator expression

Specified by:
visitNewObjectExpression in interface MjcVisitor

visitNewAnonymousClassExpression

public void visitNewAnonymousClassExpression(JNewAnonymousClassExpression self)
prints an object allocator expression for an anonymous class

Specified by:
visitNewAnonymousClassExpression in interface MjcVisitor

visitArrayInitializer

public void visitArrayInitializer(JArrayInitializer self)
prints an array initializer expression

Specified by:
visitArrayInitializer in interface MjcVisitor

visitArrayDimsAndInit

public void visitArrayDimsAndInit(JArrayDimsAndInits self)
prints an array dimension and initialization expression

Specified by:
visitArrayDimsAndInit in interface MjcVisitor

visitWarnExpression

public void visitWarnExpression(MJWarnExpression self)
prints a warn expression

Specified by:
visitWarnExpression in interface MjcVisitor

visitMathModeExpression

public void visitMathModeExpression(MJMathModeExpression self)
prints a math mode expression

Specified by:
visitMathModeExpression in interface MjcVisitor

toString

protected String toString(CType type)
Returns the string for the given type. E.g., if the type represents a local local class such as n1.n2.1.n3, then returned is the string "n3".


visitArgs

protected void visitArgs(JExpression[] args)
prints a list of arguments


newLine

protected void newLine()

print

protected void print(Object s)

print

protected void print(String s)

print

protected void print(CType t)

print

protected void print(boolean s)

print

protected void print(int s)

print

protected void print(char s)

print

protected void print(double s)

acceptAll

protected void acceptAll(ArrayList all)

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.