mjc

org.multijava.util.compiler
Class CToken

java.lang.Object
  extended byantlr.Token
      extended byorg.multijava.util.compiler.CToken
All Implemented Interfaces:
Cloneable

public final class CToken
extends antlr.Token


Nested Class Summary
(package private) static class CToken.LookupToken
           
 
Field Summary
private static CToken.LookupToken currentToken
           
private  int flags
          A bitmask indicating the flags that are true for this token.
private static Hashtable table
           
private  String text
           
 
Fields inherited from class antlr.Token
badToken, EOF_TYPE, INVALID_TYPE, MIN_USER_TYPE, NULL_TREE_LOOKAHEAD, SKIP
 
Constructor Summary
CToken(int type, String text)
          Constructs a token
CToken(int type, String text, int flags)
          Constructs a token
 
Method Summary
 String getText()
           
 boolean hasFlag(int flag)
          Returns true if the flag represented by the bitmask flag is true for this token.
static CToken lookupToken(int type, char[] data, int start, int length)
           
 TokenReference makeTokenReference()
           
 void setText(String text)
           
 
Methods inherited from class antlr.Token
getColumn, getFilename, getLine, getType, setColumn, setFilename, setLine, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentToken

private static final CToken.LookupToken currentToken

table

private static final Hashtable table

text

private String text

flags

private int flags
A bitmask indicating the flags that are true for this token.

Constructor Detail

CToken

public CToken(int type,
              String text)
Constructs a token


CToken

public CToken(int type,
              String text,
              int flags)
Constructs a token

Method Detail

getText

public String getText()
Overrides:
getText in class antlr.Token

setText

public void setText(String text)
Overrides:
setText in class antlr.Token

makeTokenReference

public TokenReference makeTokenReference()

hasFlag

public boolean hasFlag(int flag)
Returns true if the flag represented by the bitmask flag is true for this token.

 requires (\exists int p; p >= 0; ((int) Math.pow(2, p)) == flag);
 requires_redundantly (* only one bit is set in flag *);
 


lookupToken

public static CToken lookupToken(int type,
                                 char[] data,
                                 int start,
                                 int length)

mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.