001    // -*- mode: java -*-
002    /* Copyright 2000, 2001, Compaq Computer Corporation */
003    
004    /* IF THIS IS A JAVA FILE, DO NOT EDIT IT!  
005    
006       Most Java files in this directory which are part of the Javafe AST
007       are automatically generated using the astgen comment (see
008       ESCTools/Javafe/astgen) from the input file 'hierarchy.h'.  If you
009       wish to modify AST classes or introduce new ones, modify
010       'hierarchy.j.'
011     */
012    
013    package javafe.ast;
014    
015    import javafe.util.Assert;
016    import javafe.util.Location;
017    import javafe.util.ErrorSet;
018    
019    // Convention: unless otherwise noted, integer fields named "loc" refer
020    // to the location of the first character of the syntactic unit
021    
022    
023    // Abstract class containing common parts of Block and SwitchBlock
024    // syntactic units.
025    
026    public abstract class GenericBlockStmt extends Stmt
027    {
028      public /*@ non_null @*/ StmtVec stmts;
029    
030      //@ invariant locOpenBrace != javafe.util.Location.NULL;
031      public int locOpenBrace;
032    
033      //@ invariant locCloseBrace != javafe.util.Location.NULL;
034      public int locCloseBrace;
035    
036    
037      public /*@ pure @*/ int getEndLoc() { return locCloseBrace; }
038    
039    
040    // Generated boilerplate constructors:
041    
042      //@ ensures this.stmts == stmts;
043      //@ ensures this.locOpenBrace == locOpenBrace;
044      //@ ensures this.locCloseBrace == locCloseBrace;
045      protected GenericBlockStmt(/*@ non_null @*/ StmtVec stmts, int locOpenBrace, int locCloseBrace) {
046         super();
047         this.stmts = stmts;
048         this.locOpenBrace = locOpenBrace;
049         this.locCloseBrace = locCloseBrace;
050      }
051      public void check() {
052         super.check();
053         for(int i = 0; i < this.stmts.size(); i++)
054            this.stmts.elementAt(i).check();
055      }
056    
057    }