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 javafe.ast;
014
015 import javafe.util.Assert;
016 import javafe.util.Location;
017 import javafe.util.ErrorSet;
018
019 // Convention: unless otherwise noted, integer fields named "loc" refer
020 // to the location of the first character of the syntactic unit
021
022
023 /**
024 * Represents a ObjectDesignator of the form "super . ".
025 * Is created only by the parser, not by name resolution.
026 */
027
028 public class SuperObjectDesignator extends ObjectDesignator
029 {
030 //@ invariant locSuper != javafe.util.Location.NULL;
031 public int locSuper;
032
033
034 //@ public represents startLoc <- locSuper;
035 public /*@ pure @*/ int getStartLoc() { return locSuper; }
036 public Type type;
037 public Type type() { return type; }
038
039
040 // Generated boilerplate constructors:
041
042 //@ ensures this.locDot == locDot;
043 //@ ensures this.locSuper == locSuper;
044 protected SuperObjectDesignator(int locDot, int locSuper) {
045 super(locDot);
046 this.locSuper = locSuper;
047 }
048
049 // Generated boilerplate methods:
050
051 public final int childCount() {
052 return 0;
053 }
054
055 public final Object childAt(int index) {
056 /*throws IndexOutOfBoundsException*/
057 if (index < 0)
058 throw new IndexOutOfBoundsException("AST child index " + index);
059 int indexPre = index;
060
061 int sz;
062
063 throw new IndexOutOfBoundsException("AST child index " + indexPre);
064 } //@ nowarn Exception;
065
066 public final /*@non_null*/String toString() {
067 return "[SuperObjectDesignator"
068 + " locDot = " + this.locDot
069 + " locSuper = " + this.locSuper
070 + "]";
071 }
072
073 public final int getTag() {
074 return TagConstants.SUPEROBJECTDESIGNATOR;
075 }
076
077 public final void accept(Visitor v) { v.visitSuperObjectDesignator(this); }
078
079 public final Object accept(VisitorArgResult v, Object o) {return v.visitSuperObjectDesignator(this, o); }
080
081 public void check() {
082 super.check();
083 }
084
085 //@ requires locDot != javafe.util.Location.NULL;
086 //@ requires locSuper != javafe.util.Location.NULL;
087 //@ ensures \result != null;
088 public static SuperObjectDesignator make(int locDot, int locSuper) {
089 SuperObjectDesignator result = new SuperObjectDesignator(locDot, locSuper);
090 return result;
091 }
092 }