Hello! I'm writing a simple tool to process (e.g. combine) jass files in c++. I'd like to find a (simple) way to detect second definitions.
So let's say for example, that I want to combine files a.j and b.j into c.j. Both a.j and b.j contain a global variable called "udg_index" (quite common name). What I want to do, is to copy that variable only once to c.j (if variables have same type) or display an error message (different type). In a similar way I want to prevent function redeclarations. What would be the easiest approach to this problem?
So let's say for example, that I want to combine files a.j and b.j into c.j. Both a.j and b.j contain a global variable called "udg_index" (quite common name). What I want to do, is to copy that variable only once to c.j (if variables have same type) or display an error message (different type). In a similar way I want to prevent function redeclarations. What would be the easiest approach to this problem?