Java Doc for CommonTokenStream.java in  » Parser » antlr-3.0.1 » org » antlr » runtime » 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 » antlr 3.0.1 » org.antlr.runtime 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.antlr.runtime.CommonTokenStream

All known Subclasses:   org.antlr.runtime.TokenRewriteStream,
CommonTokenStream
public class CommonTokenStream implements TokenStream(Code)
The most common stream of tokens is one where every token is buffered up and tokens are prefiltered for a certain channel (the parser will only see these tokens and cannot change the filter channel number during the parse). TODO: how to access the full token stream? How to track all tokens matched per rule?


Field Summary
protected  intchannel
     Skip tokens on any channel but this one; this is how we skip whitespace...
protected  MapchannelOverrideMap
    
protected  booleandiscardOffChannelTokens
    
protected  SetdiscardSet
    
protected  intlastMarker
     Track the last mark() call result value for use in rewind().
protected  intp
     The index into the tokens list of the current token (next token to consume).
protected  TokenSourcetokenSource
    
protected  Listtokens
     Record every single token pulled from the source so we can reproduce chunks of it later.

Constructor Summary
public  CommonTokenStream()
    
public  CommonTokenStream(TokenSource tokenSource)
    
public  CommonTokenStream(TokenSource tokenSource, int channel)
    

Method Summary
public  intLA(int i)
    
protected  TokenLB(int k)
    
public  TokenLT(int k)
     Get the ith token from the current position 1..n where k=1 is the first symbol of lookahead.
public  voidconsume()
     Move the input pointer to the next incoming token.
public  voiddiscardOffChannelTokens(boolean discardOffChannelTokens)
    
public  voiddiscardTokenType(int ttype)
    
protected  voidfillBuffer()
     Load all tokens from the token source and put in tokens.
public  Tokenget(int i)
     Return absolute token i; ignore which channel the tokens are on; that is, count all tokens not just on-channel tokens.
public  TokenSourcegetTokenSource()
    
public  ListgetTokens()
    
public  ListgetTokens(int start, int stop)
    
public  ListgetTokens(int start, int stop, BitSet types)
     Given a start and stop index, return a List of all tokens in the token type BitSet.
public  ListgetTokens(int start, int stop, List types)
    
public  ListgetTokens(int start, int stop, int ttype)
    
public  intindex()
    
public  intmark()
    
public  voidrelease(int marker)
    
public  voidrewind(int marker)
    
public  voidrewind()
    
public  voidseek(int index)
    
public  voidsetTokenSource(TokenSource tokenSource)
     Reset this token stream by setting its token source.
public  voidsetTokenTypeChannel(int ttype, int channel)
     A simple filter mechanism whereby you can tell this token stream to force all tokens of type ttype to be on channel.
public  intsize()
    
protected  intskipOffTokenChannels(int i)
     Given a starting index, return the index of the first on-channel token.
protected  intskipOffTokenChannelsReverse(int i)
    
public  StringtoString()
    
public  StringtoString(int start, int stop)
    
public  StringtoString(Token start, Token stop)
    

Field Detail
channel
protected int channel(Code)
Skip tokens on any channel but this one; this is how we skip whitespace...



channelOverrideMap
protected Map channelOverrideMap(Code)
Map to override some Tokens' channel numbers



discardOffChannelTokens
protected boolean discardOffChannelTokens(Code)
By default, track all incoming tokens



discardSet
protected Set discardSet(Code)
Set; discard any tokens with this type



lastMarker
protected int lastMarker(Code)
Track the last mark() call result value for use in rewind().



p
protected int p(Code)
The index into the tokens list of the current token (next token to consume). p==-1 indicates that the tokens list is empty



tokenSource
protected TokenSource tokenSource(Code)



tokens
protected List tokens(Code)
Record every single token pulled from the source so we can reproduce chunks of it later.




Constructor Detail
CommonTokenStream
public CommonTokenStream()(Code)



CommonTokenStream
public CommonTokenStream(TokenSource tokenSource)(Code)



CommonTokenStream
public CommonTokenStream(TokenSource tokenSource, int channel)(Code)




Method Detail
LA
public int LA(int i)(Code)



LB
protected Token LB(int k)(Code)
Look backwards k tokens on-channel tokens



LT
public Token LT(int k)(Code)
Get the ith token from the current position 1..n where k=1 is the first symbol of lookahead.



consume
public void consume()(Code)
Move the input pointer to the next incoming token. The stream must become active with LT(1) available. consume() simply moves the input pointer so that LT(1) points at the next input symbol. Consume at least one token. Walk past any token not on the channel the parser is listening to.



discardOffChannelTokens
public void discardOffChannelTokens(boolean discardOffChannelTokens)(Code)



discardTokenType
public void discardTokenType(int ttype)(Code)



fillBuffer
protected void fillBuffer()(Code)
Load all tokens from the token source and put in tokens. This is done upon first LT request because you might want to set some token type / channel overrides before filling buffer.



get
public Token get(int i)(Code)
Return absolute token i; ignore which channel the tokens are on; that is, count all tokens not just on-channel tokens.



getTokenSource
public TokenSource getTokenSource()(Code)



getTokens
public List getTokens()(Code)



getTokens
public List getTokens(int start, int stop)(Code)



getTokens
public List getTokens(int start, int stop, BitSet types)(Code)
Given a start and stop index, return a List of all tokens in the token type BitSet. Return null if no tokens were found. This method looks at both on and off channel tokens.



getTokens
public List getTokens(int start, int stop, List types)(Code)



getTokens
public List getTokens(int start, int stop, int ttype)(Code)



index
public int index()(Code)



mark
public int mark()(Code)



release
public void release(int marker)(Code)



rewind
public void rewind(int marker)(Code)



rewind
public void rewind()(Code)



seek
public void seek(int index)(Code)



setTokenSource
public void setTokenSource(TokenSource tokenSource)(Code)
Reset this token stream by setting its token source.



setTokenTypeChannel
public void setTokenTypeChannel(int ttype, int channel)(Code)
A simple filter mechanism whereby you can tell this token stream to force all tokens of type ttype to be on channel. For example, when interpreting, we cannot exec actions so we need to tell the stream to force all WS and NEWLINE to be a different, ignored channel.



size
public int size()(Code)



skipOffTokenChannels
protected int skipOffTokenChannels(int i)(Code)
Given a starting index, return the index of the first on-channel token.



skipOffTokenChannelsReverse
protected int skipOffTokenChannelsReverse(int i)(Code)



toString
public String toString()(Code)



toString
public String toString(int start, int stop)(Code)



toString
public String toString(Token start, Token stop)(Code)



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.