move JFlex to CE source
[fedora-idea.git] / tools / lexer / jflex-1.4 / examples / interpreter / Texp.java
blob8c4ef9460d9ab73f497316fcccfe93388ffe288c
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 an integer expression.
25 * The non terminal exp is the sum of multiple variants and
26 * therefore modeled as an abstract class.
28 * The interpretation function <tt>interpret</tt> is called with
29 * valuations of input variables <tt>in</tt> and parameters
30 * <tt>par</tt>. Before interpret can be called, pointers
31 * and variable indices must be set with <tt>prepInterp</tt>.
32 */
33 abstract class Texp implements AST {
34 // test context conditions (DefFun,DefVar,Arity)
35 abstract public void checkcontext(SymTab st);
37 // set pointers and indices for variables and functions
38 abstract public void prepInterp(SymTab st);
40 // interpretation
41 abstract public int interpret(int[] in, int[] par);