xtc.tree

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 » Parser » Rats Parser Generators » xtc.tree 
xtc.tree
xtc's support for abstract syntax trees and for traversing them with visitors. This package defines the {@link xtc.tree.Node base class} for all abstract syntax tree nodes and the {@link xtc.tree.Visitor base class} for all visitors. It also defines a {@link xtc.tree.GNode generic node class}.

In contrast to the original visitor pattern, node visitors do not implement a fixed interface. Rather, the appropriate method is selected through reflection-based dynamic dispatch, based on the type of a node. On invocation of {@link xtc.tree.Visitor#dispatch}, the dynamic dispatch mechanism tries to find a method name visit() that takes either the specified node, any of its interfaces, or any of its superclaseses as its only argument. The search starts with the class of the node, then checks for all implemented interfaces, then for the superclass, then for all interfaces of the superclass, and so on until it reaches java.lang.Object, which is not considered.

For {@link xtc.tree.GNode generic nodes} the appropriate visit() method is selected based on the name of the generic node. For example, if the target name is Node, then the dynamic dispatch mechanism tries to locate a method visitNode(GNode). If no such method exists, the dynamic dispatch mechanism also tries to locate a visit(GNode) and visit(Node) method (in that order).

Note that to improve the performance of dynamic dispatch, our implementation uses a static method lookup cache that is not thread-safe. Source-to-source transformers thus cannot be multi-threaded.

Java Source File NameTypeComment
Annotation.javaClass The superclass of all annotations.
Attribute.javaClass A name/value pair.
Comment.javaClass A source code comment.
Formatting.javaClass An annotation capturing source code formatting.
GNode.javaClass A generic node in an abstract syntax tree.

A note on memory conservation: Generic nodes created through the GNode.create(String) or GNode.create(String,int) methods can have a variable number of children.

LineMarker.javaClass A line marker (as used by GCC).
LineupPrinter.javaClass A printer that guarantees that each Node is printed at the exact file, line, and column specified by its location.
Locatable.javaInterface The interface to objects with a source location.
Location.javaClass The location in a source file.
Node.javaClass A node in an abstract syntax tree or DAG.
ParseTreePrinter.javaClass Visitor to print parse trees.
ParseTreeStripper.javaClass Visitor to strip parse trees.
Pragma.javaClass A pragma.
Printer.javaClass A node pretty printing utility.
Relocator.javaClass Visitor to relocate an abstract syntax tree.
SourceIdentity.javaClass A source identity marker.
Token.javaClass A token.
Transducer.javaClass Visitor to convert trees of generic nodes into methods that programmatically create the trees.
TraversalException.javaClass The superclass of exceptions signaled during visitor dispatch.
Utility.javaClass The superclass of all utilities.
VisitingException.javaClass A visiting exception is thrown to indicate an exceptional condition while visiting a node.
Visitor.javaClass A node visitor.
VisitorException.javaClass A visitor exception is thrown when no appropriate visit() or process() method can be found.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.