Source Code Cross Referenced for DumpVisitor.java in  » Net » Terracotta » com » tc » aspectwerkz » expression » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Terracotta » com.tc.aspectwerkz.expression 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
003:         */
004:        package com.tc.aspectwerkz.expression;
005:
006:        import com.tc.aspectwerkz.expression.ast.*;
007:
008:        /**
009:         * TODO: do we need that, there is a dump() method in jjtree API
010:         *
011:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
012:         * @author Michael Nascimento
013:         */
014:        public class DumpVisitor implements  ExpressionParserVisitor {
015:            private Node m_root;
016:
017:            private int indent = 0;
018:
019:            private DumpVisitor(final Node root) {
020:                m_root = root;
021:            }
022:
023:            public static void dumpAST(final Node root) {
024:                DumpVisitor dumper = new DumpVisitor(root);
025:                dumper.visit((SimpleNode) dumper.m_root, null);
026:            }
027:
028:            public Object visit(SimpleNode node, Object data) {
029:                System.out.println(indentString() + node);
030:                ++indent;
031:                data = node.jjtGetChild(0).jjtAccept(this , data);
032:                --indent;
033:                return data;
034:            }
035:
036:            public Object visit(ASTRoot node, Object data) {
037:                System.out.println(indentString() + node);
038:                ++indent;
039:                data = node.jjtGetChild(0).jjtAccept(this , data);
040:                --indent;
041:                return data;
042:            }
043:
044:            public Object visit(ASTExpression node, Object data) {
045:                System.out.println(indentString() + node);
046:                ++indent;
047:                data = node.jjtGetChild(0).jjtAccept(this , data);
048:                --indent;
049:                return data;
050:            }
051:
052:            public Object visit(ASTOr node, Object data) {
053:                System.out.println(indentString() + node);
054:                ++indent;
055:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
056:                    data = node.jjtGetChild(i).jjtAccept(this , data);
057:                }
058:                --indent;
059:                return data;
060:            }
061:
062:            public Object visit(ASTAnd node, Object data) {
063:                System.out.println(indentString() + node);
064:                ++indent;
065:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
066:                    data = node.jjtGetChild(i).jjtAccept(this , data);
067:                }
068:                --indent;
069:                return data;
070:            }
071:
072:            public Object visit(ASTNot node, Object data) {
073:                System.out.println(indentString() + node);
074:                ++indent;
075:                data = node.jjtGetChild(0).jjtAccept(this , data);
076:                --indent;
077:                return data;
078:            }
079:
080:            public Object visit(ASTExecution node, Object data) {
081:                System.out.println(indentString() + node);
082:                ++indent;
083:                data = node.jjtGetChild(0).jjtAccept(this , data);
084:                --indent;
085:                return data;
086:            }
087:
088:            public Object visit(ASTCall node, Object data) {
089:                System.out.println(indentString() + node);
090:                ++indent;
091:                data = node.jjtGetChild(0).jjtAccept(this , data);
092:                --indent;
093:                return data;
094:            }
095:
096:            public Object visit(ASTSet node, Object data) {
097:                System.out.println(indentString() + node);
098:                ++indent;
099:                data = node.jjtGetChild(0).jjtAccept(this , data);
100:                --indent;
101:                return data;
102:            }
103:
104:            public Object visit(ASTGet node, Object data) {
105:                System.out.println(indentString() + node);
106:                ++indent;
107:                data = node.jjtGetChild(0).jjtAccept(this , data);
108:                --indent;
109:                return data;
110:            }
111:
112:            public Object visit(ASTHandler node, Object data) {
113:                System.out.println(indentString() + node);
114:                ++indent;
115:                data = node.jjtGetChild(0).jjtAccept(this , data);
116:                --indent;
117:                return data;
118:            }
119:
120:            public Object visit(ASTWithin node, Object data) {
121:                System.out.println(indentString() + node);
122:                ++indent;
123:                data = node.jjtGetChild(0).jjtAccept(this , data);
124:                --indent;
125:                return data;
126:            }
127:
128:            public Object visit(ASTWithinCode node, Object data) {
129:                System.out.println(indentString() + node);
130:                ++indent;
131:                data = node.jjtGetChild(0).jjtAccept(this , data);
132:                --indent;
133:                return data;
134:            }
135:
136:            public Object visit(ASTStaticInitialization node, Object data) {
137:                System.out.println(indentString() + node);
138:                ++indent;
139:                data = node.jjtGetChild(0).jjtAccept(this , data);
140:                --indent;
141:                return data;
142:            }
143:
144:            public Object visit(ASTIf node, Object data) {
145:                System.out.println(indentString() + "if()");
146:                return data;
147:            }
148:
149:            public Object visit(ASTCflow node, Object data) {
150:                System.out.println(indentString() + node);
151:                ++indent;
152:                data = node.jjtGetChild(0).jjtAccept(this , data);
153:                --indent;
154:                return data;
155:            }
156:
157:            public Object visit(ASTCflowBelow node, Object data) {
158:                System.out.println(indentString() + node);
159:                ++indent;
160:                data = node.jjtGetChild(0).jjtAccept(this , data);
161:                --indent;
162:                return data;
163:            }
164:
165:            public Object visit(ASTHasMethod node, Object data) {
166:                System.out.println(indentString() + node);
167:                ++indent;
168:                data = node.jjtGetChild(0).jjtAccept(this , data);
169:                --indent;
170:                return data;
171:            }
172:
173:            public Object visit(ASTHasField node, Object data) {
174:                System.out.println(indentString() + node);
175:                ++indent;
176:                data = node.jjtGetChild(0).jjtAccept(this , data);
177:                --indent;
178:                return data;
179:            }
180:
181:            public Object visit(ASTTarget node, Object data) {
182:                System.out.println(indentString() + node);
183:                ++indent;
184:                System.out.println(node.getIdentifier());
185:                --indent;
186:                return data;
187:            }
188:
189:            public Object visit(ASTThis node, Object data) {
190:                System.out.println(indentString() + node);
191:                ++indent;
192:                System.out.println(node.getIdentifier());
193:                --indent;
194:                return data;
195:            }
196:
197:            public Object visit(ASTClassPattern node, Object data) {
198:                System.out.println(indentString() + node);
199:                ++indent;
200:                int nr = node.jjtGetNumChildren();
201:                for (int i = 0; i < nr; i++) {
202:                    data = node.jjtGetChild(i).jjtAccept(this , data);
203:                }
204:                --indent;
205:                return data;
206:            }
207:
208:            public Object visit(ASTMethodPattern node, Object data) {
209:                System.out.println(indentString() + node);
210:                ++indent;
211:                int nr = node.jjtGetNumChildren();
212:                for (int i = 0; i < nr; i++) {
213:                    data = node.jjtGetChild(i).jjtAccept(this , data);
214:                }
215:                --indent;
216:                return data;
217:            }
218:
219:            public Object visit(ASTConstructorPattern node, Object data) {
220:                System.out.println(indentString() + node);
221:                ++indent;
222:                int nr = node.jjtGetNumChildren();
223:                for (int i = 0; i < nr; i++) {
224:                    data = node.jjtGetChild(i).jjtAccept(this , data);
225:                }
226:                --indent;
227:                return data;
228:            }
229:
230:            public Object visit(ASTFieldPattern node, Object data) {
231:                System.out.println(indentString() + node);
232:                ++indent;
233:                int nr = node.jjtGetNumChildren();
234:                for (int i = 0; i < nr; i++) {
235:                    data = node.jjtGetChild(i).jjtAccept(this , data);
236:                }
237:                --indent;
238:                return data;
239:            }
240:
241:            public Object visit(ASTPointcutReference node, Object data) {
242:                System.out.println(indentString() + node);
243:                return data;
244:            }
245:
246:            public Object visit(ASTParameter node, Object data) {
247:                System.out.println(indentString() + node);
248:                return data;
249:            }
250:
251:            public Object visit(ASTArgs node, Object data) {
252:                System.out.println(indentString() + node);
253:                ++indent;
254:                if (node.jjtGetNumChildren() > 0) {
255:                    data = node.jjtGetChild(0).jjtAccept(this , data);
256:                }
257:                --indent;
258:                return data;
259:            }
260:
261:            public Object visit(ASTArgParameter node, Object data) {
262:                System.out.println(indentString() + node);
263:                return data;
264:            }
265:
266:            public Object visit(ASTAttribute node, Object data) {
267:                System.out.println(indentString() + node);
268:                return data;
269:            }
270:
271:            public Object visit(ASTModifier node, Object data) {
272:                System.out.println(indentString() + node);
273:                return data;
274:            }
275:
276:            private String indentString() {
277:                StringBuffer sb = new StringBuffer();
278:                for (int i = 0; i < indent; ++i) {
279:                    sb.append(" ");
280:                }
281:                return sb.toString();
282:            }
283:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.