Where/how to declare the unique key of variables in a compiler written in Ocaml?
I am writing a compiler of mini-pascal in Ocaml. I would like my compiler to accept the following code for instance: program test; var a,b : boolean; n : integer; begin ... end. I have difficulties in dealing with the declaration of variables (the part following var ). At the moment, the type of variables is defined like this in sib_syntax.ml : type s_var = { s_var_name: string; s_var_type: s_type; s_var_uniqueId: s_uniqueId (* key *) } Where s_var_uniqueId (instead of s_var_name ) is the unique key of the variables. My first question is, where and how I could implement the mechanism of