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 SimpleStmtPragma extends StmtPragma
031    {
032      public int tag;
033    
034      public int loc;
035    
036    
037      public final int getTag() { return tag; }
038    
039      private void postCheck() {
040        boolean goodtag = (tag == TagConstants.UNREACHABLE);
041        Assert.notFalse(goodtag);
042      }
043    
044      public int getStartLoc() { return loc; }
045    
046    
047    // Generated boilerplate constructors:
048    
049      /**
050       * Construct a raw SimpleStmtPragma whose class invariant(s) have not
051       * yet been established.  It is the caller's job to
052       * initialize the returned node's fields so that any
053       * class invariants hold.
054       */
055      //@ requires I_will_establish_invariants_afterwards;
056      protected SimpleStmtPragma() {}    //@ nowarn Invariant,NonNullInit;
057    
058    
059    // Generated boilerplate methods:
060    
061      public final int childCount() {
062         return 0;
063      }
064    
065      public final Object childAt(int index) {
066              /*throws IndexOutOfBoundsException*/
067         if (index < 0)
068            throw new IndexOutOfBoundsException("AST child index " + index);
069         int indexPre = index;
070    
071         int sz;
072    
073         throw new IndexOutOfBoundsException("AST child index " + indexPre);
074      }   //@ nowarn Exception;
075    
076      public final String toString() {
077         return "[SimpleStmtPragma"
078            + " tag = " + this.tag
079            + " loc = " + this.loc
080            + "]";
081      }
082    
083      public final void accept(javafe.ast.Visitor v) { 
084        if (v instanceof Visitor) ((Visitor)v).visitSimpleStmtPragma(this);
085      }
086    
087      public final Object accept(javafe.ast.VisitorArgResult v, Object o) { 
088        if (v instanceof VisitorArgResult) return ((VisitorArgResult)v).visitSimpleStmtPragma(this, o); else return null;
089      }
090    
091      public void check() {
092         postCheck();
093      }
094    
095      //@ ensures \result != null;
096      public static SimpleStmtPragma make(int tag, int loc) {
097         //@ set I_will_establish_invariants_afterwards = true;
098         SimpleStmtPragma result = new SimpleStmtPragma();
099         result.tag = tag;
100         result.loc = loc;
101         return result;
102      }
103    }