dcsimg
How do I get the string identifier of a token?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Don_McClean
Posted On:   Wednesday, February 6, 2002 12:30 PM

I have defined keywords in the tokens table. tokens { BEGIN = "BEGIN"; END = "END"; .. } I store the parsed tokens in a hash table for subsuquent debug. I can retrieve the token types from the token, but how do I get the original string names "BEGIN", "END", etc., for easy debugging? I tried to access the literal table, but the object stored as the key is not a String, but a ANTLRHashString, and I do not see a method to retrieve the original string. Thanks in advance    More>>


I have defined keywords in the tokens
table.

			

tokens {

BEGIN = "BEGIN";
END = "END";
..
}



I store the parsed tokens in a
hash table for subsuquent debug.

I can retrieve the token types from the token,
but how do I get the original string
names "BEGIN", "END", etc., for easy debugging?


I tried to access the
literal table, but the object stored as the key is not a String, but a ANTLRHashString, and I do not see a method to retrieve the original string.

Thanks in advance

   <<Less

Re: How do I get the string identifier of a token?

Posted By:   Terence_Parr  
Posted On:   Monday, February 11, 2002 05:42 PM

Hmm...I can't remember off the top of my head. Isn't there a method on that object to get the value?
About | Sitemap | Contact