org.prorefactor.core
Class TokenTypes

java.lang.Object
  extended by org.prorefactor.core.TokenTypes
All Implemented Interfaces:
TokenTypesI

public class TokenTypes
extends java.lang.Object
implements TokenTypesI

This static class provides information about Proparse's token types as well as all of the static, final names for each token type.


Constructor Summary
TokenTypes()
           
 
Method Summary
static java.lang.String getDefaultText(int tokenType)
          For integer token types that represent a keyword in the syntax, this returns the full keyword text/name.
 java.lang.String getName(int tokenType)
          Implements TokenTypesI, calls getTokenName().
static java.lang.String getTokenName(int tokenType)
          Get the token name for this token type.
static boolean hasDefaultText(int tokenType)
          Proparse tracks keywords that are part of the syntax, but does not track keywords that are only attribute/method names.
static boolean isNatural(int tokenType)
          A "natural" node is one that represents a real token in the original source code.
static boolean isValid(int tokenType)
          Is the integer a valid token type?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenTypes

public TokenTypes()
Method Detail

getDefaultText

public static java.lang.String getDefaultText(int tokenType)
For integer token types that represent a keyword in the syntax, this returns the full keyword text/name.

Returns:
null if invalid token type or is not a keyword according to Proparse.
See Also:
hasDefaultText(int)

getName

public java.lang.String getName(int tokenType)
Implements TokenTypesI, calls getTokenName().

Specified by:
getName in interface TokenTypesI

getTokenName

public static java.lang.String getTokenName(int tokenType)
Get the token name for this token type.

Returns:
null if invalid token type.

isNatural

public static boolean isNatural(int tokenType)
A "natural" node is one that represents a real token in the original source code. A "synthetic" token is one that was created by the parser just for syntax tree organization. By convention, a natural node has a node name that is ALLCAPS, and a synthetic node has a node name which is Mixed_Case.


hasDefaultText

public static boolean hasDefaultText(int tokenType)
Proparse tracks keywords that are part of the syntax, but does not track keywords that are only attribute/method names. DISPLAY is a keyword type, ID is not. See Proparse's node attribute documentation for NODE_TYPE_KEYWORD.


isValid

public static boolean isValid(int tokenType)
Is the integer a valid token type?



Copyright © 2008 Joanju Software. All Rights Reserved.