wood.keith.opentools.otnode
Class OTScanner

public class OTScanner
extends AbstractScanner
This class provides the OpenTools-specific text scanner. It identifies the various code elements that make up an OpenTools manifest so that color coding may be done. This version just identifies categories.
Version:
1.0 12 September 2001
1.1 19 February 2002
Author:
Keith Wood (kbwood@iprimus.com.au)
Field Detail

KEYWORDS

public static final String[] KEYWORDS
The list of standard OpenTools categories (in sorted order).

KEYWORD_VERSIONS

public static final String[] KEYWORD_VERSIONS
Versions where the above keywords were introduced.

KEYWORD_CHARS

public static final char[] KEYWORD_CHARS
Accelerator characters for the keywords.

Method Detail

checkString

protected int checkString(int initialState)
Check to see if the buffer pointer is on a string character. If so, advance the buffer point past the entire string sequence.
Returns:
the defined STRING constant or -1

checkComment

protected int checkComment(int initialState)
Check to see if the buffer pointer is on a comment character. If so, advance the buffer point past the entire comment.
Returns:
the defined COMMENT constant or -1

isValidIdentifierStart

protected boolean isValidIdentifierStart(char ch)
The default implementation of checkIdentifier will call this method to determine whether or not a particular character can be the start of an identifier.
Parameters:
ch - the char to be checked
Returns:
true if ch can be the start of an identifier
See Also:
AbstractScanner#checkIdentifier

isValidIdentifierPart

protected boolean isValidIdentifierPart(char ch)
The default implementation of checkIdentifier will call this method to determine whether or not a particular character can be part of an identifier.
Parameters:
ch - the char to be checked
Returns:
true if ch can be part of an identifier
See Also:
AbstractScanner#checkIdentifier

isSymbol

protected boolean isSymbol(char ch)
The default implementation of checkSymbol will call this method to determine whether or not a particular character is a valid symbol.
Parameters:
ch - the char to be checked
Returns:
true if ch is a valid symbol
See Also:
AbstractScanner#checkSymbol

isKeyword

protected boolean isKeyword(String value)
The default implementation of checkIdentifier will call this method to determine whether or not a particular string is a keyword. This method should take into account whether or not the language is case-sensitive.
Parameters:
value - the string to be checked
Returns:
true if value is a keyword
See Also:
checkIdentifier

isExtendedKeyword

protected boolean isExtendedKeyword(String value)
The default implementation of checkIdentifier will call this method to determine whether or not a particular string is an extended keyword. This method should take into account whether or not the language is case-sensitive.
Parameters:
value - the string to be checked
Returns:
true if value is an extended keyword
See Also:
checkIdentifier