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

Support for Pointer and Reference types #177

Closed
ghaith opened this issue May 21, 2021 · 0 comments · Fixed by #242
Closed

Support for Pointer and Reference types #177

ghaith opened this issue May 21, 2021 · 0 comments · Fixed by #242
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ghaith
Copy link
Collaborator

ghaith commented May 21, 2021

Is your feature request related to a problem? Please describe.
The standard supports a REF_TO type marking a reference
Some IEC61131-3 Extensions like Codesys support a POINTER TO type
This feature is to add support for these types.

Describe the solution you'd like
Add a new Datatype: POINTER TO <TYPE> where TYPE is any available datatype
Add a new Datatype: REF_TO <TYPE> where TYPE is any available datatype
Accessing a datatype instance as &instance will be a reference to that type.
Accessing a pointer or reference to a type using instance^ will de-reference the type.

Pointers and references are equivalent / Interchangeable.
Pointers and References can be assigned to a DWORD which is the address of the value being referenced.

Additional context
A pointer or reference that have not been assigned have the value NULL
Accessing a NULL pointer or reference is undefined

The standard calls for a REF() function, and codesys also provides an ADR() function to retrieve the pointer address. These functions are not covered by this feature request.

@ghaith ghaith added the enhancement New feature or request label May 21, 2021
@ghaith ghaith self-assigned this Jul 30, 2021
@ghaith ghaith added this to the oscat milestone Aug 11, 2021
@ghaith ghaith moved this to Done in Next Jan 9, 2023
@ghaith ghaith added this to Next Jan 9, 2023
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
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant