[25584] | 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
---|
| 2 | * Copyright (C) 2001 Gerwin Klein <[email protected]> *
|
---|
| 3 | * Copyright (C) 2001 Bernhard Rumpe <[email protected]> *
|
---|
| 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 functions.
|
---|
| 24 | *
|
---|
| 25 | * Contains arity and reference to location of definition
|
---|
| 26 | */
|
---|
| 27 | class STEfun extends SymtabEntry {
|
---|
| 28 | int arity;
|
---|
| 29 | Tdekl dekl; // location of definition
|
---|
| 30 |
|
---|
| 31 | public STEfun(String f, Tdekl d, int a) {
|
---|
| 32 | super(f);
|
---|
| 33 | dekl=d;
|
---|
| 34 | arity=a;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | public int kind() {
|
---|
| 38 | return SymtabEntry.FUN;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | public String toString() {
|
---|
| 42 | return "function "+name+", arity "+arity;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public int arity() {
|
---|
| 46 | return arity;
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | public Tdekl getDekl() {
|
---|
| 50 | return dekl;
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 |
|
---|