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