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

Global variables #34

Closed
jacosro opened this issue Jun 7, 2020 · 2 comments
Closed

Global variables #34

jacosro opened this issue Jun 7, 2020 · 2 comments

Comments

@jacosro
Copy link
Collaborator

jacosro commented Jun 7, 2020

Static attributes of each class are represented as global variables. This means that each method declaration will have a global_formal_in and global_formal_out parameter for each one of the global variables of the program (static attributes of every class). Consequently, every method call will also have global_actual_in and global_actual_out nodes for each global variable.

Four new NodeTypes must be added: GLOBAL_FORMAL_IN, GLOBAL_FORMAL_OUT, GLOBAL_ACTUAL_IN, GLOBAL_ACTUAL_OUT, in order to be able to distinguish them from normal parameters.

@cargaji What do you think?

@cargaji
Copy link
Collaborator

cargaji commented Jun 7, 2020

I'm not sure whether new types are needed or not. Types as classes would be useful to unify both formal and actual types, but that can be done after-the-fact. The main difficulty here is locating global variable usage and definitions.

In Java, only static elements can be "global variables", as all others will be accessed via this, a parameter or a static field.

@jacosro jacosro mentioned this issue Jun 7, 2020
2 tasks
@cargaji
Copy link
Collaborator

cargaji commented May 5, 2021

This issue can be split into static fields (see #46) and class fields (already supported in 1.3.0).

@cargaji cargaji closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants