tests/syntax/identifier/identifier_as_variable2.test
author Edouard Tisserant <edouard.tisserant@gmail.com>
Fri, 05 Apr 2024 13:23:53 +0200
changeset 1103 f3c6c938d5ff
parent 108 f9e001952488
permissions -rwxr-xr-x
merge
108
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     1
(* Test whether the keyword XXXX may be used as an identifier for:
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     2
 * variable name/identifier
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     3
 *
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     4
 * The XXXX names in the following code are merely a placeholder.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     5
 * They will be replaced by several identifiers before actual testing
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     6
 * of the compiler.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     7
 *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     8
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     9
(* The identifiers that will replace the XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    10
 * must be placed on a line starting with #
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    11
 * All identifiers preceded by # are ignored!
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    12
 * The identifier list must be placed inside an IEC 61131-3 comment.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    13
 *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    14
(* This file is specific for identifiers NOT identical to IL operators.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    15
 *  See the note following the identifier list
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    16
 *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    17
(*
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    18
#IL_operators #ANDN #CAL #CALC #CALCN #CD #CLK #CU #IN #JMP #JMPC #JMPCN #LD #LDN #ORN 
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    19
#IL_operators #PT #PV #R #R1 #RET #RETC #RETCN #S #S1 #ST #STN #XORN
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    20
     NOTE: R and S are identical to IL operators!!
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    21
#SFC_qualifiers D DS L N P #R #S SD SL   
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    22
#Task_initialisers PRIORITY SINGLE INTERVAL
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    23
*)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    24
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    25
(* NOTE: The identifier as a variable test has some special cases.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    26
 *       Namely, when using IL operators as variable names.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    27
 *       Even though the syntax of the IL language would not result
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    28
 *       in ambiguities in the above case, our parser does not currently
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    29
 *       allow the use of variables (with names identical to IL
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    30
 *       operators) within IL code.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    31
 *
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    32
 *       The following test code must therefore consider two possibilities:
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    33
 *        - if the identifier under test is an IL operator
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    34
 *        - if the identifier under test is not an IL operator
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    35
 *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    36
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    37
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    38
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    39
(* A helper FUNCTION BLOCK declaration *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    40
function_block foo_fb
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    41
 var_input
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    42
  a_1, b_1: int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    43
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    44
 var_output
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    45
  c_1, d_1: int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    46
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    47
  c_1 := 10 + b_1;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    48
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    49
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    50
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    51
(* A helper FUNCTION declaration *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    52
function foo_f1 : int
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    53
 var_input
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    54
  a_1, b_1: int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    55
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    56
 var_output
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    57
  c_1, d_1: int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    58
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    59
  c_1 := 10 + b_1;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    60
end_function
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    61
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    62
(* Another helper FUNCTION declaration *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    63
function foo_f2 : int
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    64
 var_input
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    65
  a_1, b_1: foo_fb;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    66
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    67
 var_output
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    68
  c_1, d_1: int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    69
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    70
  c_1 := 10;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    71
end_function
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    72
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    73
(* Another helper FUNCTION declaration *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    74
function bar01 : int
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    75
 var_input
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    76
  XXXX, a_1, b_1: int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    77
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    78
 a_1 := 1;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    79
end_function
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    80
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    81
(* Another helper FUNCTION_BLOCK declaration *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    82
function_block bar91
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    83
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    84
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    85
  XXXX : foo_fb;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    86
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    87
  e_1 := 0;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    88
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    89
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    90
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    91
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    92
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    93
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    94
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    95
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    96
(* Using XXXX as a standard variable name in IL *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    97
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    98
(* NOTE: Currently not supported for identifiers identical to IL operators.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    99
 *       We therefore have two versions of this file, one with the following code
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   100
 *       commented out (used to test the identifiers that clash with IL operators)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   101
 *       and a second with the following code included (used to test identifiers
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   102
 *       that do not clash with IL operators, such as PRIORITY, SINGLE, etc...)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   103
 *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   104
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   105
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   106
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   107
function_block bar92
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   108
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   109
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   110
  XXXX : bool;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   111
  fb : foo_fb;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   112
  fb2 : bar91;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   113
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   114
 (* IL operators that - acording to the standard - are not keywords *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   115
 LD XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   116
 LDN XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   117
 ANDN XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   118
 ORN XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   119
 XORN XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   120
 R XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   121
 S XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   122
 ST XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   123
 STN XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   124
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   125
 (* IL operators that - acording to the standard - are also keywords *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   126
 AND XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   127
 OR XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   128
 XOR XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   129
 NOT XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   130
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   131
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   132
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   133
function_block bar93
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   134
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   135
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   136
  XXXX : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   137
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   138
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   139
 (* IL operators that - acording to the standard - are also keywords *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   140
 ADD XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   141
 SUB XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   142
 MUL XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   143
 DIV XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   144
 MOD XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   145
 GE XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   146
 GT XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   147
 LE XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   148
 LT XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   149
 EQ XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   150
 NE XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   151
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   152
 (* Calling function with input parameter named XXXX *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   153
 bar01 (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   154
  XXXX := 10
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   155
 )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   156
 bar01 (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   157
  a_1 := XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   158
 )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   159
 bar01 (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   160
  XXXX := XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   161
 )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   162
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   163
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   164
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   165
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   166
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   167
(* a helper function block *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   168
function_block bar94
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   169
 var_input
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   170
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   171
  XXXX : foo_fb;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   172
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   173
  e_1 := XXXX.c_1;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   174
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   175
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   176
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   177
function_block bar95
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   178
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   179
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   180
  XXXX : foo_fb;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   181
  fb_1 : bar93;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   182
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   183
 CAL XXXX(10)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   184
 CAL XXXX (e_1)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   185
 CAL XXXX (10, e_1, e_1, f_1)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   186
 CAL XXXX (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   187
    a_1 := 10,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   188
    b_1 := e_1,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   189
    c_1 => e_1,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   190
    d_1 => f_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   191
   )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   192
 CAL XXXX (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   193
    a_1 := 10,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   194
    c_1 => e_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   195
   )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   196
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   197
 CALC XXXX(10)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   198
 CALC XXXX (e_1)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   199
 CALC XXXX (10, e_1, e_1, f_1)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   200
 CALC XXXX (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   201
    a_1 := 10,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   202
    b_1 := e_1,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   203
    c_1 => e_1,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   204
    d_1 => f_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   205
   )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   206
 CALC XXXX (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   207
    a_1 := 10,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   208
    c_1 => e_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   209
   )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   210
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   211
 CALCN XXXX(10)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   212
 CALCN XXXX (e_1)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   213
 CALCN XXXX (10, e_1, e_1, f_1)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   214
 CALCN XXXX (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   215
    a_1 := 10,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   216
    b_1 := e_1,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   217
    c_1 => e_1,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   218
    d_1 => f_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   219
   )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   220
 CALCN XXXX (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   221
    a_1 := 10,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   222
    c_1 => e_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   223
   )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   224
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   225
 LD XXXX.a_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   226
 ST XXXX.b_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   227
 LD fb_1.XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   228
 ST fb_1.XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   229
 LD fb_1.XXXX.a_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   230
 ST fb_1.XXXX.a_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   231
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   232
 LD XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   233
 foo_f2 XXXX, e_1, f_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   234
 foo_f2 (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   235
    a_1 := XXXX,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   236
    b_1 := XXXX,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   237
    c_1 => e_1,
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   238
    d_1 => f_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   239
   )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   240
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   241
 (* Calling function with input parameter named XXXX *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   242
 bar01 (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   243
  XXXX := 10
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   244
 )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   245
 bar01 (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   246
  a_1 := XXXX.a_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   247
 )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   248
 bar01 (
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   249
  XXXX := XXXX.a_1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   250
 )
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   251
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   252
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   253
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   254
function_block bar96
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   255
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   256
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   257
  XXXX : CTUD;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   258
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   259
 CU XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   260
 CD XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   261
 PV XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   262
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   263
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   264
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   265
function_block bar97
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   266
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   267
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   268
  XXXX : R_TRIG;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   269
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   270
 CLK XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   271
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   272
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   273
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   274
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   275
function_block bar98
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   276
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   277
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   278
  XXXX : TP;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   279
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   280
 IN XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   281
 PT XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   282
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   283
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   284
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   285
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   286
function_block bar99
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   287
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   288
  e_1, f_1 : int;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   289
  XXXX : SR;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   290
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   291
 R1 XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   292
 S1 XXXX
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   293
end_function_block
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   294
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   295
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   296
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   297
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   298
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   299
(* Checking whether the use of XXXX will confuse any other
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   300
 * normal and correct IL or ST code.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   301
 *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   302
{#include "basic_code.test" }
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
   303