01: /**
02: * MVEL (The MVFLEX Expression Language)
03: *
04: * Copyright (C) 2007 Christopher Brock, MVFLEX/Valhalla Project and the Codehaus
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: */package org.mvel.util;
19:
20: import org.mvel.ast.ASTNode;
21:
22: import java.io.Serializable;
23:
24: /**
25: * The ASTIterator interface defines the functionality required by the enginer, for compiletime and runtime
26: * operations. Unlike other script implementations, MVEL does not use a completely normalized AST tree for
27: * it's execution. Instead, nodes are organized into a linear order and delivered via this iterator interface,
28: * much like bytecode instructions.
29: */
30: public interface ASTIterator extends Serializable {
31: public void reset();
32:
33: public ASTNode nextNode();
34:
35: public void skipNode();
36:
37: public ASTNode peekNext();
38:
39: public ASTNode peekNode();
40:
41: public ASTNode peekLast();
42:
43: // public boolean peekNextTokenFlags(int flags);
44: public void back();
45:
46: public ASTNode nodesBack(int offset);
47:
48: public boolean hasMoreNodes();
49:
50: public String showNodeChain();
51:
52: public ASTNode firstNode();
53:
54: public int size();
55:
56: public int index();
57:
58: public void finish();
59:
60: public void addTokenNode(ASTNode node);
61:
62: public void addTokenNode(ASTNode node1, ASTNode node2);
63:
64: }
|