Java Doc for JeanniePrinter.java in  » Parser » Rats-Parser-Generators » xtc » lang » jeannie » 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 » Parser » Rats Parser Generators » xtc.lang.jeannie 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   xtc.tree.Visitor
      xtc.lang.jeannie.JeanniePrinter

All known Subclasses:   xtc.lang.jeannie.DebuggerAstPrinter,
JeanniePrinter
public class JeanniePrinter extends Visitor (Code)
A pretty printer for Jeannie (pretty JNI). This is an example of combining two visitors (CPrinter and JavaPrinter). But it is slightly unusual in that those visitors don't call dispatch() on themselves for children directly; instead, they call it indirectly through Printer, which is not a visitor itself. TD 41 double-check that this takes care of precedence, dangling else, and such

Simplified abstract Jeannie grammar:

This grammar describes the kinds of AST nodes that can occur in a Jeannie AST; in addition, all AST nodes from the plain C and Java grammars that are not modified here can also occur. See JavaAstSimplifier for notation explanation.

Notation explanation
Whole = Part1 Part2 ... PartN the Whole consists of all the parts Parti
Whole = Part1 / Part2 / ... / PartN the Whole consists of one of the parts Parti
Super > Sub1, Sub2, ..., SubN any of the Subi can appear where a Super is expected
Super > {Pre1,Pre2,...,PreN}Sub shorthand for Super > Pre1Sub, Pre2Sub, ..., PreNSub
Super : Lit1, Lit2, ..., LitN shorthand for Super > "Lit1", "Lit2", ..., "LitN"
[Option] zero or one occurrences
Repetee* zero or more occurrences
Repetee+ one or more occurrences
"token" literal string token


Modifications to Java grammar
CompilationUnit = CDeclarations [PackageDeclaration] ImportDeclaration* JeannieJava.Declaration*
Block > JavaInJavaBlock, CInJavaBlock
JeannieJava.Expression > ..., CInJavaExpression
Modifications to C grammar
TranslationUnit = [JavaImports] ExternalDeclaration* Annotations
CompoundStatement > CInCBlock, JavaInCBlock
FunctionDeclarator = (ParameterTypeList / IdentifierList) JavaThrows
JeannieC.Statement > ..., JavaInCStatement, CancelStatement, CommitStatement, WithStatement
JeannieC.UnaryExpression > ..., JavaInCExpression
TypeSpecifier > ..., JavaType
New productions
JeannieFile > TranslationUnit, CompilationUnit
CDeclarations = ExternalDeclaration*
CInCBlock = LocalLabelDeclaration* JeannieC.DeclarationOrStatement* Annotations
CInJavaBlock = CInCBlock
CInJavaExpression = JeannieC.UnaryExpression
JavaImports = ImportDeclaration*
JavaInCBlock = JavaInJavaBlock
JavaInCExpression = JeannieJava.UnaryExpression
JavaInCStatement = TryStatement / SynchronizedStatement / ThrowStatement
JavaInJavaBlock = JeannieJava.DeclarationOrStatement*
JavaThrows = [ThrowsClause]
JavaType = QualifiedIdentifier
CancelStatement = JeannieC.PrimaryIdentifier
CommitStatement = JeannieC.PrimaryIdentifier
WithStatement = WithInitializer CInCBlock
WithInitializer > JeannieC.Declaration, JeannieC.AssignmentExpression

author:
   Martin Hirzel
version:
   $Revision: 1.6 $

Inner Class : enum TransitionKind

Field Summary
final protected  Printer_printer
    

Constructor Summary
public  JeanniePrinter(Printer printer, String language)
    

Method Summary
final  voidenterC(TransitionKind transitionKind)
    
final  voidenterJava(TransitionKind transitionKind)
    
final  voidexitC()
    
final  voidexitJava()
    
final public  voidvisit(Node n)
    
final public  voidvisitBlock(GNode n)
     Visit a Block > JavaInJavaBlock, CInJavaBlock.
final public  voidvisitCDeclarations(GNode n)
     Visit a CDeclarations = ExternalDeclaration*.
final public  voidvisitCInCBlock(GNode n)
     Visit a CInCBlock = LocalLabelDeclaration* JeannieC.DeclarationOrStatement* Annotations.
final public  voidvisitCInJavaBlock(GNode n)
     Visit a CInJavaBlock = CInCBlock.
final public  voidvisitCInJavaExpression(GNode n)
     Visit a CInJavaExpression = JeannieC.UnaryExpression.
final public  voidvisitCancelStatement(GNode n)
     Visit a CancelStatement = JeannieC.PrimaryIdentifier.
final public  voidvisitCommitStatement(GNode n)
     Visit a CommitStatement = JeannieC.PrimaryIdentifier.
final public  voidvisitCompilationUnit(GNode n)
     Visit a CompilationUnit = CDeclarations [PackageDeclaration] ImportDeclaration* JeannieJava.Declaration*.
final public  voidvisitCompoundStatement(GNode n)
     Visit a CompoundStatement > CInCBlock, JavaInCBlock.
