miSim

misim.asm
Class TokenNumber

java.lang.Object
  |
  +--misim.editor.Token
        |
        +--misim.asm.TokenNumber
All Implemented Interfaces:
java.lang.Cloneable

public class TokenNumber
extends Token


Fields inherited from class misim.editor.Token
display, text, TYPE_ALIAS, TYPE_COLON, TYPE_COMMA, TYPE_COMMAND, TYPE_COMMENT, TYPE_INSTRUCTION, TYPE_LISTING, TYPE_NUMBER, TYPE_OPERATOR, TYPE_STRING, TYPE_TOKEN, TYPE_WHITESPACE
 
Constructor Summary
TokenNumber(java.lang.String text, EditorPrefs prefs)
           
 
Method Summary
static Token consume(Token aToken, int start)
          Parsing method - to be implemented by subclasses.
static java.lang.String getDelimiters()
           
 int intValue(Context context)
          Return the integer value of this token
 
Methods inherited from class misim.editor.Token
clone, draw, drawChars, getColour, getColumn, getLength, getPixelPos, getPrefs, getType, getValue, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenNumber

public TokenNumber(java.lang.String text,
                   EditorPrefs prefs)
Method Detail

getDelimiters

public static java.lang.String getDelimiters()

intValue

public int intValue(Context context)
             throws EditorException
Return the integer value of this token
Returns:
The value of this token
Throws:
EditorException - if the token cannot be parsed

consume

public static Token consume(Token aToken,
                            int start)
Parsing method - to be implemented by subclasses. Build a new token based on as much of the given token as possible, starting at the given index. The method may return null if the text is not appropriate for this token type.
Parameters:
aToken - The token to consume
start - The start index
Returns:
A new token, or null

miSim