C# Class kompiler.Token

A token is a category of lexemes. Some tokens are keywords like "MODULE". Some tokens are symbols; the token of type PLUS is the symbol "+". Some tokens are a large set; some tokens of type INTEGER are "73" and "255". The enumerations below include all the tokens that we need to recognize. Note that the Modula-2 User's Manual offers both # and <> to mean NOT EQUAL (pp. 96, 97, and 110). Our code does not use #. We only use <>. Many errors are reported by TOKENTYPE which is just a number (like 34 for T_ID). Therefore, I added enumeration numbers for tokens in the left column as a convenience during debugging. Author: Tom Fuller Date: January 6, 2007
Show file Open project: jakl/hacks Class Usage Examples

Public Properties

Property Type Description
c_iKeywordCount int
m_iLineNum int
m_strName string
m_tokType TOKENTYPE
multichars string>.Dictionary
regexes Regex>.Dictionary
singlechars char>.Dictionary

Public Methods

Method Description
ToString ( ) : string
Token ( ) : System
Token ( Token tok, string inName, int inLine ) : System
Token ( string inName, int inLine ) : System

Method Details

ToString() public method

public ToString ( ) : string
return string

Token() public method

public Token ( ) : System
return System

Token() public method

public Token ( Token tok, string inName, int inLine ) : System
tok Token
inName string
inLine int
return System

Token() public method

public Token ( string inName, int inLine ) : System
inName string
inLine int
return System

Property Details

c_iKeywordCount public static property

public static int c_iKeywordCount
return int

m_iLineNum public property

public int m_iLineNum
return int

m_strName public property

public string m_strName
return string

m_tokType public property

public TOKENTYPE m_tokType
return TOKENTYPE

multichars public static property

public static Dictionary multichars
return string>.Dictionary

regexes public static property

public static Dictionary regexes
return Regex>.Dictionary

singlechars public static property

public static Dictionary singlechars
return char>.Dictionary