tests/syntax/identifier/identifier_as_enumerationvalue.test
author Manuele Conti <conti.ma@alice.it>
Mon, 30 Jul 2012 22:59:00 +0200
changeset 622 eaa49b276e17
parent 108 f9e001952488
permissions -rwxr-xr-x
Add check bison version in configure.ac file.
To build correctly matiec we need bison greater or equals than 2.4 version.
Now the "configure" script is able to check if system has correctly requirements.
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
 * enumeration value
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
(*
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    15
#IL_operators ANDN CAL CALC CALCN CD CLK CU IN JMP JMPC JMPCN LD LDN ORN PT PV R R1 RET RETC RETCN S S1 ST STN XORN
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    16
#SFC_qualifiers D DS L N P #R #S SD SL
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    17
     NOTE: R and S are identical to IL operators!!
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    18
#Task_initialisers PRIORITY SINGLE INTERVAL
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    19
*)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    20
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    21
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    22
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
TYPE
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    25
 enum_type00 : (enum_v1, XXXX, enum_v2) := XXXX;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    26
END_TYPE
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    27
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    28
TYPE
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    29
 enum_type01 : (XXXX, enum_v2) := XXXX;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    30
END_TYPE
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
TYPE
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    33
 enum_type02 : (enum_v1, XXXX) := XXXX;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    34
END_TYPE
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
TYPE
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    37
 enum_type03 : (XXXX) := XXXX;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    38
END_TYPE
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    39
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    40
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    41
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    42
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    43
function foo : int
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    44
 var_input
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    45
  a_1, b_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
 var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    48
  c_1, d_1: enum_type00;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    49
 end_var
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    50
  c_1 := enum_type00#XXXX;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    51
  c_1 := XXXX;
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    52
end_function
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    53
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    54
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    55
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    56
(* Checking whether the use of XXXX will confuse any other
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    57
 * normal and correct IL or ST code.
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    58
 *)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    59
{#include "basic_code.test" }
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    60