001: //
002: // Generated by JTB 1.2.1
003: //
004:
005: package oscript.visitor;
006:
007: import oscript.syntaxtree.*;
008: import java.util.*;
009:
010: /**
011: * All Object visitors must implement this interface.
012: */
013: public interface ObjectVisitor {
014: //
015: // Object Auto class visitors
016: //
017: public Object visit(NodeList n, Object argu);
018:
019: public Object visit(NodeListOptional n, Object argu);
020:
021: public Object visit(NodeOptional n, Object argu);
022:
023: public Object visit(NodeSequence n, Object argu);
024:
025: public Object visit(NodeToken n, Object argu);
026:
027: //
028: // User-generated visitor methods below
029: //
030:
031: /**
032: * <PRE>
033: * f0 -> ( <UNIX_SELF_EXECUTABLE_COMMENT> )?
034: * f1 -> Program(false)
035: * f2 -> <EOF>
036: * </PRE>
037: */
038: public Object visit(ProgramFile n, Object argu);
039:
040: /**
041: * <PRE>
042: * f0 -> ( EvaluationUnit() )*
043: * </PRE>
044: */
045: public Object visit(Program n, Object argu);
046:
047: /**
048: * <PRE>
049: * f0 -> ScopeBlock()
050: * | VariableDeclarationBlock()
051: * | FunctionDeclaration()
052: * | TryStatement()
053: * | ForLoopStatement()
054: * | CollectionForLoopStatement()
055: * | WhileLoopStatement()
056: * | ConditionalStatement()
057: * | SynchronizedStatement()
058: * | ReturnStatement()
059: * | BreakStatement()
060: * | ContinueStatement()
061: * | ExpressionBlock()
062: * | ThrowBlock()
063: * | ImportBlock()
064: * | MixinBlock()
065: * | EvalBlock()
066: * </PRE>
067: */
068: public Object visit(EvaluationUnit n, Object argu);
069:
070: /**
071: * <PRE>
072: * f0 -> "{"
073: * f1 -> Program(false)
074: * f2 -> "}"
075: * </PRE>
076: */
077: public Object visit(ScopeBlock n, Object argu);
078:
079: /**
080: * <PRE>
081: * f0 -> VariableDeclaration()
082: * f1 -> ";"
083: * </PRE>
084: */
085: public Object visit(VariableDeclarationBlock n, Object argu);
086:
087: /**
088: * <PRE>
089: * f0 -> Expression()
090: * f1 -> ";"
091: * </PRE>
092: */
093: public Object visit(ExpressionBlock n, Object argu);
094:
095: /**
096: * <PRE>
097: * f0 -> "throw"
098: * f1 -> Expression()
099: * f2 -> ";"
100: * </PRE>
101: */
102: public Object visit(ThrowBlock n, Object argu);
103:
104: /**
105: * <PRE>
106:
107: * f0 -> "import"
108: * f1 -> Expression()
109: * f2 -> ";"
110: * </PRE>
111: */
112: public Object visit(ImportBlock n, Object argu);
113:
114: /**
115: * <PRE>
116:
117: * f0 -> "mixin"
118: * f1 -> Expression()
119: * f2 -> ";"
120: * </PRE>
121: */
122: public Object visit(MixinBlock n, Object argu);
123:
124: /**
125: * <PRE>
126:
127: * f0 -> "eval"
128: * f1 -> Expression()
129: * f2 -> ";"
130: * </PRE>
131: */
132: public Object visit(EvalBlock n, Object argu);
133:
134: /**
135: * <PRE>
136:
137: * f0 -> Permissions(true)
138: * f1 -> "var"
139: * f2 -> <IDENTIFIER>
140: * f3 -> ( "=" Expression() )?
141: * </PRE>
142: */
143: public Object visit(VariableDeclaration n, Object argu);
144:
145: /**
146: * <PRE>
147:
148: * f0 -> Permissions(true)
149: * f1 -> "function"
150: * f2 -> <IDENTIFIER>
151: * f3 -> "("
152: * f4 -> ( Arglist() )?
153: * f5 -> ")"
154: * f6 -> ( "extends" PrimaryExpressionWithTrailingFxnCallExpList() FunctionCallExpressionList() )?
155: * f7 -> "{"
156: * f8 -> Program(true)
157: * f9 -> "}"
158: * </PRE>
159: */
160: public Object visit(FunctionDeclaration n, Object argu);
161:
162: /**
163: * <PRE>
164: * f0 -> Permissions(false)
165: * f1 -> <IDENTIFIER>
166: * f2 -> ( "," Permissions(false) <IDENTIFIER> )*
167: * f3 -> ( "..." )?
168: * </PRE>
169: */
170: public Object visit(Arglist n, Object argu);
171:
172: /**
173: * <PRE>
174: * f0 -> "try"
175: * f1 -> EvaluationUnit()
176: * f2 -> ( "catch" "(" Expression() <IDENTIFIER> ")" EvaluationUnit() )*
177: * f3 -> ( "catch" "(" <IDENTIFIER> ")" EvaluationUnit() )?
178: * f4 -> ( "finally" EvaluationUnit() )?
179: * </PRE>
180: */
181: public Object visit(TryStatement n, Object argu);
182:
183: /**
184: * <PRE>
185:
186: * f0 -> "for"
187: * f1 -> "("
188: * f2 -> ( PreLoopStatement() )?
189: * f3 -> ";"
190: * f4 -> ( Expression() )?
191: * f5 -> ";"
192: * f6 -> ( Expression() )?
193: * f7 -> ")"
194: * f8 -> EvaluationUnit()
195: * </PRE>
196: */
197: public Object visit(ForLoopStatement n, Object argu);
198:
199: /**
200: * <PRE>
201:
202: * f0 -> "for"
203: * f1 -> "("
204: * f2 -> PreLoopStatement()
205: * f3 -> ":"
206: * f4 -> Expression()
207: * f5 -> ")"
208: * f6 -> EvaluationUnit()
209: * </PRE>
210: */
211: public Object visit(CollectionForLoopStatement n, Object argu);
212:
213: /**
214: * <PRE>
215: * f0 -> VariableDeclaration()
216: * | Expression()
217: * </PRE>
218: */
219: public Object visit(PreLoopStatement n, Object argu);
220:
221: /**
222: * <PRE>
223: * f0 -> "while"
224: * f1 -> "("
225: * f2 -> Expression()
226: * f3 -> ")"
227: * f4 -> EvaluationUnit()
228: * </PRE>
229: */
230: public Object visit(WhileLoopStatement n, Object argu);
231:
232: /**
233: * <PRE>
234: * f0 -> "if"
235: * f1 -> "("
236: * f2 -> Expression()
237: * f3 -> ")"
238: * f4 -> EvaluationUnit()
239: * f5 -> ( "else" EvaluationUnit() )?
240: * </PRE>
241: */
242: public Object visit(ConditionalStatement n, Object argu);
243:
244: /**
245: * <PRE>
246: * f0 -> "synchronized"
247: * f1 -> "("
248: * f2 -> Expression()
249: * f3 -> ")"
250: * f4 -> EvaluationUnit()
251: * </PRE>
252: */
253: public Object visit(SynchronizedStatement n, Object argu);
254:
255: /**
256: * <PRE>
257: * f0 -> "return"
258: * f1 -> ( Expression() )?
259: * f2 -> ";"
260: * </PRE>
261: */
262: public Object visit(ReturnStatement n, Object argu);
263:
264: /**
265: * <PRE>
266: * f0 -> "break"
267: * f1 -> ";"
268: * </PRE>
269: */
270: public Object visit(BreakStatement n, Object argu);
271:
272: /**
273: * <PRE>
274: * f0 -> "continue"
275: * f1 -> ";"
276: * </PRE>
277: */
278: public Object visit(ContinueStatement n, Object argu);
279:
280: /**
281: * <PRE>
282: * f0 -> AssignmentExpression()
283: * f1 -> ( "," AssignmentExpression() )*
284: * </PRE>
285: */
286: public Object visit(Expression n, Object argu);
287:
288: /**
289: * <PRE>
290: * f0 -> "("
291: * f1 -> ( FunctionCallExpressionListBody() )?
292: * f2 -> ")"
293: * </PRE>
294: */
295: public Object visit(FunctionCallExpressionList n, Object argu);
296:
297: /**
298: * <PRE>
299: * f0 -> AssignmentExpression()
300: * f1 -> ( "," AssignmentExpression() )*
301: * </PRE>
302: */
303: public Object visit(FunctionCallExpressionListBody n, Object argu);
304:
305: /**
306: * <PRE>
307: * f0 -> ConditionalExpression()
308: * f1 -> ( ( "=" | "+=" | "-=" | "*=" | "/=" | "%=" | ">>=" | "<<=" | ">>>=" | "&=" | "^=" | "|=" ) ConditionalExpression() )*
309: * </PRE>
310: */
311: public Object visit(AssignmentExpression n, Object argu);
312:
313: /**
314: * <PRE>
315: * f0 -> LogicalOrExpression()
316: * f1 -> ( "?" LogicalOrExpression() ":" LogicalOrExpression() )?
317: * </PRE>
318: */
319: public Object visit(ConditionalExpression n, Object argu);
320:
321: /**
322: * <PRE>
323: * f0 -> LogicalAndExpression()
324: * f1 -> ( "||" LogicalAndExpression() )*
325: * </PRE>
326: */
327: public Object visit(LogicalOrExpression n, Object argu);
328:
329: /**
330: * <PRE>
331: * f0 -> BitwiseOrExpression()
332: * f1 -> ( "&&" BitwiseOrExpression() )*
333: * </PRE>
334: */
335: public Object visit(LogicalAndExpression n, Object argu);
336:
337: /**
338: * <PRE>
339: * f0 -> BitwiseXorExpression()
340: * f1 -> ( "|" BitwiseXorExpression() )*
341: * </PRE>
342: */
343: public Object visit(BitwiseOrExpression n, Object argu);
344:
345: /**
346: * <PRE>
347: * f0 -> BitwiseAndExpression()
348: * f1 -> ( "^" BitwiseAndExpression() )*
349: * </PRE>
350: */
351: public Object visit(BitwiseXorExpression n, Object argu);
352:
353: /**
354: * <PRE>
355: * f0 -> EqualityExpression()
356: * f1 -> ( "&" EqualityExpression() )*
357: * </PRE>
358: */
359: public Object visit(BitwiseAndExpression n, Object argu);
360:
361: /**
362: * <PRE>
363: * f0 -> RelationalExpression()
364: * f1 -> ( ( "==" | "!=" ) RelationalExpression() )*
365: * </PRE>
366: */
367: public Object visit(EqualityExpression n, Object argu);
368:
369: /**
370: * <PRE>
371: * f0 -> ShiftExpression()
372: * f1 -> ( ( "<" | ">" | ">=" | "<=" | "instanceof" ) ShiftExpression() )*
373: * </PRE>
374: */
375: public Object visit(RelationalExpression n, Object argu);
376:
377: /**
378: * <PRE>
379: * f0 -> AdditiveExpression()
380: * f1 -> ( ( "<<" | ">>" | ">>>" ) AdditiveExpression() )*
381: * </PRE>
382: */
383: public Object visit(ShiftExpression n, Object argu);
384:
385: /**
386: * <PRE>
387: * f0 -> MultiplicativeExpression()
388: * f1 -> ( ( "+" | "-" ) MultiplicativeExpression() )*
389: * </PRE>
390: */
391: public Object visit(AdditiveExpression n, Object argu);
392:
393: /**
394: * <PRE>
395: * f0 -> UnaryExpression()
396: * f1 -> ( ( "*" | "/" | "%" ) UnaryExpression() )*
397: * </PRE>
398: */
399: public Object visit(MultiplicativeExpression n, Object argu);
400:
401: /**
402: * <PRE>
403: * f0 -> ( ( "++" | "--" | "+" | "-" | "~" | "!" ) )?
404: * f1 -> PostfixExpression()
405: * </PRE>
406: */
407: public Object visit(UnaryExpression n, Object argu);
408:
409: /**
410: * <PRE>
411: * f0 -> TypeExpression()
412: * f1 -> ( "++" | "--" )?
413: * </PRE>
414: */
415: public Object visit(PostfixExpression n, Object argu);
416:
417: /**
418: * <PRE>
419: * f0 -> AllocationExpression()
420: * | CastExpression()
421: * | PrimaryExpression()
422: * </PRE>
423: */
424: public Object visit(TypeExpression n, Object argu);
425:
426: /**
427: * <PRE>
428: * f0 -> "new"
429: * f1 -> PrimaryExpressionWithTrailingFxnCallExpList()
430: * f2 -> FunctionCallExpressionList()
431: * </PRE>
432: */
433: public Object visit(AllocationExpression n, Object argu);
434:
435: /**
436: * <PRE>
437: * f0 -> "("
438: * f1 -> PrimaryExpressionNotFunction()
439: * f2 -> ")"
440: * f3 -> PrimaryExpression()
441: * </PRE>
442: */
443: public Object visit(CastExpression n, Object argu);
444:
445: /**
446: * <PRE>
447: * f0 -> PrimaryPrefix()
448: * f1 -> ( PrimaryPostfix() )*
449: * </PRE>
450: */
451: public Object visit(PrimaryExpression n, Object argu);
452:
453: /**
454: * <PRE>
455: * f0 -> PrimaryPrefixNotFunction()
456: * f1 -> ( PrimaryPostfix() )*
457: * </PRE>
458: */
459: public Object visit(PrimaryExpressionNotFunction n, Object argu);
460:
461: /**
462: * <PRE>
463: * f0 -> PrimaryPrefix()
464: * f1 -> ( PrimaryPostfixWithTrailingFxnCallExpList() )*
465: * </PRE>
466: */
467: public Object visit(PrimaryExpressionWithTrailingFxnCallExpList n,
468: Object argu);
469:
470: /**
471: * <PRE>
472: * f0 -> PrimaryPrefixNotFunction()
473: * | FunctionPrimaryPrefix()
474: * | ShorthandFunctionPrimaryPrefix()
475: * </PRE>
476: */
477: public Object visit(PrimaryPrefix n, Object argu);
478:
479: /**
480: * <PRE>
481: * f0 -> ThisPrimaryPrefix()
482: * | SuperPrimaryPrefix()
483: * | CalleePrimaryPrefix()
484: * | ArrayDeclarationPrimaryPrefix()
485: * | IdentifierPrimaryPrefix()
486: * | ParenPrimaryPrefix()
487: * | Literal()
488: * </PRE>
489: */
490: public Object visit(PrimaryPrefixNotFunction n, Object argu);
491:
492: /**
493: * <PRE>
494: * f0 -> "this"
495: * </PRE>
496: */
497: public Object visit(ThisPrimaryPrefix n, Object argu);
498:
499: /**
500: * <PRE>
501: * f0 -> "super"
502: * </PRE>
503: */
504: public Object visit(SuperPrimaryPrefix n, Object argu);
505:
506: /**
507: * <PRE>
508:
509: * f0 -> "callee"
510: * </PRE>
511: */
512: public Object visit(CalleePrimaryPrefix n, Object argu);
513:
514: /**
515: * <PRE>
516: * f0 -> <IDENTIFIER>
517: * </PRE>
518: */
519: public Object visit(IdentifierPrimaryPrefix n, Object argu);
520:
521: /**
522: * <PRE>
523: * f0 -> "("
524: * f1 -> Expression()
525: * f2 -> ")"
526: * </PRE>
527: */
528: public Object visit(ParenPrimaryPrefix n, Object argu);
529:
530: /**
531: * <PRE>
532:
533: * f0 -> "function"
534: * f1 -> "("
535: * f2 -> ( Arglist() )?
536: * f3 -> ")"
537: * f4 -> ( "extends" PrimaryExpressionWithTrailingFxnCallExpList() FunctionCallExpressionList() )?
538: * f5 -> "{"
539: * f6 -> Program(true)
540: * f7 -> "}"
541: * </PRE>
542: */
543: public Object visit(FunctionPrimaryPrefix n, Object argu);
544:
545: /**
546: * <PRE>
547:
548: * f0 -> "'{"
549: * f1 -> Program(true)
550: * f2 -> "}"
551: * </PRE>
552: */
553: public Object visit(ShorthandFunctionPrimaryPrefix n, Object argu);
554:
555: /**
556: * <PRE>
557: * f0 -> "["
558: * f1 -> ( FunctionCallExpressionListBody() )?
559: * f2 -> "]"
560: * </PRE>
561: */
562: public Object visit(ArrayDeclarationPrimaryPrefix n, Object argu);
563:
564: /**
565: * <PRE>
566: * f0 -> FunctionCallPrimaryPostfix()
567: * | ArraySubscriptPrimaryPostfix()
568: * | ThisScopeQualifierPrimaryPostfix()
569: * | PropertyIdentifierPrimaryPostfix()
570: * </PRE>
571: */
572: public Object visit(PrimaryPostfix n, Object argu);
573:
574: /**
575: * <PRE>
576: * f0 -> ArraySubscriptPrimaryPostfix()
577: * | ThisScopeQualifierPrimaryPostfix()
578: * | PropertyIdentifierPrimaryPostfix()
579: * </PRE>
580: */
581: public Object visit(PrimaryPostfixWithTrailingFxnCallExpList n,
582: Object argu);
583:
584: /**
585: * <PRE>
586: * f0 -> FunctionCallExpressionList()
587: * </PRE>
588: */
589: public Object visit(FunctionCallPrimaryPostfix n, Object argu);
590:
591: /**
592: * <PRE>
593: * f0 -> "["
594: * f1 -> Expression()
595: * f2 -> ( ".." Expression() )?
596: * f3 -> "]"
597: * </PRE>
598: */
599: public Object visit(ArraySubscriptPrimaryPostfix n, Object argu);
600:
601: /**
602: * <PRE>
603: * f0 -> "."
604: * f1 -> <IDENTIFIER>
605: * </PRE>
606: */
607: public Object visit(PropertyIdentifierPrimaryPostfix n, Object argu);
608:
609: /**
610: * <PRE>
611: * f0 -> "."
612: * f1 -> "this"
613: * </PRE>
614: */
615: public Object visit(ThisScopeQualifierPrimaryPostfix n, Object argu);
616:
617: /**
618: * <PRE>
619: * f0 -> <INTEGER_LITERAL>
620: * | <FLOATING_POINT_LITERAL>
621: * | <STRING_LITERAL>
622: * | <REGEXP_LITERAL>
623: * | "true"
624: * | "false"
625: * | "null"
626: * | "undefined"
627: * </PRE>
628: */
629: public Object visit(Literal n, Object argu);
630:
631: /**
632: * <PRE>
633:
634: * f0 -> ( "static" | "const" | "private" | "protected" | "public" )*
635: * </PRE>
636: */
637: public Object visit(Permissions n, Object argu);
638:
639: }
|