    001    /* Copyright 2000, 2001, Compaq Computer Corporation */
    002
    003    /* IF THIS IS A JAVA FILE, DO NOT EDIT IT!
    004
    005       Most Java files in this directory which are part of the Javafe AST
    006       are automatically generated using the astgen comment (see
    007       ESCTools/Javafe/astgen) from the input file 'hierarchy.h'.  If you
    008       wish to modify AST classes or introduce new ones, modify
    009       'hierarchy.j.'
    010     */
    011
    012    package javafe.ast;
    013
    014    import javafe.util.Assert;
    015    import javafe.util.Location;
    016    import javafe.util.ErrorSet;
    017
    018    // Convention: unless otherwise noted, integer fields named "loc" refer
    019    // to the location of the first character of the syntactic unit
    020
    021
    022    public class ClassDeclStmt extends Stmt
    023    {
    024      public /*@ non_null @*/ ClassDecl decl;
    025
    026
    027      private void postCheck() {
    028      // Awaiting information from Sun...
    029      }
    030
    031      public int getStartLoc() { return decl.getStartLoc(); }
    032      public int getEndLoc() { return decl.getEndLoc(); }
    033
    034
    035    // Generated boilerplate constructors:
    036
    037      /**
    038       * Construct a raw ClassDeclStmt whose class invariant(s) have not
    039       * yet been established.  It is the caller's job to
    040       * initialize the returned node's fields so that any
    041       * class invariants hold.
    042       */
    043      //@ requires I_will_establish_invariants_afterwards;
    044      protected ClassDeclStmt() {}    //@ nowarn Invariant,NonNullInit;
    045
    046
    047    // Generated boilerplate methods:
    048
    049      public final int childCount() {
    050         return 1;
    051      }
    052
    053      public final Object childAt(int index) {
    054              /*throws IndexOutOfBoundsException*/
    055         if (index < 0)
    056            throw new IndexOutOfBoundsException("AST child index " + index);
    057         int indexPre = index;
    058
    059         int sz;
    060
    061         if (index == 0) return this.decl;
    062         else index--;
    063
    064         throw new IndexOutOfBoundsException("AST child index " + indexPre);
    065      }   //@ nowarn Exception;
    066
    067      public final String toString() {
    068         return "[ClassDeclStmt"
    069            + " decl = " + this.decl
    070            + "]";
    071      }
    072
    073      public final int getTag() {
    074         return TagConstants.CLASSDECLSTMT;
    075      }
    076
    077      public final void accept(Visitor v) { v.visitClassDeclStmt(this); }
    078
    079      public final Object accept(VisitorArgResult v, Object o) {return v.visitClassDeclStmt(this, o); }
    080
    081      public void check() {
    082         super.check();
    083         this.decl.check();
    084         postCheck();
    085      }
    086
    087      //@ ensures \result != null;
    088      public static ClassDeclStmt make(/*@ non_null @*/ ClassDecl decl) {
    089         //@ set I_will_establish_invariants_afterwards = true;
    090         ClassDeclStmt result = new ClassDeclStmt();
    091         result.decl = decl;
    092         return result;
    093      }
    094    }