You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we maintain a LeBlanc-Cook symbol table to keep track of lexical scoping. However, the language will actually only have two scopes: local and global. Only functions and procedures will have their own lexical scope. Also, it was decided that name shadowing shall not be allowed.
Accordingly, the current implementation is overly complex, and should be simplified. Greatly.
Throw the LeBlanc-Cook symbol table away entirely, and maintain only two maps: one for the global scope, and one for the currently active local scope, if there is one. When declaring a name, Context should check availabilty in the global scope, then in the local scope. If the name is still free, the name is declared in local scope, if there is one, otherwise in the global scope. All other cases shall result in errors.
This is also a good possibility to clean up Context a bit, especially wrt the declaration functions which are in general inconsistent.
The text was updated successfully, but these errors were encountered:
Currently we maintain a LeBlanc-Cook symbol table to keep track of lexical scoping. However, the language will actually only have two scopes: local and global. Only functions and procedures will have their own lexical scope. Also, it was decided that name shadowing shall not be allowed.
Accordingly, the current implementation is overly complex, and should be simplified. Greatly.
Throw the LeBlanc-Cook symbol table away entirely, and maintain only two maps: one for the global scope, and one for the currently active local scope, if there is one. When declaring a name, Context should check availabilty in the global scope, then in the local scope. If the name is still free, the name is declared in local scope, if there is one, otherwise in the global scope. All other cases shall result in errors.
This is also a good possibility to clean up Context a bit, especially wrt the declaration functions which are in general inconsistent.
The text was updated successfully, but these errors were encountered: