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


java.lang.Object
   xtc.tree.Visitor
      xtc.type.SourcePrinter

SourcePrinter
public class SourcePrinter extends Visitor (Code)
A visitor to print types in C-like source form. This visitor's functionality is available through the SourcePrinter.print(Type) and SourcePrinter.print(Type,String) methods.
author:
   Robert Grimm
version:
   $Revision: 1.5 $


Field Summary
protected  Typebase
     The base type.
protected  List<Type>derived
     The list of derived types, with the outer-most type first.
protected  Stringname
     The optional variable name.
protected  booleanneedsSpace
     The flag for whether the next token needs to be preceded by a space.
final protected  Printerprinter
     The printer utility.

Constructor Summary
public  SourcePrinter(Printer printer)
     Create a new source printer.

Method Summary
protected  voidaddDerived(Type type)
     Add the specified type to the list of derived types.
public static  booleanhasAttributes(Type type)
     Determine whether the specified type or any wrapped types have any printable attributes.
Parameters:
  type - The type.
public static  booleanisPrintable(Attribute att)
     Determine whether the specified attribute is printable.
Parameters:
  att - The attribute.
public  voidprint(Type type)
     Print the specified type.
public  voidprint(Type type, String variable)
     Print the specified type and variable as a declaration.
protected  voidprintArray(Type type)
     Print the specified array type.
protected  voidprintAttributes(Type type)
     Print the attributes for the specified type and any wrapped types.
protected  voidprintDerived()
     Emit any derived types.
protected  voidprintFunction(Type type)
     Print the specified function type.
protected  voidprintPointer(Type type)
     Print the specified pointer type.
protected  voidsetVariable(String variable)
     Set the variable name.
protected  voidspace()
     Emit a space.
public  voidvisit(Attribute att)
     Print the specified attribute.
public  voidvisit(VoidT t)
     Print the specified void type.
public  voidvisit(NumberT t)
     Print the specified number type.
public  voidvisit(StructT t)
     Print the specified struct type.
public  voidvisit(UnionT t)
     Print the specified union type.
public  voidvisit(EnumT t)
     Print the specified enum type.
public  voidvisit(ClassOrInterfaceT t)
     Print the specified class or interface type.
public  voidvisit(AliasT t)
     Print the specified alias type.
public  voidvisit(InternalT t)
     Print the specified internal type.
public  voidvisit(PointerT t)
     Print the specified pointer type.
public  voidvisit(ArrayT t)
     Print the specified array type.
public  voidvisit(FunctionT t)
     Print the specified function type.
public  voidvisit(VariableT t)
     Print the specified variable type.
public  voidvisit(WrappedT t)
     Print the specified wrapped type.
public  voidvisit(ErrorT t)
     Print the specified error type.

Field Detail
base
protected Type base(Code)
The base type.



derived
protected List<Type> derived(Code)
The list of derived types, with the outer-most type first.



name
protected String name(Code)
The optional variable name.



needsSpace
protected boolean needsSpace(Code)
The flag for whether the next token needs to be preceded by a space.



printer
final protected Printer printer(Code)
The printer utility.




Constructor Detail
SourcePrinter
public SourcePrinter(Printer printer)(Code)
Create a new source printer. Note that this visitor is not registered with the printer utility.
Parameters:
  printer - The printer utility.




Method Detail
addDerived
protected void addDerived(Type type)(Code)
Add the specified type to the list of derived types.
Parameters:
  type - The type.



hasAttributes
public static boolean hasAttributes(Type type)(Code)
Determine whether the specified type or any wrapped types have any printable attributes.
Parameters:
  type - The type. true if the type or any wrapped types haveany printable attributes.



isPrintable
public static boolean isPrintable(Attribute att)(Code)
Determine whether the specified attribute is printable.
Parameters:
  att - The attribute. true if the attribute is printable.



print
public void print(Type type)(Code)
Print the specified type. If the specified type contains a VariableT , this method prints a declaration for that type's name. Otherwise, it prints an abstract declaration. Note that the printed declaration is not followed by any delimiter such as a semicolon.
Parameters:
  type - The type.
throws:
  IllegalArgumentException - Signals that the specified typecontains an error type or more than one field, member,parameter, or variable type.



print
public void print(Type type, String variable)(Code)
Print the specified type and variable as a declaration. Note that the printed declaration is not followed by any delimiter such as a semicolon.
Parameters:
  type - The type.
Parameters:
  variable - The variable name.
throws:
  IllegalArgumentException - Signals that the specified typecontains a field, member, parameter, variable, or error type.



printArray
protected void printArray(Type type)(Code)
Print the specified array type.
Parameters:
  type - The array type, which may be wrapped.



printAttributes
protected void printAttributes(Type type)(Code)
Print the attributes for the specified type and any wrapped types.
Parameters:
  type - The type.



printDerived
protected void printDerived()(Code)
Emit any derived types. This method also prints the variable name, if it is available. It must be invoked after printing a non-derived type.



printFunction
protected void printFunction(Type type)(Code)
Print the specified function type.
Parameters:
  type - The function type, which may be wrapped.



printPointer
protected void printPointer(Type type)(Code)
Print the specified pointer type.
Parameters:
  type - The pointer type, which may be wrapped



setVariable
protected void setVariable(String variable)(Code)
Set the variable name.
Parameters:
  variable - The variable name.
throws:
  IllegalArgumentException - Signals a duplicate variablename.



space
protected void space()(Code)
Emit a space. If the SourcePrinter.needsSpace flag is set, this method emits the space and clears the flag.



visit
public void visit(Attribute att)(Code)
Print the specified attribute.



visit
public void visit(VoidT t)(Code)
Print the specified void type.



visit
public void visit(NumberT t)(Code)
Print the specified number type.



visit
public void visit(StructT t)(Code)
Print the specified struct type.



visit
public void visit(UnionT t)(Code)
Print the specified union type.



visit
public void visit(EnumT t)(Code)
Print the specified enum type.



visit
public void visit(ClassOrInterfaceT t)(Code)
Print the specified class or interface type.



visit
public void visit(AliasT t)(Code)
Print the specified alias type.



visit
public void visit(InternalT t)(Code)
Print the specified internal type.



visit
public void visit(PointerT t)(Code)
Print the specified pointer type.



visit
public void visit(ArrayT t)(Code)
Print the specified array type.



visit
public void visit(FunctionT t)(Code)
Print the specified function type.



visit
public void visit(VariableT t)(Code)
Print the specified variable type.



visit
public void visit(WrappedT t)(Code)
Print the specified wrapped type.



visit
public void visit(ErrorT t)(Code)
Print the specified error type.



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.