001: /*=============================================================================
002: * Copyright Texas Instruments 2003. All Rights Reserved.
003: *
004: * This program is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2 of the License, or (at your option) any later version.
008: *
009: * This program is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: * $ProjectHeader: OSCRIPT 0.155 Fri, 20 Dec 2002 18:34:22 -0800 rclark $
019: */
020:
021: package oscript.visitor;
022:
023: import oscript.syntaxtree.*;
024: import oscript.translator.*;
025:
026: import java.io.*;
027:
028: /**
029: *
030: * @author Rob Clark
031: * @version 0.1
032: */
033: public class TranslatedTreeDumper extends TreeDumper {
034: public TranslatedTreeDumper() {
035: super ();
036: }
037:
038: public TranslatedTreeDumper(Writer o) {
039: super (o);
040: }
041:
042: public TranslatedTreeDumper(OutputStream o) {
043: super (o);
044: }
045:
046: /**
047: * <PRE>
048: * f0 -> Permissions(true)
049: * f1 -> "function"
050: * f2 -> <IDENTIFIER>
051: * f3 -> "("
052: * f4 -> ( Arglist() )?
053: * f5 -> ")"
054: * f6 -> ( "extends" PrimaryExpressionWithTrailingFxnCallExpList() FunctionCallExpressionList() )?
055: * f7 -> "{"
056: * f8 -> Program(true)
057: * f9 -> "}"
058: * </PRE>
059: */
060: public void visit(FunctionDeclaration n) {
061: FunctionDeclarationTranslator.translate(n).accept(this );
062: }
063:
064: /**
065: * <PRE>
066: * f0 -> "for"
067: * f1 -> "("
068: * f2 -> ( PreLoopStatement() )?
069: * f3 -> ";"
070: * f4 -> ( Expression() )?
071: * f5 -> ";"
072: * f6 -> ( Expression() )?
073: * f7 -> ")"
074: * f8 -> EvaluationUnit()
075: * </PRE>
076: */
077: public void visit(ForLoopStatement n) {
078: ForLoopStatementTranslator.translate(n).accept(this );
079: }
080:
081: /**
082: * <PRE>
083: * f0 -> "for"
084: * f1 -> "("
085: * f2 -> PreLoopStatement()
086: * f3 -> ":"
087: * f4 -> Expression()
088: * f5 -> ")"
089: * f6 -> EvaluationUnit()
090: * </PRE>
091: */
092: public void visit(CollectionForLoopStatement n) {
093: CollectionForLoopStatementTranslator.translate(n).accept(this );
094: }
095:
096: /**
097: * <PRE>
098: * f0 -> "'{"
099: * f1 -> Program(true)
100: * f2 -> "}"
101: * </PRE>
102: */
103: public void visit(ShorthandFunctionPrimaryPrefix n) {
104: ShorthandFunctionPrimaryPrefixTranslator.translate(n).accept(
105: this );
106: }
107: }
108:
109: /*
110: * Local Variables:
111: * tab-width: 2
112: * indent-tabs-mode: nil
113: * mode: java
114: * c-indentation-style: java
115: * c-basic-offset: 2
116: * eval: (c-set-offset 'substatement-open '0)
117: * eval: (c-set-offset 'case-label '+)
118: * eval: (c-set-offset 'inclass '+)
119: * eval: (c-set-offset 'inline-open '0)
120: * End:
121: */
|