[antlr-interest] Handling variables?

matthew cunningham mattcunning at hotmail.com
Mon Nov 1 07:45:49 PDT 2010


I'm wondering about an implementation detail.
I'm using ANTLR with C# (.NET 3.5) and I'm trying to figure out what's the best course of action for handling my variables.
I'm using a dictionary right now... So I get a variable name and save it's value opposite. Dictionaries are basically 2d arrays with a limit of two columns.
Do you think I should maybe use something else? Mainly because you set the type (currently using integer) opposite your identifier (string right now) and that limits me to saving ints... what about floats, doubles, hex, strings...etc create one for each... using some sort of object that could handle all of them?

- Matthew
 		 	   		  


More information about the antlr-interest mailing list