Java Doc for TokenList.java in  » IDE-Netbeans » lexer » org » netbeans » lib » lexer » 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 » IDE Netbeans » lexer » org.netbeans.lib.lexer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.netbeans.lib.lexer.TokenList

TokenList
public interface TokenList (Code)
Browsable list of tokens.
org.netbeans.api.lexer.TokenSequence delegates all its operation to this class so any service provider delivering this class will be able to produce token sequences. There are various implementations of the token list:
  • BatchTokenList
  • - predecessor of batch token lists
  • TextTokenList
  • - token list over immutable char sequence
  • CopyTextTokenList
  • - token list over text input that needs to be copied. Characters that belong to tokens skipped due to skipTokenIds do not need to be copied.
  • SkimTokenList
  • - filter over CopyTextTokenList to store the token characters in multiple arrays and to correctly compute the tokens' starting offsets.
  • IncTokenList
  • - token list for mutable-input environment.
  • EmbeddedTokenList
  • - token list for a single language embedding suitable for both batch and incremental environments.

author:
   Miloslav Metelka
version:
   1.00




Method Summary
 charchildTokenCharAt(int rawOffset, int index)
     Get character of a token from the character sequence represented by this support.
Parameters:
  rawOffset - raw offset of the child token.The given offset value may need to be preprocessed before using (it dependson a nature of the token list).
Parameters:
  index - index inside the token's text that should be returned.This value cannot be simply added to the previous parameterfor mutable token lists as the value could errorneously pointinto a middle of the offset gap then.
 intchildTokenOffset(int rawOffset)
     Get absolute offset of the child token with the given raw offset in the underlying input.
Parameters:
  rawOffset - raw offset of the child token.
 intendOffset()
     Get offset where the last token of this token list should end.
 InputAttributesinputAttributes()
     Extra attributes related to the input being lexed.
 booleanisContinuous()
     Returns true if the underlying token list does not contain offset ranges that would not be covered by tokens.
 booleanisRemoved()
     Check if this token list is removed from token hierarchy.
 LanguagePathlanguagePath()
     Language path of this token list.
 intlookahead(int index)
     Get lookahead information for the token at the existing token index.
Lookahead is number of characters that the lexer has read past the end of the given token in order to recognize it in the text.
This information allows the lexer to know whether modifications past the end of the token can affect its validity.

In general only mutable token lists benefit from this information but non-mutable token lists may store the information as well for testing purposes.


Parameters:
  index - index of the existing token.
 intmodCount()
     Get number of modifications which mutated this token list.
Token sequence remembers this number when it gets constructed and checks this number when it moves between tokens and if there is an extra modification performed it throws IllegalStateException.

This is also used to check whether this token list corresponds to mutable input or not because unmodifiable lists return -1 from this method.

