Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol Table for identifiers and scopes #97

Open
Brandhoej opened this issue Dec 19, 2022 · 0 comments
Open

Symbol Table for identifiers and scopes #97

Brandhoej opened this issue Dec 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Brandhoej
Copy link
Contributor

The UniqueNamedContainer is used to handle identifiers for UniquelyNamed. This allows to basic rules: Local identifier declarations (local in relation to its owner) and global between all owners. However, with its current implementation there are some significant drawbacks:

  • We cannot use declaration rules local to some of the automata.
  • We use the string identifier to compare identities.
  • Each named object has a heap-allocated string identifier.
  • We have to do string manipulation to ensure the uniqueness of the identifiers.
  • We concatenate strings.
  • It isn't easy to copy an identifier and ensure its uniqueness.

Possible solution: Introduce the concept of a symbol table and use a number to map to the identifier as a string. Then change all string identifiers e.g., Clock and Location. With the symbol table, we should add the option for scopes. This would allow using identifiers to be relevant for higher scopes. This could be used to reduce the amount of clocks used in an automaton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant