KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > STEvar


1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright (C) 2001 Gerwin Klein <lsf@jflex.de> *
3  * Copyright (C) 2001 Bernhard Rumpe <rumpe@in.tum.de> *
4  * All rights reserved. *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License. See the file *
8  * COPYRIGHT for more information. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License along *
16  * with this program; if not, write to the Free Software Foundation, Inc., *
17  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
18  * *
19  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

20
21
22 /**
23  * Symbol table entry for variables.
24  *
25  * Contains index in the parameter list and a flag if it
26  * is an input variable.
27  */

28 class STEvar extends SymtabEntry {
29   boolean is_input;
30   int index;
31
32   public STEvar(String JavaDoc v, boolean ii, int ind) {
33     super(v);
34     is_input=ii;
35     index=ind;
36   }
37
38   public int kind() {
39     return SymtabEntry.VAR;
40   }
41
42   public String JavaDoc toString() {
43     if (is_input)
44       return "input var "+name+" ("+index+")";
45     else
46       return "parameter "+name+" ("+index+")";
47   }
48
49   public int getIndex() {
50     return index;
51   }
52
53   public boolean isInput() {
54     return is_input;
55   }
56 }
57
58
Popular Tags