For branch token lists the TokenList.updateStartOffsetShift() ensures that the value returned by this method is most up-to-date (equals to the root list's one). number of modifications performed to the list.
Returns -1 if this list is constructed for immutable input and cannot be mutated.

 AbstractToken<T>replaceFlyToken(int index, AbstractToken<T> flyToken, int offset)
     Replace flyweight token at the given index with its non-flyweight copy.
This may be requested by TokenSequence.offsetToken().
Parameters:
  index - >=0 index of the flyweight token in this list.
Parameters:
  flyToken - non-null flyweight token.
 TokenListroot()
     Get the root token list of the token list hierarchy.
 Set<T>skipTokenIds()
     Get set of token ids to be skipped during token creation.
 intstartOffset()
     Get offset where a first token of this token list should start.
 Objectstate(int index)
     Get state information for the token at the existing token index.
It is an object defining lexer's state after recognition of the given token.
This information allows to restart the lexer at the end of the given token.

In general only mutable token lists benefit from this information but non-mutable token lists may store the information as well for testing purposes.


Parameters:
  index - index of the existing token.
 inttokenCount()
     Get total count of tokens in the list.
 inttokenCountCurrent()
     Return present number of tokens in the token list but do not create any new tokens (because of possible lazy token creation).
This is necessary e.g.
 TokenHierarchyOperationtokenHierarchyOperation()
     Get token hierarchy operation for this token list or null if this token list does not have any token hierarchy.
 inttokenOffset(int index)
     Get absolute offset of the token at the given index in the token list.
 ObjecttokenOrEmbeddingContainer(int index)
     Get token or EmbeddingContainer at given index in this list.
The method's implementation may need to be synchronized as multiple threads can access it at the same time.
The requested index value may be arbitrarily high (e.g.
 voidwrapToken(int index, EmbeddingContainer<T> embeddingContainer)
     Wrap the token by a branch token list due to language embedding that exists for the token.



Method Detail
childTokenCharAt
char childTokenCharAt(int rawOffset, int index)(Code)
Get character of a token from the character sequence represented by this support.
Parameters:
  rawOffset - raw offset of the child token.The given offset value may need to be preprocessed before using (it dependson a nature of the token list).
Parameters:
  index - index inside the token's text that should be returned.This value cannot be simply added to the previous parameterfor mutable token lists as the value could errorneously pointinto a middle of the offset gap then. appropriate character that the token has requested.



childTokenOffset
int childTokenOffset(int rawOffset)(Code)
Get absolute offset of the child token with the given raw offset in the underlying input.
Parameters:
  rawOffset - raw offset of the child token. absolute offset in the input.



endOffset
int endOffset()(Code)
Get offset where the last token of this token list should end.
If token filtering is used then the last token may end at lower offset.
It's guaranteed that there will be no token ending above this offset.



inputAttributes
InputAttributes inputAttributes()(Code)
Extra attributes related to the input being lexed.



isContinuous
boolean isContinuous()(Code)
Returns true if the underlying token list does not contain offset ranges that would not be covered by tokens.
This could happen if a batch token list would use token id filter.
If the token list is continuous the TokenSequence can compute token offsets more efficiently.



isRemoved
boolean isRemoved()(Code)
Check if this token list is removed from token hierarchy.
Should only be called under the lock of the root token list. true if the token list was removed or false otherwise.



languagePath
LanguagePath languagePath()(Code)
Language path of this token list.



lookahead
int lookahead(int index)(Code)
Get lookahead information for the token at the existing token index.
Lookahead is number of characters that the lexer has read past the end of the given token in order to recognize it in the text.
This information allows the lexer to know whether modifications past the end of the token can affect its validity.

In general only mutable token lists benefit from this information but non-mutable token lists may store the information as well for testing purposes.


Parameters:
  index - index of the existing token. >=0 number of characters that the lexer has readin order to recognize this token. Return zero if this token listdoes not maintain lookaheads.



modCount
int modCount()(Code)
Get number of modifications which mutated this token list.
Token sequence remembers this number when it gets constructed and checks this number when it moves between tokens and if there is an extra modification performed it throws IllegalStateException.

This is also used to check whether this token list corresponds to mutable input or not because unmodifiable lists return -1 from this method.

For branch token lists the TokenList.updateStartOffsetShift() ensures that the value returned by this method is most up-to-date (equals to the root list's one). number of modifications performed to the list.
Returns -1 if this list is constructed for immutable input and cannot be mutated.




replaceFlyToken
AbstractToken<T> replaceFlyToken(int index, AbstractToken<T> flyToken, int offset)(Code)
Replace flyweight token at the given index with its non-flyweight copy.
This may be requested by TokenSequence.offsetToken().
Parameters:
  index - >=0 index of the flyweight token in this list.
Parameters:
  flyToken - non-null flyweight token.
Parameters:
  offset - >=0 absolute offset where the flyweight token resides. non-flyweight token instance.



root
TokenList root()(Code)
Get the root token list of the token list hierarchy.



skipTokenIds
Set<T> skipTokenIds()(Code)
Get set of token ids to be skipped during token creation.



startOffset
int startOffset()(Code)
Get offset where a first token of this token list should start.
If token filtering is used then the first token may start at higher offset.
It's guaranteed that there will be no token starting below this offset.



state
Object state(int index)(Code)
Get state information for the token at the existing token index.
It is an object defining lexer's state after recognition of the given token.
This information allows to restart the lexer at the end of the given token.

In general only mutable token lists benefit from this information but non-mutable token lists may store the information as well for testing purposes.


Parameters:
  index - index of the existing token. lexer's state after recognition of this tokenor null for default state. Return null if this token listdoes not maintain states.



tokenCount
int tokenCount()(Code)
Get total count of tokens in the list.
For token lists that create the tokens lazily this will lead to lexing till the end of the input.



tokenCountCurrent
int tokenCountCurrent()(Code)
Return present number of tokens in the token list but do not create any new tokens (because of possible lazy token creation).
This is necessary e.g. for TokenSequence.move() that needs a binary search for fast positioning but using TokenList.tokenCount() would lead to unnecessary creation of all tokens.



tokenHierarchyOperation
TokenHierarchyOperation tokenHierarchyOperation()(Code)
Get token hierarchy operation for this token list or null if this token list does not have any token hierarchy.



tokenOffset
int tokenOffset(int index)(Code)
Get absolute offset of the token at the given index in the token list.
This method can only be called if the token at the given index was already fetched by tokenOrEmbeddingContainer(int) .



tokenOrEmbeddingContainer
Object tokenOrEmbeddingContainer(int index)(Code)
Get token or EmbeddingContainer at given index in this list.
The method's implementation may need to be synchronized as multiple threads can access it at the same time.
The requested index value may be arbitrarily high (e.g. when TokenSequence.move(index) is used for too high value). >=0 index of the token in this list. valid token or null if the index is too high.



wrapToken
void wrapToken(int index, EmbeddingContainer<T> embeddingContainer)(Code)
Wrap the token by a branch token list due to language embedding that exists for the token.
Parameters:
  index - existing index in this token list at which the tokenshould be wrapped with the embedding info.
Parameters:
  embeddingContainer - embedding info that should wrap the token.



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