Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| 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

## escjava
Class AnnotationHandler.NestedPragmaParser

    java.lang.Object
      escjava.AnnotationHandler.NestedPragmaParser

Enclosing class:
  AnnotationHandler

public static class AnnotationHandler.NestedPragmaParser
extends java.lang.Object

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

### encounteredError

    private boolean encounteredError

Constructor Detail

### AnnotationHandler.NestedPragmaParser

    public AnnotationHandler.NestedPragmaParser()

Method Detail

### parseAllRoutineSpecs

    public 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.

### parseAllRoutineSpecs

    public void parseAllRoutineSpecs(TypeDecl td)

### parseRoutineSpecs

    public void parseRoutineSpecs(RoutineDecl rd)

### isRoutineModifier

    public static boolean isRoutineModifier(int tag)

### isEndingModifier

    public static boolean isEndingModifier(int tag)

### parseAlsoSeq

    public int parseAlsoSeq(int pos,
                            ModifierPragmaVec pm,
                            int behaviorMode,
                            ModifierPragma behavior,
                            java.util.ArrayList result)

### parseCCSeq

    public int parseCCSeq(int pos,
                          ModifierPragmaVec pm,
                          ModifierPragmaVec result)

  Parse the clauses in a code_contract section

### parseSeq

    public int parseSeq(int pos,
                        ModifierPragmaVec pm,
                        int behaviorMode,
                        ModifierPragma behavior,
                        ModifierPragmaVec result)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| 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

The ESC/Java2 Project Homepage