Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[4diac-dev] 4diac-ide: ST-array declaration syntax

Good morning everyone,

while working on the exporter i stumbled across the array declaration
syntax used in 4diac. The current implementation resembles the C-Syntax
for declaring arrays. This is different to what the standard describes.

The current syntax for declaring a BOOL-Array with 32 elements is as
follows:
VAR
  BoolArray : BOOL [32];
END_VAR

The way it is described in the standard it should read
VAR
    BoolArray : ARRAY [0..31] OF BOOL;
END_VAR

This also allows to declare the range of the array to be not from 0-31
but any available range (e.g. 5-7).

Now my questions are:

Should we switch to the official way of declaring arrays?
If we switch over, should the "old" way still be supported?
If the "old" way will still be supported - should we have a switch (i.e.
pragma) to disable the legacy option?
If we switch over, should interface variables also allow to declare the
range of the array?


Best regards,

Ernst Blecha


-- 

Ernst Blecha
LIT | Cyber-Physical Systems Lab

JOHANNES KEPLER
UNIVERSITY LINZ
Altenberger Straße 69
LIT Open Innovation Center
4040 Linz, Austria
ernst.blecha@xxxxxx
www.jku.at
 



Back to the top