108

1 
(* Test whether the keyword XXXX may be used as an identifier for:


2 
* STEP, ACTION and TRANSITION name/identifier


3 
*


4 
* The XXXX names in the following code are merely a placeholder.


5 
* They will be replaced by several identifiers before actual testing


6 
* of the compiler.


7 
*)


8 


9 
(* The identifiers that will replace the XXXX


10 
* must be placed on a line starting with #


11 
* All identifiers preceded by # are ignored!


12 
* The identifier list must be placed inside an IEC 611313 comment.


13 
*)


14 
(*


15 
#IL_operators ANDN CAL CALC CALCN CD CLK CU IN JMP JMPC JMPCN


16 
#IL_operators LD LDN ORN PT PV R R1 RET RETC RETCN S S1 ST STN XORN


17 
#SFC_qualifiers D DS L N P #R #S SD SL


18 
NOTE: R and S are identical to IL operators!!


19 
#Task_initialisers PRIORITY SINGLE INTERVAL


20 
*)


21 


22 


23 


24 
(* Use of XXXX as a STEP identifier *)


25 


26 
PROGRAM bar01


27 
VAR


28 
IX1 AT %IX1 : BOOL;


29 
IX2 AT %IX2 : BOOL;


30 
IX3 AT %IX3 : BOOL;


31 
END_VAR


32 


33 
INITIAL_STEP XXXX:


34 
END_STEP


35 


36 
STEP STEP1:


37 
END_STEP


38 


39 
STEP STEP2:


40 
END_STEP


41 


42 
TRANSITION FROM XXXX TO STEP1


43 
:= IX1 = FALSE;


44 
END_TRANSITION


45 


46 
TRANSITION FROM STEP1 TO XXXX


47 
:= IX1 = TRUE;


48 
END_TRANSITION


49 


50 
TRANSITION (PRIORITY := 4) FROM XXXX TO STEP2


51 
:= IX2 = TRUE;


52 
END_TRANSITION


53 


54 
TRANSITION (PRIORITY := 4) FROM STEP2 TO XXXX


55 
:= IX2 = TRUE;


56 
END_TRANSITION


57 


58 
TRANSITION transition_id1 FROM STEP2 TO XXXX


59 
:= IX1 = FALSE AND IX3 = FALSE;


60 
END_TRANSITION


61 


62 
TRANSITION transition_id2 FROM XXXX TO STEP2


63 
:= IX1 = FALSE AND IX3 = FALSE;


64 
END_TRANSITION


65 


66 
TRANSITION transition_id3 (PRIORITY := 3) FROM XXXX TO STEP2


67 
:= IX3 = TRUE;


68 
END_TRANSITION


69 


70 
TRANSITION transition_id4 (PRIORITY := 5) FROM STEP2 TO XXXX


71 
:= IX3 = TRUE;


72 
END_TRANSITION


73 


74 
TRANSITION FROM (XXXX, STEP2) TO STEP1


75 
:= IX1 = FALSE;


76 
END_TRANSITION


77 


78 
TRANSITION FROM (STEP2, XXXX) TO STEP1


79 
:= IX2 = FALSE;


80 
END_TRANSITION


81 


82 
TRANSITION FROM STEP1 TO (XXXX, STEP2)


83 
:= IX1 = TRUE;


84 
END_TRANSITION


85 


86 
TRANSITION FROM STEP1 TO (STEP2, XXXX)


87 
:= IX2 = TRUE;


88 
END_TRANSITION


89 
END_PROGRAM


90 


91 


92 


93 


94 
(* Use of XXXX as a TRANSITION identifier *)


95 


96 
PROGRAM bar02


97 
VAR


98 
IX1 AT %IX1 : BOOL;


99 
END_VAR


100 


101 
INITIAL_STEP GO:


102 
END_STEP


103 


104 
STEP STEP1:


105 
END_STEP


106 


107 
TRANSITION XXXX FROM GO TO STEP1


108 
:= IX1 = FALSE AND IX3 = FALSE;


109 
END_TRANSITION


110 
END_PROGRAM


111 


112 


113 


114 


115 
PROGRAM bar03


116 
VAR


117 
IX1 AT %IX1 : BOOL;


