org.overturetool.vdmj.lex
Class LexToken

java.lang.Object
  extended by org.overturetool.vdmj.lex.LexToken
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LexBooleanToken, LexCharacterToken, LexIdentifierToken, LexIntegerToken, LexKeywordToken, LexNameToken, LexQuoteToken, LexRealToken, LexStringToken

public abstract class LexToken
extends java.lang.Object
implements java.io.Serializable

The parent class for all lexical token types.

See Also:
Serialized Form

Field Summary
 LexLocation location
          The textual location of the token.
 Token type
          The basic type of the token.
 
Constructor Summary
LexToken(LexLocation location, Token type)
          Create a token of the given type at the given location.
 
Method Summary
 void abort(int number, java.lang.String msg, Context ctxt)
           
 void concern(boolean serious, int number, java.lang.String msg)
          This is used when a problem would be an error if the type it applies to is unambiguous, or a warning otherwise.
 void detail(java.lang.String tag, java.lang.Object obj)
           
 void detail2(java.lang.String tag1, java.lang.Object obj1, java.lang.String tag2, java.lang.Object obj2)
           
 boolean is(Token ttype)
          Test whether this token is a given basic type.
 boolean isNot(Token ttype)
          Test whether this token is not a given basic type.
 void report(int number, java.lang.String msg)
           
 java.lang.String toString()
           
 void warning(int number, java.lang.String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

location

public final LexLocation location
The textual location of the token.


type

public final Token type
The basic type of the token.

Constructor Detail

LexToken

public LexToken(LexLocation location,
                Token type)
Create a token of the given type at the given location.

Parameters:
location - The location of the token.
type - The basic type of the token.
Method Detail

is

public boolean is(Token ttype)
Test whether this token is a given basic type.

Parameters:
ttype - The type to test.
Returns:
True if this is of that type.

isNot

public boolean isNot(Token ttype)
Test whether this token is not a given basic type.

Parameters:
ttype - The type to test.
Returns:
True if this is not of that type.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

report

public void report(int number,
                   java.lang.String msg)
See Also:
Definition.report(int, java.lang.String)

warning

public void warning(int number,
                    java.lang.String msg)
See Also:
Definition.warning(int, java.lang.String)

concern

public void concern(boolean serious,
                    int number,
                    java.lang.String msg)
This is used when a problem would be an error if the type it applies to is unambiguous, or a warning otherwise.

Parameters:
serious - True if this should be an error
number - The error number.
msg - The problem.

abort

public void abort(int number,
                  java.lang.String msg,
                  Context ctxt)
See Also:
Definition.abort(int, java.lang.String, org.overturetool.vdmj.runtime.Context)

detail

public void detail(java.lang.String tag,
                   java.lang.Object obj)
See Also:
Definition.detail(java.lang.String, java.lang.Object)

detail2

public void detail2(java.lang.String tag1,
                    java.lang.Object obj1,
                    java.lang.String tag2,
                    java.lang.Object obj2)
See Also:
Definition.detail2(java.lang.String, java.lang.Object, java.lang.String, java.lang.Object)


Copyright © 2009. All Rights Reserved.