platypus
Class Token

java.lang.Object
  extended by platypus.Token

public class Token
extends java.lang.Object

Process the token from the input line of text. Note: this class has no setters. A Token is only created and read. Its contents are never changed, so there is no need for setters.

Author:
alb

Field Summary
private  java.lang.String content
           
private  int type
           
 
Constructor Summary
Token(int tokenType, java.lang.String tokenContent)
          create a token consisting of the token type and its contents
 
Method Summary
 java.lang.String getContent()
          return the content portion of the token (a String)
 int getType()
          return the type of token
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private final int type

content

private final java.lang.String content
Constructor Detail

Token

public Token(int tokenType,
             java.lang.String tokenContent)
create a token consisting of the token type and its contents

Parameters:
tokenType - (for possible value, see TokTyp.java)
tokenContent - string containing the lexeme
Method Detail

getType

public int getType()
return the type of token

Returns:
type of token (for possible values, see TokTyp.java)

getContent

public java.lang.String getContent()
return the content portion of the token (a String)

Returns:
content


Copyright © 2006-7 Pacific Data Works LLC