final public  voidvisitFile(GNode n)
     Visit a File > TranslationUnit, CompilationUnit.
final public  voidvisitFunctionDeclarator(GNode n)
     Visit a FunctionDeclarator = (ParameterTypeList / IdentifierList) JavaThrows.
final public  voidvisitJavaImports(GNode n)
     Visit a JavaImports = ImportDeclaration*.
final public  voidvisitJavaInCBlock(GNode n)
     Visit a JavaInCBlock = JavaInJavaBlock.
final public  voidvisitJavaInCExpression(GNode n)
     Visit a JavaInCExpression = JeannieJava.UnaryExpression.
final public  voidvisitJavaInCStatement(GNode n)
     Visit a JavaInCStatement = TryStatement / SynchronizedStatement / ThrowStatement.
final public  voidvisitJavaInJavaBlock(GNode n)
     Visit a JavaInJavaBlock = JeannieJava.DeclarationOrStatement*.
final public  voidvisitJavaThrows(GNode n)
     Visit a JavaThrows = [ThrowsClause].
final public  voidvisitJavaType(GNode n)
     Visit a JavaType = QualifiedIdentifier.
final public  voidvisitTranslationUnit(GNode n)
     Visit a TranslationUnit = [JavaImports] ExternalDeclaration* Annotations.
final public  voidvisitWithStatement(GNode n)
     Visit a WithStatement = (JeannieC.Declaration / JeannieC.AssignmentExpression) CInCBlock.

Field Detail
_printer
final protected Printer _printer(Code)




Constructor Detail
JeanniePrinter
public JeanniePrinter(Printer printer, String language)(Code)




Method Detail
enterC
final void enterC(TransitionKind transitionKind)(Code)



enterJava
final void enterJava(TransitionKind transitionKind)(Code)



exitC
final void exitC()(Code)



exitJava
final void exitJava()(Code)



visit
final public void visit(Node n)(Code)



visitBlock
final public void visitBlock(GNode n)(Code)
Visit a Block > JavaInJavaBlock, CInJavaBlock.



visitCDeclarations
final public void visitCDeclarations(GNode n)(Code)
Visit a CDeclarations = ExternalDeclaration*.



visitCInCBlock
final public void visitCInCBlock(GNode n)(Code)
Visit a CInCBlock = LocalLabelDeclaration* JeannieC.DeclarationOrStatement* Annotations.



visitCInJavaBlock
final public void visitCInJavaBlock(GNode n)(Code)
Visit a CInJavaBlock = CInCBlock.



visitCInJavaExpression
final public void visitCInJavaExpression(GNode n)(Code)
Visit a CInJavaExpression = JeannieC.UnaryExpression.



visitCancelStatement
final public void visitCancelStatement(GNode n)(Code)
Visit a CancelStatement = JeannieC.PrimaryIdentifier.



visitCommitStatement
final public void visitCommitStatement(GNode n)(Code)
Visit a CommitStatement = JeannieC.PrimaryIdentifier.



visitCompilationUnit
final public void visitCompilationUnit(GNode n)(Code)
Visit a CompilationUnit = CDeclarations [PackageDeclaration] ImportDeclaration* JeannieJava.Declaration*.



visitCompoundStatement
final public void visitCompoundStatement(GNode n)(Code)
Visit a CompoundStatement > CInCBlock, JavaInCBlock.



visitFile
final public void visitFile(GNode n)(Code)
Visit a File > TranslationUnit, CompilationUnit.



visitFunctionDeclarator
final public void visitFunctionDeclarator(GNode n)(Code)
Visit a FunctionDeclarator = (ParameterTypeList / IdentifierList) JavaThrows.



visitJavaImports
final public void visitJavaImports(GNode n)(Code)
Visit a JavaImports = ImportDeclaration*.



visitJavaInCBlock
final public void visitJavaInCBlock(GNode n)(Code)
Visit a JavaInCBlock = JavaInJavaBlock.



visitJavaInCExpression
final public void visitJavaInCExpression(GNode n)(Code)
Visit a JavaInCExpression = JeannieJava.UnaryExpression.



visitJavaInCStatement
final public void visitJavaInCStatement(GNode n)(Code)
Visit a JavaInCStatement = TryStatement / SynchronizedStatement / ThrowStatement.



visitJavaInJavaBlock
final public void visitJavaInJavaBlock(GNode n)(Code)
Visit a JavaInJavaBlock = JeannieJava.DeclarationOrStatement*.



visitJavaThrows
final public void visitJavaThrows(GNode n)(Code)
Visit a JavaThrows = [ThrowsClause].



visitJavaType
final public void visitJavaType(GNode n)(Code)
Visit a JavaType = QualifiedIdentifier.



visitTranslationUnit
final public void visitTranslationUnit(GNode n)(Code)
Visit a TranslationUnit = [JavaImports] ExternalDeclaration* Annotations.



visitWithStatement
final public void visitWithStatement(GNode n)(Code)
Visit a WithStatement = (JeannieC.Declaration / JeannieC.AssignmentExpression) CInCBlock.



Methods inherited from xtc.tree.Visitor
public Object dispatch(Node node)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.