Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I want to know how to integrate the creation of my compiler variables and give value to these variables in vb.net thanks

What I have tried:

Create arrays and drop variables but I can not give a value to these variables
Posted
Comments
Afzaal Ahmad Zeeshan 6-Feb-16 14:29pm    
You cannot add variables to a compiler, a compiler is a program. You can only add variables to the source code.
Mauricio Soto 6-Feb-16 14:40pm    
I am creating a compiler and need to integrate the creation of variables.
Sascha Lefèvre 6-Feb-16 15:00pm    
Do you have a grammar, parser, lexer? Then your compiler should be able to recognize an assignment expression. Left side = variable name, right side = value. Create a variable "container" and put that value into it.
PIEBALDconsult 6-Feb-16 16:06pm    
Maybe try a Dictionary?

1 solution

Usually a symbol table serves to the purpose. See, for instance: Compiler Design - Symbol Table[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900