diff -r 3d682f87c870 -r dea39ef02847 stage1_2/iec_bison.yy --- a/stage1_2/iec_bison.yy Mon Feb 24 22:00:55 2014 +0000 +++ b/stage1_2/iec_bison.yy Sun Mar 02 16:42:56 2014 +0000 @@ -412,6 +412,8 @@ %type en_identifier %type eno_identifier +/* Keyword in IEC 61131-3 v3 */ +%token REF @@ -1290,6 +1292,7 @@ * are not required. Their values are integrated * directly into other rules... */ +%type ref_expression /* an extension to the IEC 61131-3 v2 standard, based on the IEC 61131-3 v3 standard */ %type expression %type xor_expression %type and_expression @@ -7057,6 +7060,7 @@ /***********************/ expression: xor_expression +| ref_expression /* an extension to the IEC 61131-3 v2 standard, based on the IEC 61131-3 v3 standard */ | expression OR xor_expression {$$ = new or_expression_c($1, $3, locloc(@$));} /* ERROR_CHECK_BEGIN */ @@ -7069,6 +7073,14 @@ /* ERROR_CHECK_END */ ; +/* REF(var_name) */ +/* This is an extension to the IEC 61131-3 standard. It is actually defined in the IEC 61131-3 v3 standard */ +/* The REF() operator returns the adrress of the variable. Basically, it returns a pointer to the variable */ +ref_expression: + REF '(' symbolic_variable ')' + {$$ = new ref_expression_c($3, locloc(@$));} +; + xor_expression: and_expression | xor_expression XOR and_expression