Interface parsing ================= Problem (arrays): int c = arr[0] [c]int arr = [3, 2, 1] This will be tricky to parse/evaluate! Problem (enums): ... NOTE: Idents need to be BOUND first! (they could reference defs in other modules) Solution 1: - forbid identifier references in array types of toplevel data. - enums...? Solution 2: (better than 1?) - forbid identifier references in initvals & enum values Solution 3: (not possible?) - Require identifier references to come in the right order?? - But how about refs to interfaces of other modules? Solution 4: - Allow refs, as long as they are not circular. - Method 1: - Process definitions recursively, and mark them as they are processed (to avoid infinite recursion) - Can still cause stack overflow if there are very deep reference chains - Method 2: - While the queue of defs is not empty: 1. Mark as "started" 2. Check if all referenced idents are defined. - Put any defs that are not defined first in the queue. - If any is already marked as "started", then report error (circular reference). 3. If all referenced idents were defined, then process the definition.