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 parsing the address reference anywhere in the body #621

Closed
Tracked by #646
rarris opened this issue Oct 28, 2022 · 1 comment · Fixed by #651
Closed
Tracked by #646

Support for parsing the address reference anywhere in the body #621

rarris opened this issue Oct 28, 2022 · 1 comment · Fixed by #651
Labels
enhancement New feature or request language feature (norm) a missing language feature according to iec61131-3 small-part Only part of a bigger feature (is tracked)

Comments

@rarris
Copy link
Contributor

rarris commented Oct 28, 2022

channel addresses are not supported in the rusty compiler

examples:
%IX
%QX
%GD

console errors:
error: Unexpected token: expected Literal but found %IX
error: Unexpected token: expected KeywordParensClose but found '%IX6.1'

@rarris rarris added the bug Something isn't working label Oct 28, 2022
@rarris rarris changed the title channel address not supported channel address is not supported Oct 28, 2022
@ghaith ghaith added enhancement New feature or request language feature (norm) a missing language feature according to iec61131-3 and removed bug Something isn't working labels Nov 10, 2022
@ghaith
Copy link
Collaborator

ghaith commented Nov 14, 2022

I think we will support this in several steps:

  • Support for parsing the address reference anywhere in the body
  • A new AST element is created, but the codegen will replace its value with 0
  • Support for defining new address regions
  • Regions can be defined as M<Size>, G<Size> or with simply a number
  • The M region are locally shared data
  • The G region are globally shared data, this region can be defined from the outside
  • Numbered regions represent hardware, they can be accessed by either the I or Q symbols (%IX1.2) will access region 1 starting from bit 2
  • Access into an address region will result in a pointer access
  • A region in the body is simply a pointer access to that region defined by the rules of access (%MX2 is accessing bit 2 of the locally shared data)
  • A region accessed in a variable declaration with AT marks that the variable being declared is an auto pointer to that location.

@ghaith ghaith mentioned this issue Nov 14, 2022
3 tasks
@ghaith ghaith changed the title channel address is not supported Support for parsing the address reference anywhere in the body Nov 14, 2022
@ghaith ghaith linked a pull request Nov 14, 2022 that will close this issue
@riederm riederm added the small-part Only part of a bigger feature (is tracked) label Nov 15, 2022
@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 language feature (norm) a missing language feature according to iec61131-3 small-part Only part of a bigger feature (is tracked)
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants