|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectescjava.AnnotationHandler.NestedPragmaParser
The routines in this class parse a sequence of ModifierPragma that occur prior to a method or constructor declaration. These consist of lightweight or heavyweight specifications, possibly nested or with consecutive spec-cases separated by 'also'. The parsing of the compilation unit simply produces a flat sequence of such ModifierPragmas, since they may occur in separate annotation comments and the Javafe parser does not provide mechanisms to associate them together. However, we do need to determine the nesting structure of the sequence of pragmas because the forall and old pragmas introduce new variable declarations that may be used in subsequent pragmas. This parsing into the nested structure (and checking of it) needs to be completed prior to type checking so that the variable references are properly determined. The ultimate desugaring then happens after typechecking. The resulting pmodifiers vector for each routine consists of a possibly-empty sequence of simple routine modifiers (e.g. pure, non_null) terminated with a single ParsedSpecs element.
Field Summary | |
private boolean |
encounteredError
|
Constructor Summary | |
AnnotationHandler.NestedPragmaParser()
|
Method Summary | |
static boolean |
isEndingModifier(int tag)
|
static boolean |
isRoutineModifier(int tag)
|
void |
parseAllRoutineSpecs(CompilationUnit ccu)
Parses the sequence of pragma modifiers for each routine in the CompilationUnit, replacing the existing sequence with the parsed one in each case. |
void |
parseAllRoutineSpecs(TypeDecl td)
|
int |
parseAlsoSeq(int pos,
ModifierPragmaVec pm,
int behaviorMode,
ModifierPragma behavior,
java.util.ArrayList result)
|
int |
parseCCSeq(int pos,
ModifierPragmaVec pm,
ModifierPragmaVec result)
Parse the clauses in a code_contract section |
void |
parseRoutineSpecs(RoutineDecl rd)
|
int |
parseSeq(int pos,
ModifierPragmaVec pm,
int behaviorMode,
ModifierPragma behavior,
ModifierPragmaVec result)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean encounteredError
Constructor Detail |
public AnnotationHandler.NestedPragmaParser()
Method Detail |
public void parseAllRoutineSpecs(CompilationUnit ccu)
public void parseAllRoutineSpecs(TypeDecl td)
public void parseRoutineSpecs(RoutineDecl rd)
public static boolean isRoutineModifier(int tag)
public static boolean isEndingModifier(int tag)
public int parseAlsoSeq(int pos, ModifierPragmaVec pm, int behaviorMode, ModifierPragma behavior, java.util.ArrayList result)
public int parseCCSeq(int pos, ModifierPragmaVec pm, ModifierPragmaVec result)
public int parseSeq(int pos, ModifierPragmaVec pm, int behaviorMode, ModifierPragma behavior, ModifierPragmaVec result)
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |