    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 escjava.ast;
    013
    014    import java.util.Hashtable;
    015    import java.util.Set;
    016    import java.util.ArrayList;
    017
    018    import javafe.ast.*;
    019    import javafe.util.Assert;
    020    import javafe.util.Location;
    021    import escjava.ParsedRoutineSpecs;
    022
    023    // Convention: unless otherwise noted, integer fields named "loc" refer
    024    // to the location of the first character of the syntactic unit
    025
    026    //# TagBase javafe.tc.TagConstants.LAST_TAG + 1
    027    //# VisitorRoot javafe.ast.Visitor
    028
    029
    030    public class NothingExpr extends Expr
    031    {
    032      public int loc;
    033
    034
    035      public int getStartLoc() { return loc; }
    036
    037
    038    // Generated boilerplate constructors:
    039
    040      /**
    041       * Construct a raw NothingExpr whose class invariant(s) have not
    042       * yet been established.  It is the caller's job to
    043       * initialize the returned node's fields so that any
    044       * class invariants hold.
    045       */
    046      //@ requires I_will_establish_invariants_afterwards;
    047      protected NothingExpr() {}    //@ nowarn Invariant,NonNullInit;
    048
    049
    050    // Generated boilerplate methods:
    051
    052      public final int childCount() {
    053         return 0;
    054      }
    055
    056      public final Object childAt(int index) {
    057              /*throws IndexOutOfBoundsException*/
    058         if (index < 0)
    059            throw new IndexOutOfBoundsException("AST child index " + index);
    060         int indexPre = index;
    061
    062         int sz;
    063
    064         throw new IndexOutOfBoundsException("AST child index " + indexPre);
    065      }   //@ nowarn Exception;
    066
    067      public final String toString() {
    068         return "[NothingExpr"
    069            + " loc = " + this.loc
    070            + "]";
    071      }
    072
    073      public final int getTag() {
    074         return TagConstants.NOTHINGEXPR;
    075      }
    076
    077      public final void accept(javafe.ast.Visitor v) {
    078        if (v instanceof Visitor) ((Visitor)v).visitNothingExpr(this);
    079      }
    080
    081      public final Object accept(javafe.ast.VisitorArgResult v, Object o) {
    082        if (v instanceof VisitorArgResult) return ((VisitorArgResult)v).visitNothingExpr(this, o); else return null;
    083      }
    084
    085      public void check() {
    086      }
    087
    088      //@ ensures \result != null;
    089      public static NothingExpr make(int loc) {
    090         //@ set I_will_establish_invariants_afterwards = true;
    091         NothingExpr result = new NothingExpr();
    092         result.loc = loc;
    093         return result;
    094      }
    095    }