# HG changeset patch # User Mario de Sousa # Date 1328101268 0 # Node ID 0c2ef191b22a0478c768aae40f9d5b256d8cc70b # Parent 5c115720149cee6c1adaab5680d8a5c10dd9fd9f# Parent 85151b2f35cafae7a5d2fffe55093b5e97a0e9ad Merging with Laurent's repository. diff -r 85151b2f35ca -r 0c2ef191b22a stage1_2/iec_bison.yy --- a/stage1_2/iec_bison.yy Wed Jan 25 01:16:30 2012 +0100 +++ b/stage1_2/iec_bison.yy Wed Feb 01 13:01:08 2012 +0000 @@ -250,17 +250,9 @@ * declared twice. * We therefore use the #if !defined YYLTYPE ... * to make sure only the first declaration is parsed by the C++ compiler. - * - * At first glance it seems that what we really should do is delcare the - * YYLTYPE directly as an anonymous struct, thus: - * #define YYLTYPE struct{ ...} - * however, this also results in compilation errors. - * - * I (Mario) think this is kind of a hack. If you know how to - * do this re-declaration of YYLTYPE properly, please let me know! */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED - typedef struct { +typedef struct YYLTYPE { int first_line; int first_column; const char *first_file; @@ -269,9 +261,11 @@ int last_column; const char *last_file; long int last_order; - } yyltype__local; - #define YYLTYPE yyltype__local +} YYLTYPE; +#define YYLTYPE_IS_DECLARED 1 +#define YYLTYPE_IS_TRIVIAL 1 #endif + } diff -r 85151b2f35ca -r 0c2ef191b22a stage1_2/iec_flex.ll --- a/stage1_2/iec_flex.ll Wed Jan 25 01:16:30 2012 +0100 +++ b/stage1_2/iec_flex.ll Wed Feb 01 13:01:08 2012 +0000 @@ -171,8 +171,9 @@ * track of the locations, in order to give * more meaningful error messages! */ -extern YYLTYPE yylloc; - +/* + *extern YYLTYPE yylloc; +b*/ #define YY_INPUT(buf,result,max_size) {\ result = GetNextChar(buf, max_size);\ if ( result <= 0 )\ @@ -208,7 +209,6 @@ current_order++; \ } - /* Since this lexical parser we defined only works in ASCII based * systems, we might as well make sure it is being compiled on * one... diff -r 85151b2f35ca -r 0c2ef191b22a stage3/TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage3/TODO Wed Feb 01 13:01:08 2012 +0000 @@ -0,0 +1,13 @@ + + + Things that we must still check for in stage 3: + + +1) Handling of CONSTANTs: + + 1.a) "Any program organization unit attempts to modify the value of a variable that has been declared with the CONSTANT qualifier;" + 1.b) From table 16.a "The CONSTANT qualifier shall not be used in the declaration of function block instances as described in 2.5.2.1." + + + +