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 Classes : Part 2 Code generation #228

Closed
ghaith opened this issue Aug 10, 2021 · 1 comment · Fixed by #253
Closed

Support Classes : Part 2 Code generation #228

ghaith opened this issue Aug 10, 2021 · 1 comment · Fixed by #253
Labels
enhancement New feature or request

Comments

@ghaith
Copy link
Collaborator

ghaith commented Aug 10, 2021

Is your feature request related to a problem? Please describe.
With class parsing now in place, we need to support instances and method calls for such classes.

Describe the solution you'd like

  • Classes should be treated as POUs and instantiated in a similar way to function blocks (This should happen automatically, but we need to add tests for it)
  • Methods should be called in a similar way to Actions, with the exception that they need to always be fully qualified, either with an instance name or with a THIS keyword (Not yet implemented).
  • In addition to the normal parameters, methods should also get their own POU as the second parameter. This can be done in a similar way to functions. And can be solved generically for all implementation (i.e. if an implementation has a container, the first param is the container, and if available, the second param is the pou with the name of that method)
  • Tests for method calls are missing, but method calls without parameters should already work as actions (It will find the method even without the THIS pointer, which we should however fix or discuss this further while implementing)

We should not consider polymorphism and access rules at this stage

@ghaith ghaith added the enhancement New feature or request label Aug 10, 2021
@ghaith ghaith added this to the Object Oriented ST milestone Aug 10, 2021
@ghaith ghaith linked a pull request Aug 27, 2021 that will close this issue
@ghaith
Copy link
Collaborator Author

ghaith commented Aug 27, 2021

#253 covers most of this story.
We would still be missing the THIS pointer.

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

Successfully merging a pull request may close this issue.

1 participant