001: /*
002: * @(#)Visitor.java 1.3 05/02/17
003: *
004: * Copyright (c) 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
005: *
006: * See the file "LICENSE.txt" for information on usage and redistribution
007: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
008: */
009: package pnuts.lang;
010:
011: /**
012: * This is the interface of Visit operations for a syntax tree.
013: *
014: * @see pnuts.lang.Pnuts#accept(pnuts.lang.Visitor, pnuts.lang.Context)
015: * @see pnuts.lang.PnutsFunction#accept(int, pnuts.lang.Visitor,
016: * pnuts.lang.Context)
017: */
018: public interface Visitor {
019: public Object start(SimpleNode node, Context context);
020:
021: public Object startSet(SimpleNode node, Context context);
022:
023: public Object expressionList(SimpleNode node, Context context);
024:
025: public Object idNode(SimpleNode node, Context context);
026:
027: public Object global(SimpleNode node, Context context);
028:
029: public Object arrayType(SimpleNode node, Context context);
030:
031: public Object castExpression(SimpleNode node, Context context);
032:
033: public Object listElements(SimpleNode node, Context context);
034:
035: public Object classNode(SimpleNode node, Context context);
036:
037: public Object className(SimpleNode node, Context context);
038:
039: public Object indexNode(SimpleNode node, Context context);
040:
041: public Object rangeNode(SimpleNode node, Context context);
042:
043: public Object methodNode(SimpleNode node, Context context);
044:
045: public Object staticMethodNode(SimpleNode node, Context context);
046:
047: public Object memberNode(SimpleNode node, Context context);
048:
049: public Object staticMemberNode(SimpleNode node, Context context);
050:
051: public Object applicationNode(SimpleNode node, Context context);
052:
053: public Object integerNode(SimpleNode node, Context context);
054:
055: public Object floatingNode(SimpleNode node, Context context);
056:
057: public Object characterNode(SimpleNode node, Context context);
058:
059: public Object stringNode(SimpleNode node, Context context);
060:
061: public Object trueNode(SimpleNode node, Context context);
062:
063: public Object falseNode(SimpleNode node, Context context);
064:
065: public Object nullNode(SimpleNode node, Context context);
066:
067: public Object assignment(SimpleNode node, Context context);
068:
069: public Object assignmentTA(SimpleNode node, Context context);
070:
071: public Object assignmentMA(SimpleNode node, Context context);
072:
073: public Object assignmentDA(SimpleNode node, Context context);
074:
075: public Object assignmentPA(SimpleNode node, Context context);
076:
077: public Object assignmentSA(SimpleNode node, Context context);
078:
079: public Object assignmentLA(SimpleNode node, Context context);
080:
081: public Object assignmentRA(SimpleNode node, Context context);
082:
083: public Object assignmentRAA(SimpleNode node, Context context);
084:
085: public Object assignmentAA(SimpleNode node, Context context);
086:
087: public Object assignmentEA(SimpleNode node, Context context);
088:
089: public Object assignmentOA(SimpleNode node, Context context);
090:
091: public Object orNode(SimpleNode node, Context context);
092:
093: public Object andNode(SimpleNode node, Context context);
094:
095: public Object xorNode(SimpleNode node, Context context);
096:
097: public Object equalNode(SimpleNode node, Context context);
098:
099: public Object notEqNode(SimpleNode node, Context context);
100:
101: public Object instanceof Expression(SimpleNode node, Context context);
102:
103: public Object ltNode(SimpleNode node, Context context);
104:
105: public Object gtNode(SimpleNode node, Context context);
106:
107: public Object leNode(SimpleNode node, Context context);
108:
109: public Object geNode(SimpleNode node, Context context);
110:
111: public Object shiftLeftNode(SimpleNode node, Context context);
112:
113: public Object shiftRightNode(SimpleNode node, Context context);
114:
115: public Object shiftArithmeticNode(SimpleNode node, Context context);
116:
117: public Object addNode(SimpleNode node, Context context);
118:
119: public Object subtractNode(SimpleNode node, Context context);
120:
121: public Object multNode(SimpleNode node, Context context);
122:
123: public Object divideNode(SimpleNode node, Context context);
124:
125: public Object modNode(SimpleNode node, Context context);
126:
127: public Object negativeNode(SimpleNode node, Context context);
128:
129: public Object preIncrNode(SimpleNode node, Context context);
130:
131: public Object preDecrNode(SimpleNode node, Context context);
132:
133: public Object logAndNode(SimpleNode node, Context context);
134:
135: public Object logOrNode(SimpleNode node, Context context);
136:
137: public Object logNotNode(SimpleNode node, Context context);
138:
139: public Object notNode(SimpleNode node, Context context);
140:
141: public Object postIncrNode(SimpleNode node, Context context);
142:
143: public Object postDecrNode(SimpleNode node, Context context);
144:
145: public Object breakNode(SimpleNode node, Context context);
146:
147: public Object continueNode(SimpleNode node, Context context);
148:
149: public Object returnNode(SimpleNode node, Context context);
150:
151: public Object yieldNode(SimpleNode node, Context context);
152:
153: public Object blockNode(SimpleNode node, Context context);
154:
155: public Object ifStatement(SimpleNode node, Context context);
156:
157: public Object whileStatement(SimpleNode node, Context context);
158:
159: public Object doStatement(SimpleNode node, Context context);
160:
161: public Object forStatement(SimpleNode node, Context context);
162:
163: public Object foreachStatement(SimpleNode node, Context context);
164:
165: public Object switchStatement(SimpleNode node, Context context);
166:
167: public Object switchBlock(SimpleNode node, Context context);
168:
169: public Object functionStatement(SimpleNode node, Context context);
170:
171: public Object catchNode(SimpleNode node, Context context);
172:
173: public Object throwNode(SimpleNode node, Context context);
174:
175: public Object catchBlock(SimpleNode node, Context context);
176:
177: public Object finallyNode(SimpleNode node, Context context);
178:
179: public Object packageNode(SimpleNode node, Context context);
180:
181: public Object importNode(SimpleNode node, Context context);
182:
183: public Object tryStatement(SimpleNode node, Context context);
184:
185: public Object newNode(SimpleNode node, Context context);
186:
187: public Object mapNode(SimpleNode node, Context context);
188:
189: public Object ternary(SimpleNode node, Context context);
190:
191: public Object classScript(SimpleNode node, Context context);
192:
193: public Object classDef(SimpleNode node, Context context);
194:
195: public Object classDefBody(SimpleNode node, Context context);
196:
197: public Object methodDef(SimpleNode node, Context context);
198:
199: public Object beanDef(SimpleNode node, Context context);
200: }
|