rulonsw / SummerCompiler

c++ - based compiler for CS 5300's CPSL programming language
0 stars 0 forks source link

Conditional blocks need global ids #6

Open rulonsw opened 7 years ago

rulonsw commented 7 years ago

Conditionals/loops can span "depth", not "width" during production

While working on a part of the simple-ctrl feature branch, I realized that an if/else tree on the same level as another has no way of distinguishing itself as being unique.

I need a global counter that gets updated every time the head of a conditional or loop gets hit. That way, I can keep track of each one's labels in the resulting ASM file.

rulonsw commented 7 years ago

I've found a solution to this. I've already implemented it in the loops branch, and I'll be backfilling conditionals with a similar solution after I finish work on the former.

rulonsw commented 7 years ago

Just kidding. For some reason, this really isn't working.