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 escjava.ast;
014    
015    import java.util.Hashtable;
016    import java.util.Set;
017    import java.util.ArrayList;
018    
019    import javafe.ast.*;
020    import javafe.util.Assert;
021    import javafe.util.Location;
022    import escjava.ParsedRoutineSpecs;
023    
024    // Convention: unless otherwise noted, integer fields named "loc" refer
025    // to the location of the first character of the syntactic unit
026    
027    //# TagBase javafe.tc.TagConstants.LAST_TAG + 1
028    //# VisitorRoot javafe.ast.Visitor
029    
030    
031    public class SimpleStmtPragma extends StmtPragma
032    {
033      public int tag;
034    
035      public int loc;
036    
037    
038      public final int getTag() { return tag; }
039    
040      private void postCheck() {
041        boolean goodtag = (tag == TagConstants.UNREACHABLE);
042        Assert.notFalse(goodtag);
043      }
044    
045      //@ public represents startLoc <- loc;
046      public /*@ pure @*/ int getStartLoc() { return loc; }
047    
048    
049    // Generated boilerplate constructors:
050    
051      //@ ensures this.tag == tag;
052      //@ ensures this.loc == loc;
053      protected SimpleStmtPragma(int tag, int loc) {
054         this.tag = tag;
055         this.loc = loc;
056      }
057    
058    // Generated boilerplate methods:
059    
060      public final int childCount() {
061         return 0;
062      }
063    
064      public final Object childAt(int index) {
065              /*throws IndexOutOfBoundsException*/
066         if (index < 0)
067            throw new IndexOutOfBoundsException("AST child index " + index);
068         int indexPre = index;
069    
070         int sz;
071    
072         throw new IndexOutOfBoundsException("AST child index " + indexPre);
073      }   //@ nowarn Exception;
074    
075      public final /*@non_null*/String toString() {
076         return "[SimpleStmtPragma"
077            + " tag = " + this.tag
078            + " loc = " + this.loc
079            + "]";
080      }
081    
082      public final void accept(javafe.ast.Visitor v) { 
083        if (v instanceof Visitor) ((Visitor)v).visitSimpleStmtPragma(this);
084      }
085    
086      public final Object accept(javafe.ast.VisitorArgResult v, Object o) { 
087        if (v instanceof VisitorArgResult) return ((VisitorArgResult)v).visitSimpleStmtPragma(this, o); else return null;
088      }
089    
090      public void check() {
091         postCheck();
092      }
093    
094      //@ ensures \result != null;
095      public static SimpleStmtPragma make(int tag, int loc) {
096         SimpleStmtPragma result = new SimpleStmtPragma(tag, loc);
097         return result;
098      }
099    }