118 
END_VAR


119 


120 
INITIAL_STEP GO:


121 
END_STEP


122 


123 
STEP STEP1:


124 
END_STEP


125 


126 
TRANSITION XXXX (PRIORITY := 3) FROM GO TO STEP1


127 
:= IX3 = TRUE;


128 
END_TRANSITION


129 
END_PROGRAM


130 


131 


132 


133 


134 


135 
(* Use of XXXX as an ACTION identifier *)


136 


137 


138 
PROGRAM bar20


139 
VAR


140 
QX1 : BOOL := 1;


141 
QX2 : BOOL := 0;


142 
QX3 : BOOL;


143 
IX1 : BOOL;


144 
IX2 : BOOL;


145 
IX3 : BOOL;


146 
delta_1 : TIME := T#1s;


147 
END_VAR


148 


149 
INITIAL_STEP GO:


150 
END_STEP


151 
STEP STEP1:


152 
XXXX ();


153 
END_STEP


154 


155 
TRANSITION FROM GO TO STEP1


156 
:= IX1 = FALSE;


157 
END_TRANSITION


158 


159 
ACTION XXXX:


160 
QX1 := TRUE;


161 
QX2 := TRUE;


162 
END_ACTION


163 
END_PROGRAM


164 


165 


166 


167 


168 


169 
PROGRAM bar21


170 
VAR


171 
QX1 : BOOL := 1;


172 
QX2 : BOOL := 0;


173 
QX3 : BOOL;


174 
IX1 : BOOL;


175 
IX2 : BOOL;


176 
IX3 : BOOL;


177 
delta_1 : TIME := T#1s;


178 
END_VAR


179 


180 
INITIAL_STEP GO:


181 
END_STEP


182 


183 
STEP STEP1:


184 
XXXX(N);


185 
END_STEP


186 


187 
TRANSITION FROM GO TO STEP1


188 
:= IX1 = FALSE;


189 
END_TRANSITION


190 


191 
ACTION XXXX:


192 
QX1 := TRUE;


193 
QX2 := TRUE;


194 
END_ACTION


195 
END_PROGRAM


196 


197 


198 


199 


200 


201 


202 
PROGRAM bar22


203 
VAR


204 
QX1 : BOOL := 1;


205 
QX2 : BOOL := 0;


206 
QX3 : BOOL;


207 
IX1 : BOOL;


208 
IX2 : BOOL;


209 
IX3 : BOOL;


210 
delta_1 : TIME := T#1s;


211 
END_VAR


212 


213 
INITIAL_STEP GO:


214 
END_STEP


215 


216 
STEP STEP1:


217 
XXXX(P);


218 
END_STEP


219 


220 
TRANSITION FROM GO TO STEP1


221 
:= IX1 = FALSE;


222 
END_TRANSITION


223 


224 
ACTION XXXX:


225 
QX1 := TRUE;


226 
QX2 := TRUE;


227 
END_ACTION


228 
END_PROGRAM


229 


230 


231 


232 


233 


234 


235 


236 
PROGRAM bar23


237 
VAR


238 
QX1 : BOOL := 1;


239 
QX2 : BOOL := 0;


240 
QX3 : BOOL;


241 
IX1 : BOOL;


242 
IX2 : BOOL;


243 
IX3 : BOOL;


244 
delta_1 : TIME := T#1s;


245 
END_VAR


246 


247 
INITIAL_STEP GO:


248 
END_STEP


249 


250 
STEP STEP1:


251 
XXXX(R);


252 
END_STEP


253 


254 
TRANSITION FROM GO TO STEP1


255 
:= IX1 = FALSE;


256 
END_TRANSITION


257 


258 
ACTION XXXX:


259 
QX1 := TRUE;


260 
QX2 := TRUE;


261 
END_ACTION


262 
END_PROGRAM


263 


264 


265 


266 


267 


268 


269 


270 


271 


272 
PROGRAM bar24


273 
VAR


274 
QX1 : BOOL := 1;


275 
QX2 : BOOL := 0;


276 
QX3 : BOOL;


277 
IX1 : BOOL;


278 
IX2 : BOOL;


279 
IX3 : BOOL;


280 
delta_1 : TIME := T#1s;


281 
END_VAR


282 


283 
INITIAL_STEP GO:


284 
END_STEP


285 


286 
STEP STEP1:


287 
XXXX(S);


288 
END_STEP


289 


290 
TRANSITION FROM GO TO STEP1


291 
:= IX1 = FALSE;


292 
END_TRANSITION


293 


294 
ACTION XXXX:


295 
QX1 := TRUE;


296 
QX2 := TRUE;


297 
END_ACTION


298 
END_PROGRAM


299 


300 


301 


302 


303 


304 


305 


306 


307 
PROGRAM bar25


308 
VAR


309 
QX1 : BOOL := 1;


310 
QX2 : BOOL := 0;


311 
QX3 : BOOL;


312 
IX1 : BOOL;


313 
IX2 : BOOL;


314 
IX3 : BOOL;


315 
delta_1 : TIME := T#1s;


316 
END_VAR


317 


318 
INITIAL_STEP GO:


319 
END_STEP


320 


321 
STEP STEP1:


322 
XXXX(D, T#1s);


323 
END_STEP


324 


325 
TRANSITION FROM GO TO STEP1


326 
:= IX1 = FALSE;


327 
END_TRANSITION


328 


329 
ACTION XXXX:


330 
QX1 := TRUE;


331 
QX2 := TRUE;


332 
END_ACTION


333 
END_PROGRAM


334 


335 


336 


337 


338 


339 


340 


341 


342 
PROGRAM bar26


343 
VAR


344 
QX1 : BOOL := 1;


345 
QX2 : BOOL := 0;


346 
QX3 : BOOL;


347 
IX1 : BOOL;


348 
IX2 : BOOL;


349 
IX3 : BOOL;


350 
delta_1 : TIME := T#1s;


351 
END_VAR


352 


353 
INITIAL_STEP GO:


354 
END_STEP


355 


356 
STEP STEP1:


357 
XXXX(L, T#1s);


358 
END_STEP


359 


360 
TRANSITION FROM GO TO STEP1


361 
:= IX1 = FALSE;


362 
END_TRANSITION


363 


364 
ACTION XXXX:


365 
QX1 := TRUE;


366 
QX2 := TRUE;


367 
END_ACTION


368 
END_PROGRAM


369 


370 


371 


372 


373 


374 


375 
PROGRAM bar27


376 
VAR


377 
QX1 : BOOL := 1;


378 
QX2 : BOOL := 0;


379 
QX3 : BOOL;


380 
IX1 : BOOL;


381 
IX2 : BOOL;


382 
IX3 : BOOL;


383 
delta_1 : TIME := T#1s;


384 
END_VAR


385 


386 
INITIAL_STEP GO:


387 
END_STEP


388 


389 
STEP STEP1:


390 
XXXX(DS, T#1s);


391 
END_STEP


392 


393 
TRANSITION FROM GO TO STEP1


394 
:= IX1 = FALSE;


395 
END_TRANSITION


396 


397 
ACTION XXXX:


398 
QX1 := TRUE;


399 
QX2 := TRUE;


400 
END_ACTION


401 
END_PROGRAM


402 


403 


404 


405 


406 


407 


408 


409 


410 
PROGRAM bar28


411 
VAR


412 
QX1 : BOOL := 1;


413 
QX2 : BOOL := 0;


414 
QX3 : BOOL;


415 
IX1 : BOOL;


416 
IX2 : BOOL;


417 
IX3 : BOOL;


418 
delta_1 : TIME := T#1s;


419 
END_VAR


420 


421 
INITIAL_STEP GO:


422 
END_STEP


423 


424 
STEP STEP1:


425 
XXXX(SD, T#1s);


426 
END_STEP


427 


428 
TRANSITION FROM GO TO STEP1


429 
:= IX1 = FALSE;


430 
END_TRANSITION


431 


432 
ACTION XXXX:


433 
QX1 := TRUE;


434 
QX2 := TRUE;


435 
END_ACTION


436 
END_PROGRAM


437 


438 


439 


440 


441 


442 


443 


444 


445 
PROGRAM bar29


446 
VAR


447 
QX1 : BOOL := 1;


448 
QX2 : BOOL := 0;


449 
QX3 : BOOL;


450 
IX1 : BOOL;


451 
IX2 : BOOL;


452 
IX3 : BOOL;


453 
delta_1 : TIME := T#1s;


454 
END_VAR


455 


456 
INITIAL_STEP GO:


457 
END_STEP


458 


459 
STEP STEP1:


460 
XXXX(SL, T#1s);


461 
END_STEP


462 


463 
TRANSITION FROM GO TO STEP1


464 
:= IX1 = FALSE;


465 
END_TRANSITION


466 


467 
ACTION XXXX:


468 
QX1 := TRUE;


469 
QX2 := TRUE;


470 
END_ACTION


471 
END_PROGRAM


472 


473 


474 


475 


476 


477 


478 


479 


480 
PROGRAM bar30


481 
VAR


482 
QX1 : BOOL := 1;


483 
QX2 : BOOL := 0;


484 
QX3 : BOOL;


485 
IX1 : BOOL;


486 
IX2 : BOOL;


487 
IX3 : BOOL;


488 
delta_1 : TIME := T#1s;


489 
END_VAR


490 


491 
INITIAL_STEP GO:


492 
END_STEP


493 


494 
STEP STEP1:


495 
XXXX(L, delta_1);


496 
END_STEP


497 


498 
TRANSITION FROM GO TO STEP1


499 
:= IX1 = FALSE;


500 
END_TRANSITION


501 


502 
ACTION XXXX:


503 
QX1 := TRUE;


504 
QX2 := TRUE;


505 
END_ACTION


506 
END_PROGRAM


507 


508 


509 


510 


511 


512 


513 


514 


515 
PROGRAM bar31


516 
VAR


517 
QX1 : BOOL := 1;


518 
QX2 : BOOL := 0;


519 
QX3 : BOOL;


520 
IX1 : BOOL;


521 
IX2 : BOOL;


522 
IX3 : BOOL;


523 
delta_1 : TIME := T#1s;


524 
END_VAR


525 


526 
INITIAL_STEP GO:


527 
END_STEP


528 


529 
STEP STEP1:


530 
XXXX(L, delta_1, IX1, QX1);


531 
END_STEP


532 


533 
TRANSITION FROM GO TO STEP1


534 
:= IX1 = FALSE;


535 
END_TRANSITION


536 


537 
ACTION XXXX:


538 
QX1 := TRUE;


539 
QX2 := TRUE;


540 
END_ACTION


541 
END_PROGRAM


542 


543 


544 


545 


546 


547 


548 
PROGRAM bar32


549 
VAR


550 
QX1 : BOOL := 1;


551 
QX2 : BOOL := 0;


552 
QX3 : BOOL;


553 
IX1 : BOOL;


554 
IX2 : BOOL;


555 
IX3 : BOOL;


556 
delta_1 : TIME := T#1s;


557 
END_VAR


558 


559 
INITIAL_STEP GO:


560 
END_STEP


561 


562 
STEP STEP1:


563 
INLINE1 ();


564 
XXXX(L, delta_1, IX1, QX1);


565 
INLINE2 ();


566 
END_STEP


567 


568 
STEP STEP2:


569 
XXXX(L, delta_1, IX1, QX1);


570 
INLINE1 ();


571 
INLINE2 ();


572 
END_STEP


573 


574 
STEP STEP3:


575 
INLINE1 ();


576 
INLINE2 ();


577 
XXXX(L, delta_1, IX1, QX1);


578 
END_STEP


579 


580 
TRANSITION FROM GO TO STEP1


581 
:= IX1 = FALSE;


582 
END_TRANSITION


583 


584 
ACTION XXXX:


585 
QX1 := TRUE;


586 
QX2 := TRUE;


587 
END_ACTION


588 


589 
ACTION INLINE1:


590 
IX1 := TRUE;


591 
END_ACTION


592 


593 
ACTION INLINE2:


594 
IX1 := TRUE;


595 
END_ACTION


596 
END_PROGRAM


597 


598 


599 


600 


601 


602 


603 


604 


605 


606 


607 
(* Checking whether the use of XXXX will confuse any other


608 
* normal and correct IL or ST code.


609 
*)


610 
{#include "basic_code.test" }


611 
