Java Doc for CharStream.java in  » Code-Analyzer » pmd-4.2rc1 » net » sourceforge » pmd » ast » 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 » Code Analyzer » pmd 4.2rc1 » net.sourceforge.pmd.ast 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.sourceforge.pmd.ast.CharStream

All known Subclasses:   net.sourceforge.pmd.ast.JavaCharStream,
CharStream
public interface CharStream (Code)
This interface describes a character stream that maintains line and column number positions of the characters. It also has the capability to backup the stream to some extent. An implementation of this interface is used in the TokenManager implementation generated by JavaCCParser.

All the methods except backup can be implemented in any fashion. backup needs to be implemented correctly for the correct operation of the lexer. Rest of the methods are all used to get information like line number, column number and the String that constitutes a token and are not used by the lexer. Hence their implementation won't affect the generated lexer's operation.





Method Summary
 charBeginToken()
     Returns the next character that marks the beginning of the next token.
 voidDone()
     The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class.
 StringGetImage()
     Returns a string made up of characters from the marked token beginning to the current buffer position.
 char[]GetSuffix(int len)
     Returns an array of characters that make up the suffix of length 'len' for the currently matched token.
 voidbackup(int amount)
     Backs up the input stream by amount steps.
 intgetBeginColumn()
     Returns the column number of the first character for current token (being matched after the last call to BeginTOken).
 intgetBeginLine()
     Returns the line number of the first character for current token (being matched after the last call to BeginTOken).
 intgetColumn()
     Returns the column position of the character last read.
 intgetEndColumn()
     Returns the column number of the last character for current token (being matched after the last call to BeginTOken).
 intgetEndLine()
     Returns the line number of the last character for current token (being matched after the last call to BeginTOken).
 intgetLine()
     Returns the line number of the character last read.
 charreadChar()
     Returns the next character from the selected input.



Method Detail
BeginToken
char BeginToken() throws java.io.IOException(Code)
Returns the next character that marks the beginning of the next token. All characters must remain in the buffer between two successive calls to this method to implement backup correctly.



Done
void Done()(Code)
The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class. Again, the body of this function can be just empty and it will not affect the lexer's operation.



GetImage
String GetImage()(Code)
Returns a string made up of characters from the marked token beginning to the current buffer position. Implementations have the choice of returning anything that they want to. For example, for efficiency, one might decide to just return null, which is a valid implementation.



GetSuffix
char[] GetSuffix(int len)(Code)
Returns an array of characters that make up the suffix of length 'len' for the currently matched token. This is used to build up the matched string for use in actions in the case of MORE. A simple and inefficient implementation of this is as follows :

{ String t = GetImage(); return t.substring(t.length() - len, t.length()).toCharArray(); }




backup
void backup(int amount)(Code)
Backs up the input stream by amount steps. Lexer calls this method if it had already read some characters, but could not use them to match a (longer) token. So, they will be used again as the prefix of the next token and it is the implemetation's responsibility to do this right.



getBeginColumn
int getBeginColumn()(Code)
Returns the column number of the first character for current token (being matched after the last call to BeginTOken).



getBeginLine
int getBeginLine()(Code)
Returns the line number of the first character for current token (being matched after the last call to BeginTOken).



getColumn
int getColumn()(Code)
Returns the column position of the character last read.
See Also:   CharStream.getEndColumn



getEndColumn
int getEndColumn()(Code)
Returns the column number of the last character for current token (being matched after the last call to BeginTOken).



getEndLine
int getEndLine()(Code)
Returns the line number of the last character for current token (being matched after the last call to BeginTOken).



getLine
int getLine()(Code)
Returns the line number of the character last read.
See Also:   CharStream.getEndLine



readChar
char readChar() throws java.io.IOException(Code)
Returns the next character from the selected input. The method of selecting the input is the responsibility of the class implementing this interface. Can throw any java.io.IOException.



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