amacc
amacc copied to clipboard
id->class is not consistently defined
id->class is 0 for passed parameters vs. class 'Par' or 'Loc'. There may be other inconsistencies for other storage types.
id->class is 0 for passed parameters vs. class 'Par' or 'Loc'. There may be other inconsistencies for other storage types.
Can you make a list of proposed changes to improve the consistency?
Yes. I may pick up this ticket in the next few weeks. There is a lot of detail work to make everything consistent. It probably won't be a lot of code changes (15-30 lines?), but I (or whoever takes this on) will have to check every corner of the code to make sure they have it right. After it is done though, it will greatly increase the power of working with class-types, and maybe types in general.
The issue is that id->class needs to be (1) set to non-zero when an identifier is defined/instantiated and (2) zero valued when an identifier is referenced but not yet instantiated/defined. This knowledge is especially useful in a one pass compiler like AMACC when generating IR. For instance, Labels can be used by goto statements before the Label appears in the source code stream.