|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.MjcPrettyPrinter
org.jmlspecs.jmlrac.RacPrettyPrinter
A visitor class for pretty-printing JML specifications with generated RAC code. Each node of AST is visited and printed to an external file or writer object.
Approach to printing JML specifications.
The problem is that some JML annotations such as non_null
should be printed context-sensitively depending on their surrounding
environment. For example, if a non_null annotation appears
in a Java field declaration, it should be printed inside a pair of
JML annotation markers, e.g.,
private /*@ non_null @*/ HashSet elems;However, if it appears in a model field declaration, it should be printed without the surrounding JML annotation markers, e.g.
//@ private model non_null JMLObjectSet elems;To handle this, we use a flag variable
isAnnotation and
the class JmlModifier to indicate the context of printing.
JML annotation ASTs such as those for non_null annotations
can print themselves correctly by refering to the flag.
The class JmlModifier, which returns a string corresponding to a modifier,
produces a JML modifier without enclosing JML annotation markers if
indicated as such using the method setWithoutMarkers;
by default, a JML modifier is returned with annotation markers.
A top-level JML specification AST such as a model field declaration
is responsible for setting and clearing the isAnnotation
flag (e.g., by using mayStartAnnotation and
mayEndAnnotation, and directing the return form to the
class JmlModifier.
It is the convention that each AST node, if necessary, advances to the next line before printing its code.
Model programs and specification statements are not implemented yet.
JmlModifier,
JmlModifier.withoutMarkers(),
JmlModifier.setWithoutMarkers(boolean)| Field Summary | |
private int |
annotationDepth
the depth of annotations. |
private int |
atMarkerPos
the column number where annotation markers were written. |
private boolean |
inAnnotation
indicates if currently printing inside a JML annotation marker. |
private JmlModifier |
jmlModUtil
Modifier utility to manipulating modifiers, e.g., to get string representations of modifiers from bit mask encoding. |
static String |
NEW_LINE
|
protected int |
offset
the space from '@' to the current print position for specification. |
| Fields inherited from class org.multijava.mjc.MjcPrettyPrinter |
forInit, modUtil, nl, p, pos, TAB_SIZE, WIDTH |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Fields inherited from interface org.jmlspecs.jmlrac.RacConstants |
MN_CHECK_HC, MN_CHECK_INV, MN_CHECK_POST, MN_CHECK_PRE, MN_CHECK_XPOST, MN_EVAL_OLD, MN_GHOST, MN_INIT, MN_INTERNAL, MN_MODEL, MN_MODEL_PUBLIC, MN_RESTORE_FROM, MN_SAVE_TO, MN_SPEC, MN_SPEC_PUBLIC, TN_JMLCHECKABLE, TN_JMLSURROGATE, TN_JMLUNIT_TEST_POSTFIX, TN_JMLUNIT_TESTDATA_POSTFIX, TN_JMLVALUE, TN_SURROGATE, VN_ASSERTION, VN_CATCH_VAR, VN_CLASS_INIT, VN_CONSTRUCTED, VN_DELEGEE, VN_ERROR_SET, VN_EXCEPTION, VN_FREE_VAR, VN_INIT, VN_OLD_VAR, VN_POST_VAR, VN_PRE_VAR, VN_PRECOND, VN_RAC_COMPILED, VN_RAC_LEVEL, VN_RESULT, VN_STACK_VAR, VN_XRESULT |
| Constructor Summary | |
RacPrettyPrinter(File file,
JmlModifier modUtil)
Constructs a pretty printer object for JML specifications |
|
RacPrettyPrinter(Writer writer,
JmlModifier modUtil)
Constructs a pretty printer object for JML specifications |
|
RacPrettyPrinter(String fileName,
JmlModifier modUtil)
Constructs a pretty printer object for JML specifications |
|
RacPrettyPrinter(TabbedPrintWriter writer)
Constructs a pretty printer object for JML specifications |
|
| Method Summary | |
protected void |
acceptAll(JPhylum[] all)
Visits each element of the argument. |
protected void |
applyBinaryExpression(JExpression left,
JExpression right,
String oper)
prints a binary expression with the given operator and binary exps. |
void |
close()
Close the stream at the end |
protected void |
mayEndAnnotation()
Stops the annotation printing mode if currently in that mode; also prints the closing annotation marker @*/. |
protected void |
mayEndAnnotation(boolean flag)
Stops the annotation printing mode if the flag is
true and currently in the annotation mode;
also prints the closing annotation marker @*/. |
protected void |
mayStartAnnotation()
Starts the annotation printing mode if not already in; also prints the opening annotation marker /*@. |
protected void |
mayStartAnnotation(boolean flag)
Starts the annotation printing mode if flag is
true and not already in the annotation mode;
also prints the opening annotation marker /*@. |
protected void |
newLine()
Prints a new line marker. |
protected void |
newLineOffset()
Prints a new line marker. |
protected void |
print(String s)
Prints a string. |
protected void |
print(CType t)
Prints a type. |
protected void |
printJml(String s)
Prints a string enclosed in the JML annotation markers. |
protected void |
println(String code)
Prints multi-lined code with proper line-breaking and indentation. |
private void |
printVariableDefinition(JVariableDefinition self,
boolean typeAndMod)
Prints the given variable definition, self. |
protected String |
toString(CType type)
Returns the string for the given type. |
void |
visitArrayAccessExpression(JArrayAccessExpression self)
prints an array length expression |
protected void |
visitBigintLiteral(long value)
Translates a \bigint literal. |
protected void |
visitBinaryExpression(JBinaryExpression self,
String oper)
prints a binary expression with the given operator |
void |
visitBitwiseExpression(JBitwiseExpression self)
prints a bitwise expression |
void |
visitCastExpression(JCastExpression self)
Prints a cast expression. |
void |
visitCharLiteral(JCharLiteral self)
Prints a character literal. |
protected void |
visitClassBody(JmlTypeDeclaration self)
Prints a JML type declaration. |
void |
visitCompilationUnit(JCompilationUnit self)
Prints a compilation unit. |
void |
visitCompoundAssignmentExpression(JCompoundAssignmentExpression self)
prints a compound assignment expression |
protected void |
visitDoubleLiteral(double value)
Prints a double literal. |
void |
visitEqualityExpression(JEqualityExpression self)
prints an equality expression |
protected void |
visitExample(JmlExample self)
Prints example specifications. |
void |
visitFieldExpression(JClassFieldExpression self)
prints a field expression, if it's not a model field then invoke the method in super class |
protected void |
visitFloatLiteral(float value)
Prints a float literal. |
void |
visitFormalParameters(JFormalParameter self)
visits a formal parameter |
void |
visitGeneralSpecCase(JmlGeneralSpecCase self)
Prints the given general spec case. |
void |
visitJmlAbruptSpecBody(JmlAbruptSpecBody self)
Prints a JML abrupt spec body. |
void |
visitJmlAbruptSpecCase(JmlAbruptSpecCase self)
Prints a JML abrupt spec case. |
void |
visitJmlAccessibleClause(JmlAccessibleClause self)
Prints a JML accessible clause. |
void |
visitJmlAssertStatement(JmlAssertStatement self)
Prints a JML assignable clause. |
void |
visitJmlAssignableClause(JmlAssignableClause self)
Prints a JML assignable clause. |
void |
visitJmlAssignmentStatement(JmlAssignmentStatement self)
|
void |
visitJmlAssumeStatement(JmlAssumeStatement self)
Prints a JML assume statement. |
void |
visitJmlAxiom(JmlAxiom self)
Prints a JML axim. |
void |
visitJmlBehaviorSpec(JmlBehaviorSpec self)
Prints a JML behavior spec. |
void |
visitJmlBreaksClause(JmlBreaksClause self)
Prints a JML break clause. |
void |
visitJmlCallableClause(JmlCallableClause self)
Prints a JML callable clause. |
void |
visitJmlCapturesClause(JmlCapturesClause self)
Prints a JML captures clause. |
void |
visitJmlClassBlock(JmlClassBlock self)
Prints static or instance initializer |
void |
visitJmlClassDeclaration(JmlClassDeclaration self)
Prints a JML class declaration. |
void |
visitJmlClassOrGFImport(JmlClassOrGFImport self)
Prints a JML classOrGFImport clause. |
void |
visitJmlCodeContract(JmlCodeContract self)
Prints a JML code contract. |
void |
visitJmlCompilationUnit(JmlCompilationUnit self)
Prints a JML compilation unit. |
void |
visitJmlConstraint(JmlConstraint self)
Prints a JML constraint clause. |
void |
visitJmlConstructorDeclaration(JmlConstructorDeclaration self)
Prints a JML constructor declaration. |
void |
visitJmlConstructorName(JmlConstructorName self)
Prints a JML constructor name. |
void |
visitJmlContinuesClause(JmlContinuesClause self)
Prints a JML continues statement. |
void |
visitJmlDebugStatement(JmlDebugStatement self)
Prints a JML debug statement. |
void |
visitJmlDeclaration(JmlDeclaration self)
|
void |
visitJmlDivergesClause(JmlDivergesClause self)
Prints a JML diverges clause. |
void |
visitJmlDurationClause(JmlDurationClause self)
Prints a JML duration clause. |
void |
visitJmlDurationExpression(JmlDurationExpression self)
Prints a JML \duration expression. |
void |
visitJmlElemTypeExpression(JmlElemTypeExpression self)
Prints a JML elemtype expression. |
void |
visitJmlEnsuresClause(JmlEnsuresClause self)
Prints a JML ensures clause. |
void |
visitJmlExample(JmlExample self)
Prints a JML example. |
void |
visitJmlExceptionalBehaviorSpec(JmlExceptionalBehaviorSpec self)
Prints a JML exceptional behavior specification. |
void |
visitJmlExceptionalExample(JmlExceptionalExample self)
Prints a JML exceptional example. |
void |
visitJmlExceptionalSpecBody(JmlExceptionalSpecBody self)
Prints a JML exceptional spec body. |
void |
visitJmlExceptionalSpecCase(JmlExceptionalSpecCase self)
Prints a JML exceptional spec case. |
void |
visitJmlExpression(JmlExpression self)
|
void |
visitJmlExtendingSpecification(JmlExtendingSpecification self)
Prints a JML method extending specification. |
void |
visitJmlFieldDeclaration(JmlFieldDeclaration self)
Prints the given JML field declaration. |
void |
visitJmlForAllVarDecl(JmlForAllVarDecl self)
Prints a JML forall variable declaration. |
void |
visitJmlFormalParameter(JmlFormalParameter self)
Prints a JML formal parameter. |
void |
visitJmlFreshExpression(JmlFreshExpression self)
Prints a JML fresh expression. |
void |
visitJmlGeneralSpecCase(JmlGeneralSpecCase self)
|
void |
visitJmlGenericSpecBody(JmlGenericSpecBody self)
Prints a JML generic spec body. |
void |
visitJmlGenericSpecCase(JmlGenericSpecCase self)
Prints a JML generic spec case. |
void |
visitJmlGuardedStatement(JmlGuardedStatement self)
Prints a JML guarded statement. |
void |
visitJmlHenceByStatement(JmlHenceByStatement self)
Prints a JML henceby statement. |
void |
visitJmlInformalExpression(JmlInformalExpression self)
Prints a JML informal expression. |
void |
visitJmlInformalStoreRef(JmlInformalStoreRef self)
Prints a JML informal store reference. |
void |
visitJmlInGroupClause(JmlInGroupClause self)
Prints a JML in data group clause. |
void |
visitJmlInitiallyVarAssertion(JmlInitiallyVarAssertion self)
Prints a JML initially variable assertion. |
void |
visitJmlInterfaceDeclaration(JmlInterfaceDeclaration self)
Prints a JML interface declaration. |
void |
visitJmlInvariant(JmlInvariant self)
Prints a JML invariant. |
void |
visitJmlInvariantForExpression(JmlInvariantForExpression self)
Prints a JML invariant for expression. |
void |
visitJmlInvariantStatement(JmlInvariantStatement self)
Prints a JML invariant statement. |
void |
visitJmlIsInitializedExpression(JmlIsInitializedExpression self)
Prints a JML isinitialized expression. |
void |
visitJmlLabelExpression(JmlLabelExpression self)
Prints a JML label expression. |
void |
visitJmlLetVarDecl(JmlLetVarDecl self)
Prints a JML old variable declaration. |
void |
visitJmlLockSetExpression(JmlLockSetExpression self)
Prints a JML lockset expression. |
void |
visitJmlLoopInvariant(JmlLoopInvariant self)
Prints a JML loop invariant. |
void |
visitJmlLoopStatement(JmlLoopStatement self)
Prints a JML loop statement. |
void |
visitJmlMapsIntoClause(JmlMapsIntoClause self)
Prints a JML maps into data group clause. |
void |
visitJmlMaxExpression(JmlMaxExpression self)
Prints a JML \max expression. |
void |
visitJmlMeasuredClause(JmlMeasuredClause self)
Prints a JML measured clause. |
void |
visitJmlMethodDeclaration(JmlMethodDeclaration self)
Prints a JML method declaration. |
void |
visitJmlMethodName(JmlMethodName self)
Prints a JML method name. |
void |
visitJmlMethodNameList(JmlMethodNameList self)
|
void |
visitJmlMethodSpecification(JmlMethodSpecification self)
|
void |
visitJmlModelProgram(JmlModelProgram self)
Prints a JML model program. |
void |
visitJmlMonitorsForVarAssertion(JmlMonitorsForVarAssertion self)
Prints a JML MonitorsFor variable assertion. |
void |
visitJmlName(JmlName self)
Prints a JML name. |
void |
visitJmlNode(JmlNode self)
|
void |
visitJmlNondetChoiceStatement(JmlNondetChoiceStatement self)
Prints a JML nondeterministic choice statement. |
void |
visitJmlNondetIfStatement(JmlNondetIfStatement self)
Prints a JML nondeterministic if statement. |
void |
visitJmlNonNullElementsExpression(JmlNonNullElementsExpression self)
Prints a JML \nonnullelements expression. |
void |
visitJmlNormalBehaviorSpec(JmlNormalBehaviorSpec self)
Prints a JML normal behavior specification. |
void |
visitJmlNormalExample(JmlNormalExample self)
Prints a JML normal example. |
void |
visitJmlNormalSpecBody(JmlNormalSpecBody self)
Prints a JML normal spec body. |
void |
visitJmlNormalSpecCase(JmlNormalSpecCase self)
Prints a JML normal spec case. |
void |
visitJmlNotAssignedExpression(JmlNotAssignedExpression self)
Prints a JML \not_assigned expression. |
void |
visitJmlNotModifiedExpression(JmlNotModifiedExpression self)
Prints a JML \not_modified expression. |
void |
visitJmlOldExpression(JmlOldExpression self)
Prints a JML \old expression. |
void |
visitJmlOnlyAccessedExpression(JmlOnlyAccessedExpression self)
Prints a JML \only_accessed expression. |
void |
visitJmlOnlyAssignedExpression(JmlOnlyAssignedExpression self)
Prints a JML \only_assigned expression. |
void |
visitJmlOnlyCalledExpression(JmlOnlyCalledExpression self)
Prints a JML \only_called expression. |
void |
visitJmlOnlyCapturedExpression(JmlOnlyCapturedExpression self)
Prints a JML \only_captured expression. |
void |
visitJmlPackageImport(JmlPackageImport self)
Prints a JML package import statement. |
void |
visitJmlPredicate(JmlPredicate self)
Prints a JML predicate. |
void |
visitJmlPredicateKeyword(JmlPredicateKeyword self)
|
void |
visitJmlPreExpression(JmlPreExpression self)
Prints a JML \pre expression. |
void |
visitJmlReachExpression(JmlReachExpression self)
Prints a JML reach expression. |
void |
visitJmlReadableIfVarAssertion(JmlReadableIfVarAssertion self)
Prints a JML readableif variable assertion. |
void |
visitJmlRedundantSpec(JmlRedundantSpec self)
Prints a JML redundant specifications including implies_that and for_example. |
void |
visitJmlRefinePrefix(JmlRefinePrefix self)
Prints a JML refine prefix. |
void |
visitJmlRelationalExpression(JmlRelationalExpression self)
Prints a JML relational expression. |
void |
visitJmlRepresentsDecl(JmlRepresentsDecl self)
Prints a JML represents declaration. |
void |
visitJmlRequiresClause(JmlRequiresClause self)
Prints a JML requires clause. |
void |
visitJmlResultExpression(JmlResultExpression self)
Prints a JML \result expression. |
void |
visitJmlReturnsClause(JmlReturnsClause self)
Prints a JML return clause. |
void |
visitJmlSetComprehension(JmlSetComprehension self)
Prints a JML set comprehension expression. |
void |
visitJmlSetStatement(JmlSetStatement self)
Prints the given JML set statement. |
void |
visitJmlSignalsClause(JmlSignalsClause self)
Prints a JML signals clause |
void |
visitJmlSignalsOnlyClause(JmlSignalsOnlyClause self)
Prints a JML signals_only clause |
void |
visitJmlSpaceExpression(JmlSpaceExpression self)
Prints a JML \space expression. |
void |
visitJmlSpecBody(JmlSpecBody self)
|
void |
visitJmlSpecExpression(JmlSpecExpression self)
Prints a JML specification expression. |
void |
visitJmlSpecification(JmlSpecification self)
Prints a JML specification. |
void |
visitJmlSpecQuantifiedExpression(JmlSpecQuantifiedExpression self)
Prints a JML specification quantified expression. |
void |
visitJmlSpecStatement(JmlSpecStatement self)
Prints a JML specification statement. |
void |
visitJmlSpecVarDecl(JmlSpecVarDecl self)
|
void |
visitJmlStoreRef(JmlStoreRef self)
|
void |
visitJmlStoreRefExpression(JmlStoreRefExpression self)
Prints a JML store reference expression. |
void |
visitJmlStoreRefKeyword(JmlStoreRefKeyword self)
Prints a JML store reference keywords such as \everything, \nothing, and
\not_specified. |
void |
visitJmlStoreRefListWrapper(JmlStoreRefListWrapper self)
|
void |
visitJmlTypeExpression(JmlTypeExpression self)
Prints a JML \type expression. |
void |
visitJmlTypeOfExpression(JmlTypeOfExpression self)
Prints a JML \typeof expression. |
void |
visitJmlUnreachableStatement(JmlUnreachableStatement self)
Prints a JML unreachable statement. |
void |
visitJmlVariableDefinition(JmlVariableDefinition self)
Prints a JML variable declaration. |
void |
visitJmlVariantFunction(JmlVariantFunction self)
Prints a JML variant function. |
void |
visitJmlWhenClause(JmlWhenClause self)
Prints a JML when clause. |
void |
visitJmlWorkingSpaceClause(JmlWorkingSpaceClause self)
Prints a JML working space clause. |
void |
visitJmlWorkingSpaceExpression(JmlWorkingSpaceExpression self)
Prints a JML \working_space expression. |
void |
visitJmlWritableIfVarAssertion(JmlWritableIfVarAssertion self)
|
private void |
visitMethodSpecification(JmlSpecification self)
Prints a JML method extending specification. |
void |
visitNewArrayExpression(JNewArrayExpression self)
Prints an array allocator expression. |
void |
visitNewObjectExpression(JNewObjectExpression self)
Prints an object allocator expression. |
void |
visitOrdinalLiteral(JOrdinalLiteral self)
Prints an ordinal literal. |
void |
visitPostfixExpression(JPostfixExpression self)
prints a postfix expression |
void |
visitPrefixExpression(JPrefixExpression self)
prints a prefix expression |
void |
visitRacJmlMethodDeclaration(JmlMethodDeclaration self)
Prints a JML method declaration in Racc. |
void |
visitRacNode(RacNode self)
Prints a given RacNode. |
void |
visitRacPredicate(RacPredicate self)
Prints a RAC predicate. |
void |
visitShiftExpression(JShiftExpression self)
prints a shift expression |
protected void |
visitSpecBody(JmlSpecBody self)
Prints specification body. |
void |
visitSpecBodyClause(JmlPredicateClause self,
String keyword)
Prints specfication body clause. |
protected void |
visitSpecCases(JmlSpecCase[] specCases)
Prints spec cases. |
void |
visitUnaryExpression(JUnaryExpression self)
prints an unary expression |
void |
visitUnaryPromoteExpression(JUnaryPromote self)
prints a unaryPrompte expression |
private void |
visitVarDecls(JVariableDefinition[] varDefs)
Prints a Java variable delcaration. |
void |
visitVariableDeclarationStatement(JVariableDeclarationStatement self)
prints a variable declaration 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 |
public static final String NEW_LINE
protected int offset
private boolean inAnnotation
private invariant inAnnotation <==> annotationDepth > 0;
private int annotationDepth
private invariant annotationDepth >= 0;
private int atMarkerPos
private JmlModifier jmlModUtil
private invariant jmlModUtil != null && jmlModUtil == modUtil && inAnnotation <==> jmlModUtil.withoutMarkers();
| Constructor Detail |
public RacPrettyPrinter(Writer writer,
JmlModifier modUtil)
writer - the object to which java code be writtenmodUtil - the modifier utility to print Java and JML modifiers
public RacPrettyPrinter(String fileName,
JmlModifier modUtil)
fileName - the file into which the code is to be printedmodUtil - the modifier utility to print Java and JML modifiers
public RacPrettyPrinter(File file,
JmlModifier modUtil)
file - the file into which the code is to be printedmodUtil - the modifier utility to print Java and JML modifierspublic RacPrettyPrinter(TabbedPrintWriter writer)
writer - the file into which the code is to be printed| Method Detail |
public void visitJmlCompilationUnit(JmlCompilationUnit self)
visitJmlCompilationUnit in interface JmlVisitorpublic void visitCompilationUnit(JCompilationUnit self)
self, the reason
being that, due to refinement, combined type declarations
should be printed and this can only be done at JML level.
visitCompilationUnit in interface MjcVisitorvisitCompilationUnit in class MjcPrettyPrinterpublic void visitJmlClassDeclaration(JmlClassDeclaration self)
visitJmlClassDeclaration in interface JmlVisitorprotected void visitClassBody(JmlTypeDeclaration self)
public void visitJmlInterfaceDeclaration(JmlInterfaceDeclaration self)
visitJmlInterfaceDeclaration in interface JmlVisitorpublic void visitJmlMethodDeclaration(JmlMethodDeclaration self)
visitJmlMethodDeclaration in interface JmlVisitorpublic void visitRacJmlMethodDeclaration(JmlMethodDeclaration self)
MjcPrettyPrinter#visitMethodDeclaration()protected void visitBigintLiteral(long value)
protected void applyBinaryExpression(JExpression left,
JExpression right,
String oper)
protected void visitBinaryExpression(JBinaryExpression self,
String oper)
visitBinaryExpression in class MjcPrettyPrinterpublic void visitEqualityExpression(JEqualityExpression self)
visitEqualityExpression in interface MjcVisitorvisitEqualityExpression in class MjcPrettyPrinterpublic void visitShiftExpression(JShiftExpression self)
visitShiftExpression in interface MjcVisitorvisitShiftExpression in class MjcPrettyPrinterpublic void visitBitwiseExpression(JBitwiseExpression self)
visitBitwiseExpression in interface MjcVisitorvisitBitwiseExpression in class MjcPrettyPrinterpublic void visitUnaryExpression(JUnaryExpression self)
visitUnaryExpression in interface MjcVisitorvisitUnaryExpression in class MjcPrettyPrinterpublic void visitArrayAccessExpression(JArrayAccessExpression self)
visitArrayAccessExpression in interface MjcVisitorvisitArrayAccessExpression in class MjcPrettyPrinterpublic void visitFieldExpression(JClassFieldExpression self)
visitFieldExpression in interface MjcVisitorvisitFieldExpression in class MjcPrettyPrinterpublic void visitCompoundAssignmentExpression(JCompoundAssignmentExpression self)
visitCompoundAssignmentExpression in interface MjcVisitorvisitCompoundAssignmentExpression in class MjcPrettyPrinterpublic void visitPrefixExpression(JPrefixExpression self)
visitPrefixExpression in interface MjcVisitorvisitPrefixExpression in class MjcPrettyPrinterpublic void visitPostfixExpression(JPostfixExpression self)
visitPostfixExpression in interface MjcVisitorvisitPostfixExpression in class MjcPrettyPrinter
private void printVariableDefinition(JVariableDefinition self,
boolean typeAndMod)
self. If the
argument, typeAndMod is true, the type and
modifiers are also printed; otherwise, they are not printed.
public void visitVariableDeclarationStatement(JVariableDeclarationStatement self)
visitVariableDeclarationStatement in interface MjcVisitorvisitVariableDeclarationStatement in class MjcPrettyPrinterpublic void visitFormalParameters(JFormalParameter self)
MjcVisitor
visitFormalParameters in interface MjcVisitorvisitFormalParameters in class MjcPrettyPrinterpublic void visitJmlConstructorDeclaration(JmlConstructorDeclaration self)
visitJmlConstructorDeclaration in interface JmlVisitorpublic void visitJmlPredicate(JmlPredicate self)
visitJmlPredicate in interface JmlVisitorpublic void visitJmlPredicateKeyword(JmlPredicateKeyword self)
visitJmlPredicateKeyword in interface JmlVisitorpublic void visitRacPredicate(RacPredicate self)
visitRacPredicate in interface RacVisitorpublic void visitJmlSpecExpression(JmlSpecExpression self)
visitJmlSpecExpression in interface JmlVisitorpublic void visitRacNode(RacNode self)
RacParser.END_OF_LINE,
String, and AST nodes.
visitRacNode in interface RacVisitorRacNodeprotected void println(String code)
public void visitJmlAbruptSpecBody(JmlAbruptSpecBody self)
visitJmlAbruptSpecBody in interface JmlVisitorpublic void visitJmlAbruptSpecCase(JmlAbruptSpecCase self)
visitJmlAbruptSpecCase in interface JmlVisitorpublic void visitJmlAccessibleClause(JmlAccessibleClause self)
visitJmlAccessibleClause in interface JmlVisitorpublic void visitJmlAssertStatement(JmlAssertStatement self)
visitJmlAssertStatement in interface JmlVisitorpublic void visitJmlAssignableClause(JmlAssignableClause self)
visitJmlAssignableClause in interface JmlVisitorpublic void visitJmlAssumeStatement(JmlAssumeStatement self)
visitJmlAssumeStatement in interface JmlVisitorpublic void visitJmlAxiom(JmlAxiom self)
visitJmlAxiom in interface JmlVisitorpublic void visitJmlBehaviorSpec(JmlBehaviorSpec self)
visitJmlBehaviorSpec in interface JmlVisitorpublic void visitJmlBreaksClause(JmlBreaksClause self)
visitJmlBreaksClause in interface JmlVisitorpublic void visitJmlCallableClause(JmlCallableClause self)
visitJmlCallableClause in interface JmlVisitorpublic void visitJmlMethodNameList(JmlMethodNameList self)
visitJmlMethodNameList in interface JmlVisitorpublic void visitJmlCapturesClause(JmlCapturesClause self)
visitJmlCapturesClause in interface JmlVisitorpublic void visitJmlClassBlock(JmlClassBlock self)
visitJmlClassBlock in interface JmlVisitorpublic void visitJmlClassOrGFImport(JmlClassOrGFImport self)
visitJmlClassOrGFImport in interface JmlVisitorpublic void visitJmlCodeContract(JmlCodeContract self)
visitJmlCodeContract in interface JmlVisitorpublic void visitJmlConstraint(JmlConstraint self)
visitJmlConstraint in interface JmlVisitorpublic void visitJmlConstructorName(JmlConstructorName self)
visitJmlConstructorName in interface JmlVisitorpublic void visitJmlContinuesClause(JmlContinuesClause self)
visitJmlContinuesClause in interface JmlVisitorpublic void visitJmlDebugStatement(JmlDebugStatement self)
visitJmlDebugStatement in interface JmlVisitorpublic void visitJmlDivergesClause(JmlDivergesClause self)
visitJmlDivergesClause in interface JmlVisitorpublic void visitJmlElemTypeExpression(JmlElemTypeExpression self)
elemtype expression.
visitJmlElemTypeExpression in interface JmlVisitorpublic void visitJmlEnsuresClause(JmlEnsuresClause self)
visitJmlEnsuresClause in interface JmlVisitorpublic void visitJmlExample(JmlExample self)
visitJmlExample in interface JmlVisitorpublic void visitJmlExceptionalBehaviorSpec(JmlExceptionalBehaviorSpec self)
visitJmlExceptionalBehaviorSpec in interface JmlVisitorpublic void visitJmlExceptionalExample(JmlExceptionalExample self)
visitJmlExceptionalExample in interface JmlVisitorpublic void visitJmlExceptionalSpecBody(JmlExceptionalSpecBody self)
visitJmlExceptionalSpecBody in interface JmlVisitorpublic void visitJmlExceptionalSpecCase(JmlExceptionalSpecCase self)
visitJmlExceptionalSpecCase in interface JmlVisitorpublic void visitJmlExtendingSpecification(JmlExtendingSpecification self)
visitJmlExtendingSpecification in interface JmlVisitorprivate void visitMethodSpecification(JmlSpecification self)
public void visitJmlFieldDeclaration(JmlFieldDeclaration self)
visitJmlFieldDeclaration in interface JmlVisitorpublic void visitJmlForAllVarDecl(JmlForAllVarDecl self)
visitJmlForAllVarDecl in interface JmlVisitorprivate void visitVarDecls(JVariableDefinition[] varDefs)
public void visitJmlFormalParameter(JmlFormalParameter self)
visitJmlFormalParameter in interface JmlVisitorpublic void visitJmlFreshExpression(JmlFreshExpression self)
visitJmlFreshExpression in interface JmlVisitorpublic void visitJmlGenericSpecBody(JmlGenericSpecBody self)
visitJmlGenericSpecBody in interface JmlVisitorpublic void visitJmlGenericSpecCase(JmlGenericSpecCase self)
visitJmlGenericSpecCase in interface JmlVisitorpublic void visitJmlGuardedStatement(JmlGuardedStatement self)
visitJmlGuardedStatement in interface JmlVisitorpublic void visitJmlHenceByStatement(JmlHenceByStatement self)
visitJmlHenceByStatement in interface JmlVisitorpublic void visitJmlInGroupClause(JmlInGroupClause self)
visitJmlInGroupClause in interface JmlVisitorpublic void visitJmlInformalExpression(JmlInformalExpression self)
visitJmlInformalExpression in interface JmlVisitorpublic void visitJmlInformalStoreRef(JmlInformalStoreRef self)
visitJmlInformalStoreRef in interface JmlVisitorpublic void visitJmlInitiallyVarAssertion(JmlInitiallyVarAssertion self)
visitJmlInitiallyVarAssertion in interface JmlVisitorpublic void visitJmlInvariant(JmlInvariant self)
visitJmlInvariant in interface JmlVisitorpublic void visitJmlInvariantForExpression(JmlInvariantForExpression self)
visitJmlInvariantForExpression in interface JmlVisitorpublic void visitJmlInvariantStatement(JmlInvariantStatement self)
visitJmlInvariantStatement in interface JmlVisitorpublic void visitJmlIsInitializedExpression(JmlIsInitializedExpression self)
visitJmlIsInitializedExpression in interface JmlVisitorpublic void visitJmlLabelExpression(JmlLabelExpression self)
visitJmlLabelExpression in interface JmlVisitorpublic void visitJmlLetVarDecl(JmlLetVarDecl self)
visitJmlLetVarDecl in interface JmlVisitorpublic void visitJmlVariableDefinition(JmlVariableDefinition self)
visitJmlVariableDefinition in interface JmlVisitorpublic void visitJmlLockSetExpression(JmlLockSetExpression self)
visitJmlLockSetExpression in interface JmlVisitorpublic void visitJmlLoopInvariant(JmlLoopInvariant self)
visitJmlLoopInvariant in interface JmlVisitorpublic void visitJmlLoopStatement(JmlLoopStatement self)
visitJmlLoopStatement in interface JmlVisitorpublic void visitJmlWorkingSpaceClause(JmlWorkingSpaceClause self)
visitJmlWorkingSpaceClause in interface JmlVisitorpublic void visitJmlDurationClause(JmlDurationClause self)
visitJmlDurationClause in interface JmlVisitorpublic void visitJmlMapsIntoClause(JmlMapsIntoClause self)
visitJmlMapsIntoClause in interface JmlVisitorpublic void visitJmlMeasuredClause(JmlMeasuredClause self)
visitJmlMeasuredClause in interface JmlVisitorpublic void visitJmlMethodName(JmlMethodName self)
visitJmlMethodName in interface JmlVisitorpublic void visitJmlModelProgram(JmlModelProgram self)
visitJmlModelProgram in interface JmlVisitorpublic void visitJmlMonitorsForVarAssertion(JmlMonitorsForVarAssertion self)
visitJmlMonitorsForVarAssertion in interface JmlVisitorpublic void visitJmlName(JmlName self)
visitJmlName in interface JmlVisitorpublic void visitJmlNonNullElementsExpression(JmlNonNullElementsExpression self)
\nonnullelements expression.
visitJmlNonNullElementsExpression in interface JmlVisitorpublic void visitJmlAssignmentStatement(JmlAssignmentStatement self)
visitJmlAssignmentStatement in interface JmlVisitorpublic void visitJmlNondetChoiceStatement(JmlNondetChoiceStatement self)
visitJmlNondetChoiceStatement in interface JmlVisitorpublic void visitJmlNondetIfStatement(JmlNondetIfStatement self)
visitJmlNondetIfStatement in interface JmlVisitorpublic void visitJmlNormalBehaviorSpec(JmlNormalBehaviorSpec self)
visitJmlNormalBehaviorSpec in interface JmlVisitorpublic void visitJmlNormalExample(JmlNormalExample self)
visitJmlNormalExample in interface JmlVisitorpublic void visitJmlNormalSpecBody(JmlNormalSpecBody self)
visitJmlNormalSpecBody in interface JmlVisitorpublic void visitJmlNormalSpecCase(JmlNormalSpecCase self)
visitJmlNormalSpecCase in interface JmlVisitorpublic void visitJmlNotModifiedExpression(JmlNotModifiedExpression self)
\not_modified expression.
visitJmlNotModifiedExpression in interface JmlVisitorpublic void visitJmlNotAssignedExpression(JmlNotAssignedExpression self)
\not_assigned expression.
visitJmlNotAssignedExpression in interface JmlVisitorpublic void visitJmlOnlyAccessedExpression(JmlOnlyAccessedExpression self)
\only_accessed expression.
visitJmlOnlyAccessedExpression in interface JmlVisitorpublic void visitJmlOnlyAssignedExpression(JmlOnlyAssignedExpression self)
\only_assigned expression.
visitJmlOnlyAssignedExpression in interface JmlVisitorpublic void visitJmlOnlyCalledExpression(JmlOnlyCalledExpression self)
\only_called expression.
visitJmlOnlyCalledExpression in interface JmlVisitorpublic void visitJmlOnlyCapturedExpression(JmlOnlyCapturedExpression self)
\only_captured expression.
visitJmlOnlyCapturedExpression in interface JmlVisitorpublic void visitJmlStoreRefListWrapper(JmlStoreRefListWrapper self)
public void visitJmlOldExpression(JmlOldExpression self)
\old expression.
visitJmlOldExpression in interface JmlVisitorpublic void visitJmlPreExpression(JmlPreExpression self)
\pre expression.
visitJmlPreExpression in interface JmlVisitorpublic void visitJmlMaxExpression(JmlMaxExpression self)
\max expression.
visitJmlMaxExpression in interface JmlVisitorpublic void visitJmlDurationExpression(JmlDurationExpression self)
\duration expression.
visitJmlDurationExpression in interface JmlVisitorpublic void visitJmlWorkingSpaceExpression(JmlWorkingSpaceExpression self)
\working_space expression.
visitJmlWorkingSpaceExpression in interface JmlVisitorpublic void visitJmlSpaceExpression(JmlSpaceExpression self)
\space expression.
visitJmlSpaceExpression in interface JmlVisitorpublic void visitJmlPackageImport(JmlPackageImport self)
visitJmlPackageImport in interface JmlVisitorpublic void visitJmlReachExpression(JmlReachExpression self)
visitJmlReachExpression in interface JmlVisitorpublic void visitJmlReadableIfVarAssertion(JmlReadableIfVarAssertion self)
visitJmlReadableIfVarAssertion in interface JmlVisitorpublic void visitJmlWritableIfVarAssertion(JmlWritableIfVarAssertion self)
visitJmlWritableIfVarAssertion in interface JmlVisitorpublic void visitJmlRedundantSpec(JmlRedundantSpec self)
implies_that and for_example.
visitJmlRedundantSpec in interface JmlVisitorpublic void visitJmlRefinePrefix(JmlRefinePrefix self)
visitJmlRefinePrefix in interface JmlVisitorpublic void visitJmlRelationalExpression(JmlRelationalExpression self)
visitJmlRelationalExpression in interface JmlVisitorpublic void visitJmlRepresentsDecl(JmlRepresentsDecl self)
represents declaration.
visitJmlRepresentsDecl in interface JmlVisitorpublic void visitJmlRequiresClause(JmlRequiresClause self)
visitJmlRequiresClause in interface JmlVisitorpublic void visitJmlResultExpression(JmlResultExpression self)
\result expression.
visitJmlResultExpression in interface JmlVisitorpublic void visitJmlReturnsClause(JmlReturnsClause self)
visitJmlReturnsClause in interface JmlVisitorpublic void visitJmlSetComprehension(JmlSetComprehension self)
visitJmlSetComprehension in interface JmlVisitorpublic void visitJmlSetStatement(JmlSetStatement self)
visitJmlSetStatement in interface JmlVisitorpublic void visitJmlSignalsOnlyClause(JmlSignalsOnlyClause self)
visitJmlSignalsOnlyClause in interface JmlVisitorpublic void visitJmlSignalsClause(JmlSignalsClause self)
visitJmlSignalsClause in interface JmlVisitorpublic void visitJmlSpecQuantifiedExpression(JmlSpecQuantifiedExpression self)
visitJmlSpecQuantifiedExpression in interface JmlVisitorpublic void visitJmlSpecStatement(JmlSpecStatement self)
visitJmlSpecStatement in interface JmlVisitorpublic void visitJmlSpecification(JmlSpecification self)
visitJmlSpecification in interface JmlVisitorpublic void visitJmlStoreRefExpression(JmlStoreRefExpression self)
visitJmlStoreRefExpression in interface JmlVisitorpublic void visitJmlStoreRefKeyword(JmlStoreRefKeyword self)
\everything, \nothing, and
\not_specified.
visitJmlStoreRefKeyword in interface JmlVisitorpublic void visitJmlTypeExpression(JmlTypeExpression self)
\type expression.
visitJmlTypeExpression in interface JmlVisitorpublic void visitJmlTypeOfExpression(JmlTypeOfExpression self)
\typeof expression.
visitJmlTypeOfExpression in interface JmlVisitorpublic void visitJmlUnreachableStatement(JmlUnreachableStatement self)
visitJmlUnreachableStatement in interface JmlVisitorpublic void visitJmlVariantFunction(JmlVariantFunction self)
visitJmlVariantFunction in interface JmlVisitorpublic void visitJmlWhenClause(JmlWhenClause self)
visitJmlWhenClause in interface JmlVisitorpublic void visitCastExpression(JCastExpression self)
visitCastExpression in interface MjcVisitorvisitCastExpression in class MjcPrettyPrinterpublic void visitUnaryPromoteExpression(JUnaryPromote self)
visitUnaryPromoteExpression in interface MjcVisitorvisitUnaryPromoteExpression in class MjcPrettyPrinterpublic void visitNewObjectExpression(JNewObjectExpression self)
visitNewObjectExpression in interface MjcVisitorvisitNewObjectExpression in class MjcPrettyPrinterpublic void visitNewArrayExpression(JNewArrayExpression self)
visitNewArrayExpression in interface MjcVisitorvisitNewArrayExpression in class MjcPrettyPrinterpublic void visitOrdinalLiteral(JOrdinalLiteral self)
visitOrdinalLiteral in interface MjcVisitorvisitOrdinalLiteral in class MjcPrettyPrinterpublic void visitCharLiteral(JCharLiteral self)
visitCharLiteral in interface MjcVisitorvisitCharLiteral in class MjcPrettyPrinterprotected void visitDoubleLiteral(double value)
visitDoubleLiteral in class MjcPrettyPrinterprotected void visitFloatLiteral(float value)
visitFloatLiteral in class MjcPrettyPrinterprotected String toString(CType type)
MjcPrettyPrintern1.n2.1.n3, then
returned is the string "n3".
toString in class MjcPrettyPrinterpublic void visitGeneralSpecCase(JmlGeneralSpecCase self)
protected void visitSpecCases(JmlSpecCase[] specCases)
protected void visitExample(JmlExample self)
protected void visitSpecBody(JmlSpecBody self)
public void visitSpecBodyClause(JmlPredicateClause self,
String keyword)
protected void mayStartAnnotation()
/*@.
modifies annotationDepth, inAnnotation, jmlModUtil, atMarkerPos; ensures annotationDepth == \old(annotationDepth) + 1; ensures_redundantly inAnnotation && jmlModUtil.withoutMarkers();
mayEndAnnotation(),
mayStartAnnotation(boolean)protected void mayEndAnnotation()
@*/.
modifies annotationDepth, inAnnotation, jmlModUtil; ensures annotationDepth == \old(annotationDepth) - 1;
mayStartAnnotation(),
mayEndAnnotation(boolean)protected void mayStartAnnotation(boolean flag)
flag is
true and not already in the annotation mode;
also prints the opening annotation marker /*@.
modifies annotationDepth, inAnnotation, jmlModUtil, atMarkerPos; ensures flag ==> (annotationDepth == \old(annotationDepth) + 1); ensures_redundantly flag ==> (inAnnotation && jmlModUtil.withoutMarkers());
mayEndAnnotation(boolean)protected void mayEndAnnotation(boolean flag)
flag is
true and currently in the annotation mode;
also prints the closing annotation marker @*/.
modifies annotationDepth, inAnnotation, jmlModUtil; ensures flag ==> (annotationDepth == \old(annotationDepth) - 1);
mayStartAnnotation(boolean)protected void newLine()
newLine in class MjcPrettyPrinterprotected void newLineOffset()
protected void print(String s)
print in class MjcPrettyPrinterprotected void print(CType t)
print in class MjcPrettyPrinterprotected void printJml(String s)
/*@ ... @*/.
protected void acceptAll(JPhylum[] all)
public void close()
MjcPrettyPrinter
close in class MjcPrettyPrinterpublic void visitJmlDeclaration(JmlDeclaration self)
visitJmlDeclaration in interface JmlVisitorpublic void visitJmlExpression(JmlExpression self)
visitJmlExpression in interface JmlVisitorpublic void visitJmlGeneralSpecCase(JmlGeneralSpecCase self)
visitJmlGeneralSpecCase in interface JmlVisitorpublic void visitJmlMethodSpecification(JmlMethodSpecification self)
visitJmlMethodSpecification in interface JmlVisitorpublic void visitJmlNode(JmlNode self)
visitJmlNode in interface JmlVisitorpublic void visitJmlSpecBody(JmlSpecBody self)
visitJmlSpecBody in interface JmlVisitorpublic void visitJmlSpecVarDecl(JmlSpecVarDecl self)
visitJmlSpecVarDecl in interface JmlVisitorpublic void visitJmlStoreRef(JmlStoreRef self)
visitJmlStoreRef in interface JmlVisitor
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||