move JFlex to CE source
[fedora-idea.git] / tools / lexer / jflex-1.4 / examples / interpreter / Tdekllist.java
blob6f409a6a7829be3c7a1510e00f484df25303de59
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22 /**
23 * AST node for declaration lists of functions
24 */
25 class Tdekllist implements AST {
26 Tdekllist dekllist; // rest list (optional null)
27 Tdekl dekl; // declaration
29 public Tdekllist(Tdekllist p, Tdekl e) {
30 dekllist=p;
31 dekl=e;
34 public Tdekllist(Tdekl e) {
35 dekllist=null;
36 dekl=e;
39 public String toString() {
40 if (dekllist!=null)
41 return(dekllist+",\n"+dekl);
42 else
43 return(dekl.toString());
46 public void setSymtab(SymTab st) {
47 if (dekllist!=null)
48 dekllist.setSymtab(st);
49 dekl.setSymtab(st);
52 public void printSymtabs() {
53 if (dekllist!=null)
54 dekllist.printSymtabs();
55 dekl.printSymtabs();
58 public void checkcontext() {
59 if (dekllist!=null)
60 dekllist.checkcontext();
61 dekl.checkcontext(); // CoCo (DefFun,DefVar,Arity)
62 } // in function body
64 public void prepInterp(SymTab st) { // set pointers and indices
65 dekl.prepInterp(st);
66 if (dekllist!=null) dekllist.prepInterp(st);