| java.lang.Object org.netbeans.editor.SyntaxSupport
All known Subclasses: org.netbeans.editor.ext.ExtSyntaxSupport,
SyntaxSupport | public class SyntaxSupport (Code) | | Support methods for syntax analyzes
author: Miloslav Metelka version: 1.00 |
Field Summary | |
protected boolean | tokenNumericIDsValid Whether all the token-ids this class deals with have valid numeric-ids.
It's not necessary to set this flag, however it presents an optimization
in testing whether a token belongs to some group of tokens or not. |
Method Summary | |
protected SyntaxSupport | createSyntaxSupport(Class syntaxSupportClass) | public int | findInsideBlocks(Finder finder, int startPos, int endPos, int[] blocks) | public int | findOutsideBlocks(Finder finder, int startPos, int endPos, int[] blocks) | public synchronized SyntaxSupport | get(Class syntaxSupportClass) Get the support that fits the requested support class in the best way. | final public BaseDocument | getDocument() Getter for the document that this support is associated to. | public synchronized int[] | getTokenBlocks(int startPos, int endPos, TokenID[] tokenIDArray) Get position pairs covering the blocks that include only the tokens from
the given token array. | public TokenItem | getTokenChain(int offset) Get the member of the chain of the tokens for the given document
position.
Parameters: offset - position in the document for which the chain is beingretrieved. | public void | initSyntax(Syntax syntax, int startPos, int endPos, boolean forceLastBuffer, boolean forceNotLastBuffer) Initialize the syntax so it's ready to scan the given area.
Parameters: syntax - lexical analyzer to prepare Parameters: startPos - starting position of the scanning Parameters: endPos - ending position of the scanning Parameters: forceLastBuffer - force the syntax to think that the scanned area is the last inthe document. | public boolean | isIdentifier(String word) Check whether the given word is identifier or not. | public void | tokenizeText(TokenProcessor tp, int startOffset, int endOffset, boolean forceLastBuffer) Parse the text and pass the resulting tokens to the token processor. | public void | tokenizeText(TokenProcessor tp, String text) Parse the text and pass the resulting tokens to the token processor. |
tokenNumericIDsValid | protected boolean tokenNumericIDsValid(Code) | | Whether all the token-ids this class deals with have valid numeric-ids.
It's not necessary to set this flag, however it presents an optimization
in testing whether a token belongs to some group of tokens or not. The
testing whether the particular token belongs to some group is improved by
creating a boolean array in which the numeric-ids serve as the array
indexes.
|
get | public synchronized SyntaxSupport get(Class syntaxSupportClass)(Code) | | Get the support that fits the requested support class in the best way.
The value returned will be either instance of the requested class or its
descendant or it will be null.
Parameters: syntaxSupportClass - returned value will be instance of this class (or itsdescendant) or it will be null instance of syntaxSupportClass (or its descendant) or null ifthere's no fitting support. |
getDocument | final public BaseDocument getDocument()(Code) | | Getter for the document that this support is associated to.
|
getTokenBlocks | public synchronized int[] getTokenBlocks(int startPos, int endPos, TokenID[] tokenIDArray) throws BadLocationException(Code) | | Get position pairs covering the blocks that include only the tokens from
the given token array. Although the startPos can be greater than endPos,
the blocks are always returned in the natural order.
Parameters: doc - document to work with Parameters: startPos - starting position of the requested document area. Parameters: endPos - ending position of the requested document area Parameters: tokenIDArray - the array of the token IDs that should be in the blocks. |
getTokenChain | public TokenItem getTokenChain(int offset) throws BadLocationException(Code) | | Get the member of the chain of the tokens for the given document
position.
Parameters: offset - position in the document for which the chain is beingretrieved. token-item around the offset or right at the offset. Null isreturned if offset is equal to document length. |
initSyntax | public void initSyntax(Syntax syntax, int startPos, int endPos, boolean forceLastBuffer, boolean forceNotLastBuffer) throws BadLocationException(Code) | | Initialize the syntax so it's ready to scan the given area.
Parameters: syntax - lexical analyzer to prepare Parameters: startPos - starting position of the scanning Parameters: endPos - ending position of the scanning Parameters: forceLastBuffer - force the syntax to think that the scanned area is the last inthe document. This is useful for forcing the syntax to processall the characters in the given area. Parameters: forceNotLastBuffer - force the syntax to think that the scanned area is NOT thelast buffer in the document. This is useful when the syntaxwill continue scanning on another buffer. |
isIdentifier | public boolean isIdentifier(String word)(Code) | | Check whether the given word is identifier or not.
|
tokenizeText | public void tokenizeText(TokenProcessor tp, int startOffset, int endOffset, boolean forceLastBuffer) throws BadLocationException(Code) | | Parse the text and pass the resulting tokens to the token processor.
Parameters: tp - token processor that will be informed about the found tokens. Parameters: startOffset - starting position in the text Parameters: endOffset - ending position in the text Parameters: forceLastBuffer - force the syntax scanner to think that the requested area isthe last in the document. |
tokenizeText | public void tokenizeText(TokenProcessor tp, String text)(Code) | | Parse the text and pass the resulting tokens to the token processor.
Parameters: tp - token processor that will be informed about the found tokens. Parameters: text - text to parse |
|
|