CFCLexHeader fixes - Include charmony.h on top to fix Windows warnings. - Rerun flex with --nounistd and --header-file.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/ade0c09c Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/ade0c09c Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/ade0c09c Branch: refs/heads/master Commit: ade0c09ccb8f7d944167799d5b1785f0153c36a9 Parents: 99b59a9 Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Sat Jul 25 16:56:22 2015 +0200 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Sat Jul 25 16:56:22 2015 +0200 ---------------------------------------------------------------------- compiler/src/CFCLexHeader.c | 85 ++++++++++++++++++++-------------------- compiler/src/CFCLexHeader.h | 29 ++++++++------ compiler/src/CFCLexHeader.l | 5 +++ 3 files changed, 64 insertions(+), 55 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/ade0c09c/compiler/src/CFCLexHeader.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCLexHeader.c b/compiler/src/CFCLexHeader.c index be6bfb0..96b5b82 100644 --- a/compiler/src/CFCLexHeader.c +++ b/compiler/src/CFCLexHeader.c @@ -1,5 +1,11 @@ +#line 2 "../src/CFCLexHeader.c" +#line 18 "../src/CFCLexHeader.l" + /* Avoid redefinition of integer limits on platforms without inttypes.h. */ + #include "charmony.h" + -#line 3 "<stdout>" + +#line 9 "../src/CFCLexHeader.c" #define YY_INT_ALIGNED short int @@ -557,7 +563,8 @@ char *yytext; * See the License for the specific language governing permissions and * limitations under the License. */ -#line 18 "../src/CFCLexHeader.l" + +#line 23 "../src/CFCLexHeader.l" #include "CFC.h" #include "CFCParseHeader.h" @@ -632,19 +639,11 @@ char *yytext; } #define YY_NO_INPUT 1 -#line 636 "<stdout>" +#line 643 "../src/CFCLexHeader.c" #define INITIAL 0 #define CBLOCK 1 -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif @@ -845,9 +844,9 @@ YY_DECL } { -#line 101 "../src/CFCLexHeader.l" +#line 106 "../src/CFCLexHeader.l" -#line 851 "<stdout>" +#line 850 "../src/CFCLexHeader.c" while ( 1 ) /* loops until end-of-file is reached */ { @@ -912,140 +911,140 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 102 "../src/CFCLexHeader.l" +#line 107 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_SCOPE_OP); } YY_BREAK case 2: YY_RULE_SETUP -#line 103 "../src/CFCLexHeader.l" +#line 108 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_ASTERISK); } YY_BREAK case 3: YY_RULE_SETUP -#line 104 "../src/CFCLexHeader.l" +#line 109 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_LEFT_CURLY_BRACE); } YY_BREAK case 4: YY_RULE_SETUP -#line 105 "../src/CFCLexHeader.l" +#line 110 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_RIGHT_CURLY_BRACE); } YY_BREAK case 5: YY_RULE_SETUP -#line 106 "../src/CFCLexHeader.l" +#line 111 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_LEFT_SQUARE_BRACKET); } YY_BREAK case 6: YY_RULE_SETUP -#line 107 "../src/CFCLexHeader.l" +#line 112 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_RIGHT_SQUARE_BRACKET); } YY_BREAK case 7: YY_RULE_SETUP -#line 108 "../src/CFCLexHeader.l" +#line 113 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_LEFT_PAREN); } YY_BREAK case 8: YY_RULE_SETUP -#line 109 "../src/CFCLexHeader.l" +#line 114 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_RIGHT_PAREN); } YY_BREAK case 9: YY_RULE_SETUP -#line 110 "../src/CFCLexHeader.l" +#line 115 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_ELLIPSIS); } YY_BREAK case 10: YY_RULE_SETUP -#line 111 "../src/CFCLexHeader.l" +#line 116 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_COMMA); } YY_BREAK case 11: YY_RULE_SETUP -#line 112 "../src/CFCLexHeader.l" +#line 117 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_SEMICOLON); } YY_BREAK case 12: YY_RULE_SETUP -#line 113 "../src/CFCLexHeader.l" +#line 118 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_EQUALS); } YY_BREAK case 13: YY_RULE_SETUP -#line 115 "../src/CFCLexHeader.l" +#line 120 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_HEX_LITERAL); } YY_BREAK case 14: YY_RULE_SETUP -#line 116 "../src/CFCLexHeader.l" +#line 121 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_FLOAT_LITERAL); } YY_BREAK case 15: YY_RULE_SETUP -#line 117 "../src/CFCLexHeader.l" +#line 122 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_INTEGER_LITERAL); } YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP -#line 118 "../src/CFCLexHeader.l" +#line 123 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_STRING_LITERAL); } YY_BREAK case 17: YY_RULE_SETUP -#line 120 "../src/CFCLexHeader.l" +#line 125 "../src/CFCLexHeader.l" { PARSE(S_identifier_or_keyword(yytext)); } YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP -#line 122 "../src/CFCLexHeader.l" +#line 127 "../src/CFCLexHeader.l" { BEGIN(CBLOCK); PARSE(CFC_TOKENTYPE_CBLOCK_START); } YY_BREAK case 19: YY_RULE_SETUP -#line 123 "../src/CFCLexHeader.l" +#line 128 "../src/CFCLexHeader.l" { BEGIN(INITIAL); PARSE(CFC_TOKENTYPE_CBLOCK_CLOSE); } YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP -#line 124 "../src/CFCLexHeader.l" +#line 129 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_BLOB); } YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP -#line 125 "../src/CFCLexHeader.l" +#line 130 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_BLOB); } YY_BREAK case 22: YY_RULE_SETUP -#line 126 "../src/CFCLexHeader.l" +#line 131 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_BLOB); } YY_BREAK /* Parse docucomments, but skip ordinary comments */ case 23: /* rule 23 can match eol */ YY_RULE_SETUP -#line 129 "../src/CFCLexHeader.l" +#line 134 "../src/CFCLexHeader.l" { PARSE(CFC_TOKENTYPE_DOCUCOMMENT); } YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP -#line 130 "../src/CFCLexHeader.l" +#line 135 "../src/CFCLexHeader.l" YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 132 "../src/CFCLexHeader.l" +#line 137 "../src/CFCLexHeader.l" /* Skip whitespace. */ YY_BREAK case 26: YY_RULE_SETUP -#line 133 "../src/CFCLexHeader.l" +#line 138 "../src/CFCLexHeader.l" { printf("Bad input character '%s' at line %d\n", yytext, yylineno); yyterminate(); @@ -1053,15 +1052,15 @@ YY_RULE_SETUP YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(CBLOCK): -#line 137 "../src/CFCLexHeader.l" +#line 142 "../src/CFCLexHeader.l" { yyterminate(); } YY_BREAK case 27: YY_RULE_SETUP -#line 138 "../src/CFCLexHeader.l" +#line 143 "../src/CFCLexHeader.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1065 "<stdout>" +#line 1064 "../src/CFCLexHeader.c" case YY_END_OF_BUFFER: { @@ -2026,7 +2025,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 137 "../src/CFCLexHeader.l" +#line 142 "../src/CFCLexHeader.l" http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/ade0c09c/compiler/src/CFCLexHeader.h ---------------------------------------------------------------------- diff --git a/compiler/src/CFCLexHeader.h b/compiler/src/CFCLexHeader.h index aa205d7..b17b207 100644 --- a/compiler/src/CFCLexHeader.h +++ b/compiler/src/CFCLexHeader.h @@ -3,8 +3,13 @@ #define yyIN_HEADER 1 #line 6 "../src/CFCLexHeader.h" +#line 18 "../src/CFCLexHeader.l" + /* Avoid redefinition of integer limits on platforms without inttypes.h. */ + #include "charmony.h" -#line 8 "../src/CFCLexHeader.h" + + +#line 13 "../src/CFCLexHeader.h" #define YY_INT_ALIGNED short int @@ -13,7 +18,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -131,15 +136,15 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int yyleng; - -extern FILE *yyin, *yyout; - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif +extern yy_size_t yyleng; + +extern FILE *yyin, *yyout; + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -157,7 +162,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -201,7 +206,7 @@ void yypop_buffer_state (void ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -209,7 +214,7 @@ void yyfree (void * ); /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap() 1 #define YY_SKIP_YYWRAP extern int yylineno; @@ -248,7 +253,7 @@ FILE *yyget_out (void ); void yyset_out (FILE * out_str ); -int yyget_leng (void ); +yy_size_t yyget_leng (void ); char *yyget_text (void ); @@ -320,9 +325,9 @@ extern int yylex (void); #undef YY_DECL #endif -#line 136 "../src/CFCLexHeader.l" +#line 142 "../src/CFCLexHeader.l" -#line 327 "../src/CFCLexHeader.h" +#line 332 "../src/CFCLexHeader.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/ade0c09c/compiler/src/CFCLexHeader.l ---------------------------------------------------------------------- diff --git a/compiler/src/CFCLexHeader.l b/compiler/src/CFCLexHeader.l index f325563..e2ea44a 100644 --- a/compiler/src/CFCLexHeader.l +++ b/compiler/src/CFCLexHeader.l @@ -14,6 +14,11 @@ * limitations under the License. */ +%top{ + /* Avoid redefinition of integer limits on platforms without inttypes.h. */ + #include "charmony.h" +} + %{ #include "CFC.h" #include "CFCParseHeader.h"