Skip to content

Symbol Table for identifiers and scopes #97

@Brandhoej

Description

@Brandhoej

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions