tests/syntax/identifier/identifier_as_label.test
changeset 108 f9e001952488
equal deleted inserted replaced
107:ff5c92df0c78 108:f9e001952488
       
     1 (* Test whether the keyword XXXX may be used as an identifier for:
       
     2  * IL label 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 61131-3 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 (* NOTE: Currently the matiec compiler does not yet support
       
    23  *       the use of identifiers identical to IL operators
       
    24  *       in IL code. In ther words, in IL code we cannot use 
       
    25  *       identifiers identical to IL operators to identify variables,
       
    26  *       functions, etc...
       
    27  *       Identifiers identical to IL operators are therefore
       
    28  *       commented out.
       
    29  *)
       
    30 
       
    31 
       
    32 
       
    33 
       
    34 
       
    35 function foo : int
       
    36  var
       
    37   e, f : bool;
       
    38  end_var
       
    39 
       
    40  XXXX: R e
       
    41   JMP XXXX
       
    42 end_function
       
    43 
       
    44 
       
    45 
       
    46 function bar : int
       
    47  var
       
    48   e, f : bool;
       
    49  end_var
       
    50 
       
    51   JMP XXXX
       
    52  XXXX: R e
       
    53 end_function
       
    54 
       
    55 
       
    56 
       
    57 
       
    58 
       
    59 
       
    60 
       
    61 (* Checking whether the use of XXXX will confuse any other
       
    62  * normal and correct IL or ST code.
       
    63  *)
       
    64 {#include "basic_code.test" }
       
    65