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


java.lang.Object
   xtc.util.Tool

All known Subclasses:   xtc.lang.FactoryFactory,  xtc.lang.jeannie.Jeannie,  xtc.typical.Typical,  xtc.lang.jeannie.Preprocessor,  xtc.lang.TypedLambda,  xtc.lang.p2.Overlog,  xtc.xform.Driver,  xtc.lang.Java,  xtc.parser.Rats,  xtc.lang.C,
Tool
abstract public class Tool (Code)
The superclass of all tools.
author:
   Robert Grimm
version:
   $Revision: 1.26 $


Field Summary
final protected  Runtimeruntime
     The runtime.

Constructor Summary
public  Tool()
     Create a new tool.

Method Summary
public  voiddiagnose()
     Print tool diagnostics.
public  StringgetCopy()
     Get this tool's copyright.
public  StringgetExplanation()
     Get this tool's explanation.
abstract public  StringgetName()
     Get this tool's name.
public  StringgetVersion()
     Get this tool's version.
public  voidinit()
     Initialize this tool.
public  Filelocate(String name)
     Locate the file with the specified name.
abstract public  Nodeparse(Reader in, File file)
     Parse the specified file.
Parameters:
  in - The input stream for the file.
Parameters:
  file - The corresponding file.
public  voidprepare()
     Prepare for processing.
public  voidprintHeader(Printer printer)
     Print a tool header to the specified printer.
public  voidprocess(Node node)
     Process the specified AST node.
public  voidprocess(String name)
     Recursively process the file with the specified name.
public  voidrun(String[] args)
     Run this tool with the specified command line arguments.
public  voidwrapUp()
     Wrap up this tool.

Field Detail
runtime
final protected Runtime runtime(Code)
The runtime.




Constructor Detail
Tool
public Tool()(Code)
Create a new tool.




Method Detail
diagnose
public void diagnose()(Code)
Print tool diagnostics. The default implementation of this method does nothing.



getCopy
public String getCopy()(Code)
Get this tool's copyright. The default implementation returns Constants.FULL_COPY . The copyright.



getExplanation
public String getExplanation()(Code)
Get this tool's explanation. This method should return any text to print after this tool's description of options. The text is automatically line-wrapped. The default implementation returns null to indicate that there is no explanation. The explanation.



getName
abstract public String getName()(Code)
Get this tool's name. The name.



getVersion
public String getVersion()(Code)
Get this tool's version. The default implementation returns Constants.VERSION . The version.



init
public void init()(Code)
Initialize this tool. This method declares this tool's command line options. The default implementation declares
  • a boolean option optionSilent for silent operation,
  • a boolean option optionVerbose for verbose operation,
  • a boolean option optionNoExit for not exiting the Java virtual machine,
  • a multiple directory option Runtime.INPUT_DIRECTORY for the file search path,
  • a directory option Runtime.OUTPUT_DIRECTORY for the output directory,
  • a word option Runtime.INPUT_ENCODING for the character encoding when reading files,
  • a word option Runtime.OUTPUT_ENCODING for the character encoding when writing files,
  • a boolean option optionDiagnostics for printing tool diagnostics,
  • a boolean option optionPerformance for collecting performance statistics,
  • a boolean option optionMeasureParser for measuring parser performance only.
  • a boolean option optionMeasureProcessing for measuring processing performance only.
  • a boolean option optionGC for performing GC,
  • an integer option runsWarmUp with a default of 2 for the number of warm-up runs,
  • and an integer option runsTotal with a default of 12 for the total number of runs.



locate
public File locate(String name) throws IOException(Code)
Locate the file with the specified name. The default implementation simply looks in the current directory, ignoring any directories in the tool's search path.
See Also:   Runtime.locate(String)
Parameters:
  name - The file name. The corresponding file.
throws:
  IllegalArgumentException - Signals an inappropriate file(e.g., one that is too large).
throws:
  IOException - Signals an I/O error.



parse
abstract public Node parse(Reader in, File file) throws IOException, ParseException(Code)
Parse the specified file.
Parameters:
  in - The input stream for the file.
Parameters:
  file - The corresponding file. The AST corresponding to the file's contents, ornull if no tree has been generated.
throws:
  IllegalArgumentException - Signals an inappropriate file(e.g., one that is too large).
throws:
  IOException - Signals an I/O error.
throws:
  ParseException - Signals a parse error.



prepare
public void prepare()(Code)
Prepare for processing. This method prepares for actually processing files, for example, by performing consistency checks between command line arguments and by initializing all default values not specified on the command line. The default implementation invokes Runtime.initDefaultValues . It also checks that the optionSilent and optionVerbose flags are not both set at the same time.
See Also:   Tool.wrapUp()



printHeader
public void printHeader(Printer printer)(Code)
Print a tool header to the specified printer. This method prints a header documenting the tool name, version, copyright, and current time. It also prints a warning not to edit the result.
Parameters:
  printer - The printer.



process
public void process(Node node)(Code)
Process the specified AST node. This method is only invoked if Tool.parse(Reader,File) has completed successfuly, has returned a node (and not null), and no errors have been reported through Runtime.error , Runtime.error(String) , or Runtime.error(StringNode) while parsing. The default implementation of this method does nothing.
Parameters:
  node - The node.



process
public void process(String name) throws IOException, ParseException(Code)
Recursively process the file with the specified name. This method Tool.locate(String) locates the specified file, opens it, Tool.parse(Reader,File) parses it, closes it, and then Tool.process(Node) processes the resulting AST node.
Parameters:
  name - The file name.
throws:
  IllegalArgumentException - Signals an inappropriate file(e.g., one that is too large).
throws:
  FileNotFoundException - Signals that the file was notfound.
throws:
  IOException - Signals an I/O error while accessing thefile.
throws:
  ParseException - Signals a parse error.
throws:
  VisitingException - Signals an error while visiting a node.



run
public void run(String[] args)(Code)
Run this tool with the specified command line arguments. This method works as following:
  1. It calls Tool.init() to initialize this tool.
  2. It prints the Tool.getName() name , Tool.getVersion()version , and Tool.getCopy() copyright to the Runtime.console console .
  3. If this tool has been invoked without arguments, it prints a description of all command line Runtime.printOptionsoptions and, optionally, an Tool.getExplanation()explanation . It then exits.
  4. It Runtime.process(String[]) processes the specified command line arguments and Tool.prepare() prepares for processing the files. If any errors have been Runtime.seenError reported during the two method calls, it exits.
  5. For each file name specified on the command line, it Tool.locate(String) locates the file, Tool.parse(Reader,File)parses the contents, and Tool.process(Node) processes the resulting AST. If the -performance command line option has been specified, it repeatedly parses and processes each file, measuring both latency and heap utilization. It then exits.

Parameters:
  args - The command line arguments.



wrapUp
public void wrapUp()(Code)
Wrap up this tool. This method is invoked after all files have been processed. The default implementation does nothing.



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.