PLC-lang / rusty

Structured Text Parser and LLVM Frontend
GNU Lesser General Public License v3.0
203 stars 52 forks source link

Allow definition of external variables #406

Closed ghaith closed 2 years ago

ghaith commented 2 years ago

Is your feature request related to a problem? Please describe. In addition to external functions, we should support externally defined variables that could then be used in code. Examples of such variables could be the stdout and stderr variables or global variables defined in other libraries/projects

Describe the solution you'd like I propose allowing the @EXTERNAL keyword to be used on a VAR_GLOBAL keyword. All variables in that block will then be external.

Additional context The IEC61131-3 has a VAR_EXTERNAL block. This is, however, not intended for externally defined variables, but to explicitly state the variables that a certain POU will access from different POUs or global variables

create-issue-branch[bot] commented 2 years ago

Branch issue-406-Allow_definition_of_external_variables created!