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 SingleTypeImportDecl extends ImportDecl 023 { 024 public /*@ non_null @*/ TypeName typeName; 025 026 027 028 // Generated boilerplate constructors: 029 030 /** 031 * Construct a raw SingleTypeImportDecl whose class invariant(s) have not 032 * yet been established. It is the caller's job to 033 * initialize the returned node's fields so that any 034 * class invariants hold. 035 */ 036 //@ requires I_will_establish_invariants_afterwards; 037 protected SingleTypeImportDecl() {} //@ nowarn Invariant,NonNullInit; 038 039 040 // Generated boilerplate methods: 041 042 public final int childCount() { 043 return 1; 044 } 045 046 public final Object childAt(int index) { 047 /*throws IndexOutOfBoundsException*/ 048 if (index < 0) 049 throw new IndexOutOfBoundsException("AST child index " + index); 050 int indexPre = index; 051 052 int sz; 053 054 if (index == 0) return this.typeName; 055 else index--; 056 057 throw new IndexOutOfBoundsException("AST child index " + indexPre); 058 } //@ nowarn Exception; 059 060 public final String toString() { 061 return "[SingleTypeImportDecl" 062 + " loc = " + this.loc 063 + " typeName = " + this.typeName 064 + "]"; 065 } 066 067 public final int getTag() { 068 return TagConstants.SINGLETYPEIMPORTDECL; 069 } 070 071 public final void accept(Visitor v) { v.visitSingleTypeImportDecl(this); } 072 073 public final Object accept(VisitorArgResult v, Object o) {return v.visitSingleTypeImportDecl(this, o); } 074 075 public void check() { 076 super.check(); 077 this.typeName.check(); 078 } 079 080 //@ requires loc != javafe.util.Location.NULL; 081 //@ ensures \result != null; 082 public static SingleTypeImportDecl make(int loc, /*@ non_null @*/ TypeName typeName) { 083 //@ set I_will_establish_invariants_afterwards = true; 084 SingleTypeImportDecl result = new SingleTypeImportDecl(); 085 result.loc = loc; 086 result.typeName = typeName; 087 return result; 088 } 089 }