diff options
Diffstat (limited to 'pbx/ael')
-rw-r--r-- | pbx/ael/ael-test/ael-vtest25/extensions.ael | 8 | ||||
-rw-r--r-- | pbx/ael/ael-test/ref.ael-test6 | 25 | ||||
-rw-r--r-- | pbx/ael/ael-test/ref.ael-vtest25 | 7 | ||||
-rw-r--r-- | pbx/ael/ael.flex | 180 | ||||
-rw-r--r-- | pbx/ael/ael_lex.c | 1098 |
5 files changed, 876 insertions, 442 deletions
diff --git a/pbx/ael/ael-test/ael-vtest25/extensions.ael b/pbx/ael/ael-test/ael-vtest25/extensions.ael new file mode 100644 index 000000000..f6d19d7b3 --- /dev/null +++ b/pbx/ael/ael-test/ael-vtest25/extensions.ael @@ -0,0 +1,8 @@ +context test11 { + 841 => { + &test234("testing", ${CUT(EXTEN,,3)}); + jump ${DB(uri/${uri_string})}; + Set(line=${DB(uri/${uri_string})}); + jump ${line}; + } +} diff --git a/pbx/ael/ael-test/ref.ael-test6 b/pbx/ael/ael-test/ref.ael-test6 index d63a78610..3965fa4da 100644 --- a/pbx/ael/ael-test/ref.ael-test6 +++ b/pbx/ael/ael-test/ref.ael-test6 @@ -2,16 +2,15 @@ (If you find progress and other non-error messages irritating, you can use -q to suppress them) (You can use the -w option to dump extensions.conf format to extensions.conf.aeldump) -LOG: lev:2 file:pbx_ael.c line:3978 func: pbx_load_module Starting AEL load process. -LOG: lev:2 file:pbx_ael.c line:3985 func: pbx_load_module AEL load process: calculated config file name './extensions.ael'. -LOG: lev:4 file:ael.flex line:276 func: ael_yylex File=./extensions.ael, line=165, column=49: Mismatched '}' in expression! -LOG: lev:4 file:ael.y line:755 func: ael_yyerror ==== File: ./extensions.ael, Line 165, Cols: 51-51: Error: syntax error, unexpected '=', expecting ')' -LOG: lev:4 file:ael.flex line:276 func: ael_yylex File=./extensions.ael, line=174, column=49: Mismatched '}' in expression! -LOG: lev:4 file:ael.y line:755 func: ael_yyerror ==== File: ./extensions.ael, Line 174, Cols: 51-51: Error: syntax error, unexpected '=', expecting ')' -LOG: lev:4 file:ael.flex line:276 func: ael_yylex File=./extensions.ael, line=222, column=41: Mismatched '}' in expression! -LOG: lev:4 file:ael.y line:755 func: ael_yyerror ==== File: ./extensions.ael, Line 222, Cols: 43-43: Error: syntax error, unexpected '=', expecting ')' -LOG: lev:4 file:ael.y line:755 func: ael_yyerror ==== File: ./extensions.ael, Line 291, Cols: 21-28: Error: syntax error, unexpected word, expecting '(' or ';' or '=' or ':' -LOG: lev:4 file:ael.y line:755 func: ael_yyerror ==== File: ./extensions.ael, Line 291, Cols: 32-32: Error: syntax error, unexpected '|', expecting '(' or ';' or '=' or ':' -LOG: lev:2 file:pbx_ael.c line:3993 func: pbx_load_module AEL load process: parsed config file name './extensions.ael'. -LOG: lev:4 file:pbx_ael.c line:4006 func: pbx_load_module Sorry, but 5 syntax errors and 0 semantic errors were detected. It doesn't make sense to compile. -LOG: lev:4 file:ael2_parse line:523 func: main 0 contexts, 0 extensions, 0 priorities +LOG: lev:2 file:pbx_ael.c line:4468 func: pbx_load_module Starting AEL load process. +LOG: lev:2 file:pbx_ael.c line:4475 func: pbx_load_module AEL load process: calculated config file name './extensions.ael'. +LOG: lev:4 file:ael.flex line:429 func: ael_yylex File=./extensions.ael, line=165, column=49: Mismatched '}' in expression! +LOG: lev:4 file:ael.y line:756 func: ael_yyerror ==== File: ./extensions.ael, Line 165, Cols: 52-52: Error: syntax error, unexpected '=', expecting ')' +LOG: lev:4 file:ael.flex line:429 func: ael_yylex File=./extensions.ael, line=174, column=49: Mismatched '}' in expression! +LOG: lev:4 file:ael.y line:756 func: ael_yyerror ==== File: ./extensions.ael, Line 174, Cols: 52-52: Error: syntax error, unexpected '=', expecting ')' +LOG: lev:4 file:ael.flex line:429 func: ael_yylex File=./extensions.ael, line=222, column=41: Mismatched '}' in expression! +LOG: lev:4 file:ael.y line:756 func: ael_yyerror ==== File: ./extensions.ael, Line 222, Cols: 44-44: Error: syntax error, unexpected '=', expecting ')' +LOG: lev:4 file:ael.y line:756 func: ael_yyerror ==== File: ./extensions.ael, Line 291, Cols: 22-33: Error: syntax error, unexpected word, expecting '(' or ';' or '=' or ':' +LOG: lev:2 file:pbx_ael.c line:4483 func: pbx_load_module AEL load process: parsed config file name './extensions.ael'. +LOG: lev:4 file:pbx_ael.c line:4496 func: pbx_load_module Sorry, but 4 syntax errors and 0 semantic errors were detected. It doesn't make sense to compile. +LOG: lev:4 file:ael2_parse line:543 func: main 0 contexts, 0 extensions, 0 priorities diff --git a/pbx/ael/ael-test/ref.ael-vtest25 b/pbx/ael/ael-test/ref.ael-vtest25 new file mode 100644 index 000000000..e2d4280b0 --- /dev/null +++ b/pbx/ael/ael-test/ref.ael-vtest25 @@ -0,0 +1,7 @@ + + +[test11] +exten => 841,1,Macro(test234|"testing"| ${CUT(EXTEN\,\,3)}) +exten => 841,2,Goto(${DB(uri/${uri_string})}|1) +exten => 841,3,Set(line=${DB(uri/${uri_string})}) +exten => 841,4,Goto(${line}|1) diff --git a/pbx/ael/ael.flex b/pbx/ael/ael.flex index 866e36170..2bf00695b 100644 --- a/pbx/ael/ael.flex +++ b/pbx/ael/ael.flex @@ -26,7 +26,7 @@ * * %x describes the contexts we have: paren, semic and argg, plus INITIAL */ -%x paren semic argg comment +%x paren semic argg comment curlystate wordstate brackstate /* prefix used for various globally-visible functions and variables. * This renames also yywrap, but since we do not use it, we just @@ -83,10 +83,28 @@ static char pbcstack[400]; /* XXX missing size checks */ static int pbcpos = 0; static void pbcpush(char x); static int pbcpop(char x); - static int parencount = 0; /* + * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by ${ ... } + */ +static char pbcstack2[400]; /* XXX missing size checks */ +static int pbcpos2 = 0; +static void pbcpush2(char x); +static int pbcpop2(char x); +static int parencount2 = 0; + +/* + * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by $[ ... ] + */ +static char pbcstack3[400]; /* XXX missing size checks */ +static int pbcpos3 = 0; +static void pbcpush3(char x); +static int pbcpop3(char x); +static int parencount3 = 0; + + +/* * current line, column and filename, updated as we read the input. */ static int my_lineno = 1; /* current line in the source */ @@ -175,6 +193,7 @@ static void pbcwhere(const char *text, int *line, int *col ) #endif %} +KEYWORD (context|abstract|extend|macro|globals|local|ignorepat|switch|if|ifTime|random|regexten|hint|else|goto|jump|return|break|continue|for|while|case|default|pattern|catch|switches|eswitches|includes) NOPARENS ([^()\[\]\{\}]|\\[()\[\]\{\}])* @@ -230,19 +249,140 @@ includes { STORE_POS; return KW_INCLUDES;} <comment>[^*\n]*\n { ++my_lineno; my_col=1;} <comment>"*"+[^*/\n]* { my_col += yyleng; } <comment>"*"+[^*/\n]*\n { ++my_lineno; my_col=1;} -<comment>"*/" { my_col += 2; BEGIN(INITIAL); } +<comment>"*/" { my_col += 2; BEGIN(INITIAL); } /* the nice thing about comments is that you know exactly what ends them */ \n { my_lineno++; my_col = 1; } [ ]+ { my_col += yyleng; } [\t]+ { my_col += (yyleng*8)-(my_col%8); } -[-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]][-a-zA-Z0-9'"_/.!\*\+\<\>\{\}$#\[\]]* { +({KEYWORD}?[-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]]|(\\.)|(\$\{)|(\$\[)) { + /* boy did I open a can of worms when I changed the lexical token "word". + all the above keywords can be used as a beginning to a "word".- + before, a "word" would match a longer sequence than the above + keywords, and all would be well. But now "word" is a single char + and feeds into a statemachine sort of sequence from there on. So... + I added the {KEYWORD}? to the beginning of the word match sequence */ + + if (!strcmp(yytext,"${")) { + parencount2 = 0; + pbcpos2 = 0; + pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */ + BEGIN(curlystate); + yymore(); + } else if (!strcmp(yytext,"$[")) { + parencount3 = 0; + pbcpos3 = 0; + pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */ + BEGIN(brackstate); + yymore(); + } else { + BEGIN(wordstate); + yymore(); + } + } +<wordstate>[-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]] { yymore(); /* Keep going */ } +<wordstate>(\\.) { yymore(); /* Keep Going */ } +<wordstate>(\$\{) { /* the beginning of a ${} construct. prepare and pop into curlystate */ + parencount2 = 0; + pbcpos2 = 0; + pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */ + BEGIN(curlystate); + yymore(); + } +<wordstate>(\$\[) { /* the beginning of a $[] construct. prepare and pop into brackstate */ + parencount3 = 0; + pbcpos3 = 0; + pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */ + BEGIN(brackstate); + yymore(); + } +<wordstate>([^a-zA-Z0-9\x80-\xff\x2d'"_/.\<\>\*\+!$#\[\]]) { + /* a non-word constituent char, like a space, tab, curly, paren, etc */ + char c = yytext[yyleng-1]; STORE_POS; yylval->str = strdup(yytext); + yylval->str[yyleng-1] = 0; + unput(c); /* put this ending char back in the stream */ + BEGIN(0); prev_word = yylval->str; return word; } +<curlystate>{NOPARENS}\} { + if ( pbcpop2('}') ) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + parencount2--; + if ( parencount2 >= 0) { + yymore(); + } else { + BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */ + yymore(); + } + } +<curlystate>{NOPARENS}[\(\[\{] { + char c = yytext[yyleng-1]; + if (c == '{') + parencount2++; + pbcpush2(c); + yymore(); + } + +<curlystate>{NOPARENS}[\]\)] { + char c = yytext[yyleng-1]; + if ( pbcpop2(c)) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", + my_file, my_lineno, my_col, c); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + yymore(); + } + + +<brackstate>{NOPARENS}\] { + if ( pbcpop3(']') ) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + parencount3--; + if ( parencount3 >= 0) { + yymore(); + } else { + BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */ + yymore(); + } + } + +<brackstate>{NOPARENS}[\(\[\{] { + char c = yytext[yyleng-1]; + if (c == '[') + parencount3++; + pbcpush3(c); + yymore(); + } + +<brackstate>{NOPARENS}[\}\)] { + char c = yytext[yyleng-1]; + if ( pbcpop3(c)) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", + my_file, my_lineno, my_col, c); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + yymore(); + } /* @@ -491,6 +631,38 @@ static int pbcpop(char x) return 1; /* error */ } +static void pbcpush2(char x) +{ + pbcstack2[pbcpos2++] = x; +} + +static int pbcpop2(char x) +{ + if ( ( x == ')' && pbcstack2[pbcpos2-1] == '(' ) + || ( x == ']' && pbcstack2[pbcpos2-1] == '[' ) + || ( x == '}' && pbcstack2[pbcpos2-1] == '{' )) { + pbcpos2--; + return 0; + } + return 1; /* error */ +} + +static void pbcpush3(char x) +{ + pbcstack3[pbcpos3++] = x; +} + +static int pbcpop3(char x) +{ + if ( ( x == ')' && pbcstack3[pbcpos3-1] == '(' ) + || ( x == ']' && pbcstack3[pbcpos3-1] == '[' ) + || ( x == '}' && pbcstack3[pbcpos3-1] == '{' )) { + pbcpos3--; + return 0; + } + return 1; /* error */ +} + static int c_prevword(void) { char *c = prev_word; diff --git a/pbx/ael/ael_lex.c b/pbx/ael/ael_lex.c index 708387829..537ee0ea8 100644 --- a/pbx/ael/ael_lex.c +++ b/pbx/ael/ael_lex.c @@ -32,7 +32,7 @@ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ -#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L +#if __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -357,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 62 -#define YY_END_OF_BUFFER 63 +#define YY_NUM_RULES 73 +#define YY_END_OF_BUFFER 74 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -366,34 +366,39 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[239] = +static yyconst flex_int16_t yy_accept[284] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 63, 62, 49, 47, 48, 50, 50, 9, 3, 4, - 7, 50, 8, 5, 6, 12, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 0, 74, 73, 49, 47, + 48, 50, 50, 50, 9, 3, 4, 7, 50, 8, + 5, 6, 12, 73, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 1, 10, 2, 62, 52, 51, 62, 53, 62, - 58, 59, 60, 62, 62, 54, 55, 56, 62, 57, - 42, 43, 44, 49, 48, 50, 50, 41, 13, 11, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 21, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 0, 52, 51, 0, 53, 52, 51, 53, - - 0, 58, 59, 60, 0, 58, 59, 60, 0, 54, - 55, 56, 0, 57, 54, 55, 56, 57, 42, 43, - 44, 45, 44, 46, 50, 13, 13, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 32, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 34, 50, 50, 50, 26, 50, - 50, 50, 27, 25, 50, 50, 50, 28, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 30, 37, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 17, 50, - 50, 50, 50, 50, 33, 50, 50, 50, 50, 50, - - 50, 16, 50, 22, 50, 50, 50, 23, 50, 29, - 20, 50, 50, 14, 50, 35, 50, 18, 50, 50, - 36, 50, 50, 50, 15, 31, 50, 50, 40, 24, - 38, 0, 39, 19, 0, 0, 61, 0 + 1, 10, 2, 73, 63, 62, 73, 64, 73, 69, + 70, 71, 73, 73, 65, 66, 67, 73, 68, 42, + 43, 44, 73, 57, 58, 73, 56, 55, 51, 51, + 55, 73, 60, 61, 73, 59, 49, 48, 0, 50, + 41, 13, 11, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 62, 0, + 64, 63, 62, 64, 0, 69, 70, 71, 0, 69, + 70, 71, 0, 65, 66, 67, 0, 68, 65, 66, + 67, 68, 42, 43, 44, 45, 44, 46, 0, 57, + 58, 0, 56, 57, 58, 56, 54, 53, 52, 0, + 60, 61, 0, 59, 60, 61, 59, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, + 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, + + 0, 26, 0, 0, 0, 27, 25, 0, 0, 0, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 30, 37, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 0, 0, 0, 16, 0, 22, 0, + 0, 0, 23, 0, 29, 20, 0, 0, 14, 0, + 35, 0, 18, 0, 0, 36, 0, 50, 0, 15, + 31, 0, 0, 40, 24, 38, 0, 39, 19, 0, + 0, 72, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -401,340 +406,360 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 5, 6, 7, 5, 1, 8, 5, 9, - 10, 11, 5, 12, 5, 5, 13, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 14, 15, 5, - 16, 17, 1, 18, 5, 5, 5, 5, 5, 5, + 1, 4, 5, 6, 7, 8, 1, 9, 5, 10, + 11, 12, 5, 13, 5, 5, 14, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 15, 16, 5, + 17, 18, 1, 19, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 19, 5, 5, 5, 5, 5, 5, - 20, 21, 22, 1, 5, 1, 23, 24, 25, 26, - - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 5, 39, 40, 41, 42, 5, 43, 44, - 5, 5, 45, 46, 47, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 5, 5, 5, 20, 5, 5, 5, 5, 5, 5, + 21, 22, 23, 1, 5, 1, 24, 25, 26, 27, + + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 5, 40, 41, 42, 43, 5, 44, 45, + 5, 5, 46, 47, 48, 1, 1, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49 } ; -static yyconst flex_int32_t yy_meta[48] = +static yyconst flex_int32_t yy_meta[50] = { 0, - 1, 1, 2, 1, 3, 4, 3, 1, 1, 1, - 5, 1, 3, 1, 1, 1, 3, 1, 3, 3, - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 1, 1, 2, 1, 3, 4, 3, 3, 1, 1, + 1, 5, 1, 3, 1, 1, 1, 3, 1, 3, + 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 1, 3 + 3, 3, 3, 3, 3, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[252] = +static yyconst flex_int16_t yy_base[303] = { 0, - 0, 0, 39, 42, 81, 120, 159, 198, 47, 54, - 315, 985, 312, 985, 309, 0, 281, 985, 985, 985, - 985, 42, 985, 985, 294, 985, 286, 270, 31, 281, - 32, 270, 33, 275, 45, 263, 281, 280, 48, 259, - 271, 985, 985, 985, 73, 985, 985, 89, 985, 237, - 985, 985, 985, 276, 315, 985, 985, 985, 354, 985, - 297, 985, 66, 297, 291, 0, 258, 0, 401, 985, - 253, 265, 64, 254, 261, 248, 244, 242, 242, 243, - 238, 242, 258, 240, 250, 239, 248, 231, 235, 51, - 239, 238, 103, 985, 985, 137, 985, 142, 176, 181, - - 439, 985, 985, 985, 478, 517, 556, 595, 634, 985, - 985, 985, 673, 985, 712, 751, 790, 829, 265, 985, - 103, 985, 104, 985, 242, 0, 876, 225, 242, 237, - 238, 221, 238, 233, 225, 228, 0, 230, 216, 210, - 219, 212, 214, 206, 203, 200, 214, 212, 196, 196, - 202, 201, 195, 200, 0, 202, 100, 189, 0, 189, - 193, 204, 0, 0, 190, 185, 180, 0, 180, 189, - 178, 170, 174, 187, 184, 167, 182, 0, 0, 156, - 163, 161, 169, 167, 158, 161, 156, 152, 0, 138, - 141, 134, 137, 136, 0, 135, 135, 115, 113, 113, - - 123, 0, 109, 0, 107, 117, 107, 0, 112, 0, - 111, 110, 92, 0, 105, 0, 95, 0, 85, 60, - 0, 61, 48, 117, 0, 0, 45, 37, 0, 0, - 0, 168, 0, 0, 0, 50, 985, 985, 922, 927, - 932, 937, 940, 945, 950, 955, 960, 964, 969, 974, - 979 + 0, 0, 40, 43, 82, 121, 160, 199, 55, 56, + 60, 74, 247, 296, 90, 104, 432, 1023, 429, 1023, + 426, 1023, 397, 31, 1023, 1023, 1023, 1023, 43, 1023, + 1023, 410, 1023, 0, 401, 382, 36, 389, 34, 378, + 38, 380, 80, 368, 372, 385, 381, 66, 357, 369, + 1023, 1023, 1023, 138, 1023, 1023, 143, 1023, 336, 1023, + 1023, 1023, 375, 414, 1023, 1023, 1023, 453, 1023, 396, + 1023, 104, 177, 1023, 1023, 182, 1023, 1023, 1023, 78, + 0, 231, 1023, 1023, 262, 1023, 393, 390, 356, 1023, + 1023, 0, 1023, 348, 360, 92, 350, 354, 337, 333, + + 333, 333, 334, 329, 333, 344, 326, 335, 320, 327, + 322, 299, 303, 93, 302, 301, 280, 1023, 1023, 314, + 1023, 328, 344, 358, 492, 1023, 1023, 1023, 531, 570, + 609, 648, 687, 1023, 1023, 1023, 726, 1023, 765, 804, + 843, 882, 329, 1023, 143, 1023, 144, 1023, 392, 1023, + 1023, 397, 1023, 431, 436, 470, 1023, 1023, 1023, 475, + 1023, 1023, 484, 1023, 514, 523, 553, 305, 0, 288, + 305, 299, 297, 280, 297, 292, 287, 289, 0, 291, + 276, 250, 257, 250, 252, 247, 258, 241, 238, 251, + 248, 232, 232, 236, 235, 228, 233, 0, 234, 113, + + 218, 0, 217, 209, 220, 0, 0, 207, 200, 196, + 0, 203, 199, 208, 197, 189, 193, 206, 203, 186, + 203, 0, 0, 181, 187, 184, 192, 190, 181, 187, + 186, 186, 0, 0, 171, 171, 160, 164, 166, 0, + 169, 169, 152, 147, 143, 149, 0, 138, 0, 139, + 149, 138, 0, 140, 0, 135, 134, 109, 0, 112, + 0, 111, 0, 105, 80, 0, 82, 61, 76, 0, + 0, 46, 30, 0, 0, 0, 170, 0, 0, 0, + 50, 1023, 1023, 930, 935, 940, 945, 950, 955, 960, + 965, 970, 975, 980, 985, 989, 994, 999, 1004, 1009, + + 1012, 1017 } ; -static yyconst flex_int16_t yy_def[252] = +static yyconst flex_int16_t yy_def[303] = { 0, - 238, 1, 239, 239, 240, 240, 241, 241, 242, 242, - 238, 238, 238, 238, 238, 243, 243, 238, 238, 238, - 238, 243, 238, 238, 238, 238, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 238, 238, 238, 244, 238, 238, 244, 238, 245, - 238, 238, 238, 245, 246, 238, 238, 238, 246, 238, - 247, 238, 248, 238, 238, 243, 243, 243, 249, 238, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 244, 238, 238, 244, 238, 244, 244, 244, - - 245, 238, 238, 238, 245, 245, 245, 245, 246, 238, - 238, 238, 246, 238, 246, 246, 246, 246, 247, 238, - 248, 238, 248, 238, 243, 250, 249, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 238, 243, 243, 251, 251, 238, 0, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238 + 283, 1, 284, 284, 285, 285, 286, 286, 287, 287, + 288, 288, 289, 289, 290, 290, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 291, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 292, 283, 283, 292, 283, 293, 283, + 283, 283, 293, 294, 283, 283, 283, 294, 283, 295, + 283, 296, 297, 283, 283, 297, 283, 283, 283, 283, + 298, 299, 283, 283, 299, 283, 283, 283, 283, 283, + 283, 300, 283, 283, 283, 283, 283, 283, 283, 283, + + 283, 283, 283, 283, 283, 301, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 292, 283, 283, 292, + 283, 292, 292, 292, 293, 283, 283, 283, 293, 293, + 293, 293, 294, 283, 283, 283, 294, 283, 294, 294, + 294, 294, 295, 283, 296, 283, 296, 283, 297, 283, + 283, 297, 283, 297, 297, 297, 283, 283, 283, 299, + 283, 283, 299, 283, 299, 299, 299, 283, 300, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 301, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 301, 283, 283, + + 283, 301, 283, 283, 283, 301, 301, 283, 283, 283, + 301, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 301, 301, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 301, 301, 283, 283, 283, 283, 283, 301, + 283, 283, 283, 283, 283, 283, 301, 283, 301, 283, + 283, 283, 301, 283, 301, 301, 283, 283, 301, 283, + 301, 283, 301, 283, 283, 301, 283, 283, 283, 301, + 301, 283, 283, 301, 301, 301, 283, 301, 301, 302, + 302, 283, 0, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + + 283, 283 } ; -static yyconst flex_int16_t yy_nxt[1033] = +static yyconst flex_int16_t yy_nxt[1073] = { 0, - 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, - 16, 21, 22, 23, 24, 25, 16, 26, 16, 16, - 12, 16, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 16, 16, 37, 16, 16, 38, 39, 40, - 16, 16, 41, 16, 42, 43, 44, 46, 47, 62, - 46, 47, 68, 73, 69, 237, 62, 63, 46, 48, - 49, 46, 48, 49, 63, 76, 80, 74, 122, 81, - 89, 77, 83, 84, 90, 78, 123, 234, 124, 148, - 85, 94, 95, 46, 233, 49, 46, 231, 49, 51, - 52, 149, 94, 96, 97, 53, 230, 98, 99, 229, - - 51, 54, 52, 130, 131, 122, 122, 228, 98, 96, - 100, 94, 95, 238, 123, 238, 238, 94, 232, 97, - 232, 227, 94, 96, 97, 51, 180, 52, 51, 52, - 181, 226, 225, 98, 53, 100, 224, 223, 222, 51, - 54, 52, 221, 220, 219, 98, 99, 94, 218, 97, - 94, 95, 217, 216, 215, 214, 98, 96, 100, 213, - 212, 94, 96, 97, 51, 211, 52, 56, 57, 232, - 58, 232, 210, 235, 209, 208, 207, 206, 56, 59, - 60, 98, 205, 100, 94, 95, 94, 204, 97, 94, - 95, 203, 202, 201, 200, 94, 96, 97, 199, 198, - - 94, 96, 97, 56, 197, 60, 56, 57, 196, 58, - 195, 194, 193, 192, 191, 190, 189, 56, 59, 60, - 94, 188, 97, 187, 186, 94, 185, 97, 184, 183, - 182, 179, 178, 177, 176, 175, 174, 173, 172, 171, - 170, 169, 56, 168, 60, 102, 103, 167, 166, 165, - 164, 104, 163, 162, 161, 160, 102, 105, 103, 159, - 158, 157, 156, 155, 154, 153, 152, 120, 151, 150, - 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, - 137, 102, 136, 103, 106, 107, 135, 134, 133, 132, - 108, 129, 128, 125, 65, 106, 105, 107, 64, 120, - - 92, 91, 88, 87, 86, 82, 79, 75, 72, 71, - 70, 67, 65, 64, 238, 238, 238, 238, 238, 238, - 106, 238, 107, 110, 111, 238, 112, 238, 238, 238, - 238, 238, 238, 238, 110, 113, 114, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 110, - 238, 114, 115, 116, 238, 117, 238, 238, 238, 238, - 238, 238, 238, 115, 113, 118, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 115, 238, - - 118, 126, 126, 238, 126, 238, 238, 238, 126, 126, - 126, 238, 126, 238, 126, 126, 126, 238, 126, 238, - 238, 126, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 126, 102, 103, 238, - 238, 238, 238, 104, 238, 238, 238, 238, 102, 105, - 103, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 102, 238, 103, 106, 107, 238, 238, - 238, 238, 108, 238, 238, 238, 238, 106, 105, 107, - - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 106, 238, 107, 102, 103, 238, 238, 238, - 238, 104, 238, 238, 238, 238, 102, 105, 103, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 102, 238, 103, 102, 103, 238, 238, 238, 238, - 104, 238, 238, 238, 238, 102, 105, 103, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - - 102, 238, 103, 102, 103, 238, 238, 238, 238, 104, - 238, 238, 238, 238, 102, 105, 103, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 102, - 238, 103, 110, 111, 238, 112, 238, 238, 238, 238, - 238, 238, 238, 110, 113, 114, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 110, 238, - 114, 115, 116, 238, 117, 238, 238, 238, 238, 238, - 238, 238, 115, 113, 118, 238, 238, 238, 238, 238, - - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 115, 238, 118, - 110, 111, 238, 112, 238, 238, 238, 238, 238, 238, - 238, 110, 113, 114, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 110, 238, 114, 110, - 111, 238, 112, 238, 238, 238, 238, 238, 238, 238, - 110, 113, 114, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 110, 238, 114, 110, 111, - - 238, 112, 238, 238, 238, 238, 238, 238, 238, 110, - 113, 114, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 110, 238, 114, 110, 111, 238, - 112, 238, 238, 238, 238, 238, 238, 238, 110, 113, - 114, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 110, 238, 114, 126, 126, 238, 126, - 238, 238, 238, 126, 126, 126, 238, 126, 238, 126, - 126, 126, 238, 126, 238, 238, 126, 238, 238, 238, - - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 126, 45, 45, 45, 45, 45, 50, 50, 50, - 50, 50, 55, 55, 55, 55, 55, 61, 61, 61, - 61, 61, 66, 66, 66, 93, 93, 93, 93, 93, - 101, 101, 101, 101, 101, 109, 109, 109, 109, 109, - 119, 119, 119, 119, 121, 121, 121, 121, 121, 127, - 238, 127, 127, 127, 126, 238, 126, 126, 126, 236, - 236, 236, 238, 236, 11, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238 + 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, + 27, 22, 28, 29, 30, 31, 32, 22, 33, 22, + 22, 34, 22, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 22, 45, 46, 22, 22, 47, 48, + 49, 22, 22, 50, 22, 51, 52, 53, 18, 55, + 56, 90, 55, 56, 91, 282, 92, 71, 71, 96, + 55, 57, 58, 55, 57, 58, 72, 72, 99, 74, + 75, 279, 103, 97, 100, 104, 90, 277, 101, 277, + 74, 76, 75, 74, 75, 55, 278, 58, 55, 113, + 58, 60, 61, 114, 74, 76, 75, 62, 157, 83, + + 84, 276, 60, 63, 61, 74, 146, 77, 106, 107, + 83, 85, 86, 83, 84, 147, 108, 148, 275, 74, + 274, 77, 191, 158, 83, 85, 86, 60, 273, 61, + 60, 61, 172, 173, 192, 83, 62, 84, 272, 271, + 224, 60, 63, 61, 225, 146, 146, 118, 119, 83, + 270, 84, 122, 123, 283, 147, 283, 283, 118, 120, + 121, 269, 268, 122, 120, 124, 60, 267, 61, 65, + 66, 277, 67, 277, 266, 280, 265, 264, 263, 262, + 65, 68, 69, 118, 261, 121, 150, 151, 122, 260, + 124, 154, 155, 259, 258, 257, 256, 150, 152, 151, + + 255, 254, 154, 152, 155, 65, 253, 69, 65, 66, + 252, 67, 251, 250, 249, 248, 247, 246, 245, 65, + 68, 69, 150, 244, 153, 243, 242, 154, 241, 156, + 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, + 161, 162, 230, 229, 65, 228, 69, 78, 78, 78, + 78, 161, 163, 164, 80, 78, 78, 78, 227, 78, + 226, 78, 78, 78, 223, 78, 222, 221, 81, 220, + 219, 165, 166, 218, 217, 216, 161, 215, 162, 214, + 213, 212, 165, 163, 167, 211, 210, 209, 208, 118, + 119, 207, 78, 78, 78, 18, 78, 78, 78, 78, + + 118, 120, 121, 80, 78, 78, 78, 165, 78, 166, + 78, 78, 78, 206, 78, 205, 204, 81, 203, 202, + 201, 200, 199, 122, 123, 118, 198, 121, 197, 196, + 195, 144, 194, 193, 122, 120, 124, 118, 119, 190, + 189, 78, 78, 78, 18, 126, 127, 188, 118, 120, + 121, 128, 187, 118, 119, 186, 126, 129, 127, 122, + 185, 124, 184, 183, 118, 120, 121, 118, 119, 182, + 181, 180, 179, 118, 178, 121, 177, 176, 118, 120, + 121, 126, 175, 127, 130, 131, 174, 171, 170, 118, + 132, 121, 168, 88, 87, 130, 129, 131, 144, 116, + + 115, 150, 151, 118, 112, 121, 154, 155, 111, 110, + 109, 105, 150, 152, 151, 102, 98, 154, 152, 155, + 130, 95, 131, 134, 135, 94, 136, 93, 89, 88, + 87, 283, 283, 283, 134, 137, 138, 150, 283, 153, + 150, 151, 154, 283, 156, 150, 151, 283, 283, 283, + 283, 150, 152, 151, 283, 283, 150, 152, 151, 134, + 283, 138, 139, 140, 283, 141, 283, 283, 283, 283, + 283, 283, 283, 139, 137, 142, 150, 283, 153, 150, + 151, 150, 283, 153, 161, 162, 283, 283, 283, 283, + 150, 152, 151, 165, 166, 161, 163, 164, 139, 283, + + 142, 126, 127, 283, 165, 163, 167, 128, 283, 283, + 283, 283, 126, 129, 127, 150, 283, 153, 283, 283, + 161, 283, 162, 161, 162, 283, 283, 283, 283, 165, + 283, 166, 161, 162, 161, 163, 164, 126, 283, 127, + 130, 131, 283, 161, 163, 164, 132, 283, 283, 283, + 283, 130, 129, 131, 283, 283, 283, 283, 283, 161, + 283, 162, 161, 162, 283, 283, 283, 283, 161, 283, + 162, 283, 283, 161, 163, 164, 130, 283, 131, 126, + 127, 283, 283, 283, 283, 128, 283, 283, 283, 283, + 126, 129, 127, 283, 283, 283, 283, 283, 161, 283, + + 162, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 126, 283, 127, 126, 127, + 283, 283, 283, 283, 128, 283, 283, 283, 283, 126, + 129, 127, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 126, 283, 127, 126, 127, 283, + 283, 283, 283, 128, 283, 283, 283, 283, 126, 129, + 127, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 126, 283, 127, 134, 135, 283, 136, + + 283, 283, 283, 283, 283, 283, 283, 134, 137, 138, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 134, 283, 138, 139, 140, 283, 141, 283, + 283, 283, 283, 283, 283, 283, 139, 137, 142, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 139, 283, 142, 134, 135, 283, 136, 283, 283, + 283, 283, 283, 283, 283, 134, 137, 138, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 134, 283, 138, 134, 135, 283, 136, 283, 283, 283, + 283, 283, 283, 283, 134, 137, 138, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 134, + 283, 138, 134, 135, 283, 136, 283, 283, 283, 283, + 283, 283, 283, 134, 137, 138, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 134, 283, + 138, 134, 135, 283, 136, 283, 283, 283, 283, 283, + + 283, 283, 134, 137, 138, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 134, 283, 138, + 54, 54, 54, 54, 54, 59, 59, 59, 59, 59, + 64, 64, 64, 64, 64, 70, 70, 70, 70, 70, + 73, 73, 73, 73, 73, 79, 79, 79, 79, 79, + 82, 82, 82, 82, 82, 90, 283, 90, 90, 90, + 117, 117, 117, 117, 117, 125, 125, 125, 125, 125, + 133, 133, 133, 133, 133, 143, 143, 143, 143, 145, + 145, 145, 145, 145, 149, 149, 149, 149, 149, 159, + + 283, 159, 159, 159, 160, 160, 160, 160, 160, 169, + 283, 169, 169, 169, 90, 90, 90, 281, 281, 281, + 283, 281, 17, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283 } ; -static yyconst flex_int16_t yy_chk[1033] = +static yyconst flex_int16_t yy_chk[1073] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 9, - 4, 4, 22, 29, 22, 236, 10, 9, 3, 3, - 3, 4, 4, 4, 10, 31, 33, 29, 63, 33, - 39, 31, 35, 35, 39, 31, 63, 228, 63, 90, - 35, 45, 45, 3, 227, 3, 4, 223, 4, 5, - 5, 90, 45, 45, 45, 5, 222, 48, 48, 220, - - 5, 5, 5, 73, 73, 121, 123, 219, 48, 48, - 48, 93, 93, 121, 123, 121, 123, 45, 224, 45, - 224, 217, 93, 93, 93, 5, 157, 5, 6, 6, - 157, 215, 213, 48, 6, 48, 212, 211, 209, 6, - 6, 6, 207, 206, 205, 96, 96, 93, 203, 93, - 98, 98, 201, 200, 199, 198, 96, 96, 96, 197, - 196, 98, 98, 98, 6, 194, 6, 7, 7, 232, - 7, 232, 193, 232, 192, 191, 190, 188, 7, 7, - 7, 96, 187, 96, 99, 99, 98, 186, 98, 100, - 100, 185, 184, 183, 182, 99, 99, 99, 181, 180, - - 100, 100, 100, 7, 177, 7, 8, 8, 176, 8, - 175, 174, 173, 172, 171, 170, 169, 8, 8, 8, - 99, 167, 99, 166, 165, 100, 162, 100, 161, 160, - 158, 156, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 8, 144, 8, 50, 50, 143, 142, 141, - 140, 50, 139, 138, 136, 135, 50, 50, 50, 134, - 133, 132, 131, 130, 129, 128, 125, 119, 92, 91, - 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, - 79, 50, 78, 50, 54, 54, 77, 76, 75, 74, - 54, 72, 71, 67, 65, 54, 54, 54, 64, 61, - - 41, 40, 38, 37, 36, 34, 32, 30, 28, 27, - 25, 17, 15, 13, 11, 0, 0, 0, 0, 0, - 54, 0, 54, 55, 55, 0, 55, 0, 0, 0, - 0, 0, 0, 0, 55, 55, 55, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, - 0, 55, 59, 59, 0, 59, 0, 0, 0, 0, - 0, 0, 0, 59, 59, 59, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, - - 59, 69, 69, 0, 69, 0, 0, 0, 69, 69, - 69, 0, 69, 0, 69, 69, 69, 0, 69, 0, - 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 24, 4, 4, 29, 281, 29, 9, 10, 37, + 3, 3, 3, 4, 4, 4, 9, 10, 39, 11, + 11, 273, 41, 37, 39, 41, 24, 269, 39, 269, + 11, 11, 11, 12, 12, 3, 272, 3, 4, 48, + 4, 5, 5, 48, 12, 12, 12, 5, 80, 15, + + 15, 268, 5, 5, 5, 11, 72, 11, 43, 43, + 15, 15, 15, 16, 16, 72, 43, 72, 267, 12, + 265, 12, 114, 80, 16, 16, 16, 5, 264, 5, + 6, 6, 96, 96, 114, 15, 6, 15, 262, 260, + 200, 6, 6, 6, 200, 145, 147, 54, 54, 16, + 258, 16, 57, 57, 145, 147, 145, 147, 54, 54, + 54, 257, 256, 57, 57, 57, 6, 254, 6, 7, + 7, 277, 7, 277, 252, 277, 251, 250, 248, 246, + 7, 7, 7, 54, 245, 54, 73, 73, 57, 244, + 57, 76, 76, 243, 242, 241, 239, 73, 73, 73, + + 238, 237, 76, 76, 76, 7, 236, 7, 8, 8, + 235, 8, 232, 231, 230, 229, 228, 227, 226, 8, + 8, 8, 73, 225, 73, 224, 221, 76, 220, 76, + 219, 218, 217, 216, 215, 214, 213, 212, 210, 209, + 82, 82, 208, 205, 8, 204, 8, 13, 13, 13, + 13, 82, 82, 82, 13, 13, 13, 13, 203, 13, + 201, 13, 13, 13, 199, 13, 197, 196, 13, 195, + 194, 85, 85, 193, 192, 191, 82, 190, 82, 189, + 188, 187, 85, 85, 85, 186, 185, 184, 183, 117, + 117, 182, 13, 13, 13, 13, 14, 14, 14, 14, + + 117, 117, 117, 14, 14, 14, 14, 85, 14, 85, + 14, 14, 14, 181, 14, 180, 178, 14, 177, 176, + 175, 174, 173, 120, 120, 117, 172, 117, 171, 170, + 168, 143, 116, 115, 120, 120, 120, 122, 122, 113, + 112, 14, 14, 14, 14, 59, 59, 111, 122, 122, + 122, 59, 110, 123, 123, 109, 59, 59, 59, 120, + 108, 120, 107, 106, 123, 123, 123, 124, 124, 105, + 104, 103, 102, 122, 101, 122, 100, 99, 124, 124, + 124, 59, 98, 59, 63, 63, 97, 95, 94, 123, + 63, 123, 89, 88, 87, 63, 63, 63, 70, 50, + + 49, 149, 149, 124, 47, 124, 152, 152, 46, 45, + 44, 42, 149, 149, 149, 40, 38, 152, 152, 152, + 63, 36, 63, 64, 64, 35, 64, 32, 23, 21, + 19, 17, 0, 0, 64, 64, 64, 149, 0, 149, + 154, 154, 152, 0, 152, 155, 155, 0, 0, 0, + 0, 154, 154, 154, 0, 0, 155, 155, 155, 64, + 0, 64, 68, 68, 0, 68, 0, 0, 0, 0, + 0, 0, 0, 68, 68, 68, 154, 0, 154, 156, + 156, 155, 0, 155, 160, 160, 0, 0, 0, 0, + 156, 156, 156, 163, 163, 160, 160, 160, 68, 0, + + 68, 125, 125, 0, 163, 163, 163, 125, 0, 0, + 0, 0, 125, 125, 125, 156, 0, 156, 0, 0, + 160, 0, 160, 165, 165, 0, 0, 0, 0, 163, + 0, 163, 166, 166, 165, 165, 165, 125, 0, 125, + 129, 129, 0, 166, 166, 166, 129, 0, 0, 0, + 0, 129, 129, 129, 0, 0, 0, 0, 0, 165, + 0, 165, 167, 167, 0, 0, 0, 0, 166, 0, + 166, 0, 0, 167, 167, 167, 129, 0, 129, 130, + 130, 0, 0, 0, 0, 130, 0, 0, 0, 0, + 130, 130, 130, 0, 0, 0, 0, 0, 167, 0, + + 167, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 130, 0, 130, 131, 131, + 0, 0, 0, 0, 131, 0, 0, 0, 0, 131, + 131, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 69, 101, 101, 0, - 0, 0, 0, 101, 0, 0, 0, 0, 101, 101, - 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 131, 0, 131, 132, 132, 0, + 0, 0, 0, 132, 0, 0, 0, 0, 132, 132, + 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 101, 0, 101, 105, 105, 0, 0, - 0, 0, 105, 0, 0, 0, 0, 105, 105, 105, + 0, 0, 0, 132, 0, 132, 133, 133, 0, 133, + 0, 0, 0, 0, 0, 0, 0, 133, 133, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 105, 0, 105, 106, 106, 0, 0, 0, - 0, 106, 0, 0, 0, 0, 106, 106, 106, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 133, 0, 133, 137, 137, 0, 137, 0, + 0, 0, 0, 0, 0, 0, 137, 137, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 106, 0, 106, 107, 107, 0, 0, 0, 0, - 107, 0, 0, 0, 0, 107, 107, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 137, 0, 137, 139, 139, 0, 139, 0, 0, + 0, 0, 0, 0, 0, 139, 139, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 107, 0, 107, 108, 108, 0, 0, 0, 0, 108, - 0, 0, 0, 0, 108, 108, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, - 0, 108, 109, 109, 0, 109, 0, 0, 0, 0, - 0, 0, 0, 109, 109, 109, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, - 109, 113, 113, 0, 113, 0, 0, 0, 0, 0, - 0, 0, 113, 113, 113, 0, 0, 0, 0, 0, - + 139, 0, 139, 140, 140, 0, 140, 0, 0, 0, + 0, 0, 0, 0, 140, 140, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 113, 0, 113, - 115, 115, 0, 115, 0, 0, 0, 0, 0, 0, - 0, 115, 115, 115, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, + 0, 140, 141, 141, 0, 141, 0, 0, 0, 0, + 0, 0, 0, 141, 141, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 115, 0, 115, 116, - 116, 0, 116, 0, 0, 0, 0, 0, 0, 0, - 116, 116, 116, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 116, 0, 116, 117, 117, - - 0, 117, 0, 0, 0, 0, 0, 0, 0, 117, - 117, 117, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 117, 0, 117, 118, 118, 0, - 118, 0, 0, 0, 0, 0, 0, 0, 118, 118, - 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 118, 0, 118, 127, 127, 0, 127, - 0, 0, 0, 127, 127, 127, 0, 127, 0, 127, - 127, 127, 0, 127, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 141, 0, + 141, 142, 142, 0, 142, 0, 0, 0, 0, 0, + 0, 0, 142, 142, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 127, 239, 239, 239, 239, 239, 240, 240, 240, - 240, 240, 241, 241, 241, 241, 241, 242, 242, 242, - 242, 242, 243, 243, 243, 244, 244, 244, 244, 244, - 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, - 247, 247, 247, 247, 248, 248, 248, 248, 248, 249, - 0, 249, 249, 249, 250, 0, 250, 250, 250, 251, - 251, 251, 0, 251, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238 + 0, 0, 0, 0, 0, 0, 0, 142, 0, 142, + 284, 284, 284, 284, 284, 285, 285, 285, 285, 285, + 286, 286, 286, 286, 286, 287, 287, 287, 287, 287, + 288, 288, 288, 288, 288, 289, 289, 289, 289, 289, + 290, 290, 290, 290, 290, 291, 0, 291, 291, 291, + 292, 292, 292, 292, 292, 293, 293, 293, 293, 293, + 294, 294, 294, 294, 294, 295, 295, 295, 295, 296, + 296, 296, 296, 296, 297, 297, 297, 297, 297, 298, + + 0, 298, 298, 298, 299, 299, 299, 299, 299, 300, + 0, 300, 300, 300, 301, 301, 301, 302, 302, 302, + 0, 302, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283 } ; /* The intent behind this definition is that it'll catch @@ -815,10 +840,28 @@ static char pbcstack[400]; /* XXX missing size checks */ static int pbcpos = 0; static void pbcpush(char x); static int pbcpop(char x); - static int parencount = 0; /* + * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by ${ ... } + */ +static char pbcstack2[400]; /* XXX missing size checks */ +static int pbcpos2 = 0; +static void pbcpush2(char x); +static int pbcpop2(char x); +static int parencount2 = 0; + +/* + * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by $[ ... ] + */ +static char pbcstack3[400]; /* XXX missing size checks */ +static int pbcpos3 = 0; +static void pbcpush3(char x); +static int pbcpop3(char x); +static int parencount3 = 0; + + +/* * current line, column and filename, updated as we read the input. */ static int my_lineno = 1; /* current line in the source */ @@ -905,13 +948,16 @@ static void pbcwhere(const char *text, int *line, int *col ) #define STORE_POS #define STORE_LOC #endif -#line 908 "ael_lex.c" +#line 951 "ael_lex.c" #define INITIAL 0 #define paren 1 #define semic 2 #define argg 3 #define comment 4 +#define curlystate 5 +#define wordstate 6 +#define brackstate 7 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way @@ -1144,10 +1190,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 185 "ael.flex" +#line 204 "ael.flex" -#line 1150 "ael_lex.c" +#line 1196 "ael_lex.c" yylval = yylval_param; @@ -1210,13 +1256,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 239 ) + if ( yy_current_state >= 284 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 238 ); + while ( yy_current_state != 283 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1238,262 +1284,429 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 187 "ael.flex" +#line 206 "ael.flex" { STORE_POS; return LC;} YY_BREAK case 2: YY_RULE_SETUP -#line 188 "ael.flex" +#line 207 "ael.flex" { STORE_POS; return RC;} YY_BREAK case 3: YY_RULE_SETUP -#line 189 "ael.flex" +#line 208 "ael.flex" { STORE_POS; return LP;} YY_BREAK case 4: YY_RULE_SETUP -#line 190 "ael.flex" +#line 209 "ael.flex" { STORE_POS; return RP;} YY_BREAK case 5: YY_RULE_SETUP -#line 191 "ael.flex" +#line 210 "ael.flex" { STORE_POS; return SEMI;} YY_BREAK case 6: YY_RULE_SETUP -#line 192 "ael.flex" +#line 211 "ael.flex" { STORE_POS; return EQ;} YY_BREAK case 7: YY_RULE_SETUP -#line 193 "ael.flex" +#line 212 "ael.flex" { STORE_POS; return COMMA;} YY_BREAK case 8: YY_RULE_SETUP -#line 194 "ael.flex" +#line 213 "ael.flex" { STORE_POS; return COLON;} YY_BREAK case 9: YY_RULE_SETUP -#line 195 "ael.flex" +#line 214 "ael.flex" { STORE_POS; return AMPER;} YY_BREAK case 10: YY_RULE_SETUP -#line 196 "ael.flex" +#line 215 "ael.flex" { STORE_POS; return BAR;} YY_BREAK case 11: YY_RULE_SETUP -#line 197 "ael.flex" +#line 216 "ael.flex" { STORE_POS; return EXTENMARK;} YY_BREAK case 12: YY_RULE_SETUP -#line 198 "ael.flex" +#line 217 "ael.flex" { STORE_POS; return AT;} YY_BREAK case 13: YY_RULE_SETUP -#line 199 "ael.flex" +#line 218 "ael.flex" {/*comment*/} YY_BREAK case 14: YY_RULE_SETUP -#line 200 "ael.flex" +#line 219 "ael.flex" { STORE_POS; return KW_CONTEXT;} YY_BREAK case 15: YY_RULE_SETUP -#line 201 "ael.flex" +#line 220 "ael.flex" { STORE_POS; return KW_ABSTRACT;} YY_BREAK case 16: YY_RULE_SETUP -#line 202 "ael.flex" +#line 221 "ael.flex" { STORE_POS; return KW_EXTEND;} YY_BREAK case 17: YY_RULE_SETUP -#line 203 "ael.flex" +#line 222 "ael.flex" { STORE_POS; return KW_MACRO;}; YY_BREAK case 18: YY_RULE_SETUP -#line 204 "ael.flex" +#line 223 "ael.flex" { STORE_POS; return KW_GLOBALS;} YY_BREAK case 19: YY_RULE_SETUP -#line 205 "ael.flex" +#line 224 "ael.flex" { STORE_POS; return KW_IGNOREPAT;} YY_BREAK case 20: YY_RULE_SETUP -#line 206 "ael.flex" +#line 225 "ael.flex" { STORE_POS; return KW_SWITCH;} YY_BREAK case 21: YY_RULE_SETUP -#line 207 "ael.flex" +#line 226 "ael.flex" { STORE_POS; return KW_IF;} YY_BREAK case 22: YY_RULE_SETUP -#line 208 "ael.flex" +#line 227 "ael.flex" { STORE_POS; return KW_IFTIME;} YY_BREAK case 23: YY_RULE_SETUP -#line 209 "ael.flex" +#line 228 "ael.flex" { STORE_POS; return KW_RANDOM;} YY_BREAK case 24: YY_RULE_SETUP -#line 210 "ael.flex" +#line 229 "ael.flex" { STORE_POS; return KW_REGEXTEN;} YY_BREAK case 25: YY_RULE_SETUP -#line 211 "ael.flex" +#line 230 "ael.flex" { STORE_POS; return KW_HINT;} YY_BREAK case 26: YY_RULE_SETUP -#line 212 "ael.flex" +#line 231 "ael.flex" { STORE_POS; return KW_ELSE;} YY_BREAK case 27: YY_RULE_SETUP -#line 213 "ael.flex" +#line 232 "ael.flex" { STORE_POS; return KW_GOTO;} YY_BREAK case 28: YY_RULE_SETUP -#line 214 "ael.flex" +#line 233 "ael.flex" { STORE_POS; return KW_JUMP;} YY_BREAK case 29: YY_RULE_SETUP -#line 215 "ael.flex" +#line 234 "ael.flex" { STORE_POS; return KW_RETURN;} YY_BREAK case 30: YY_RULE_SETUP -#line 216 "ael.flex" +#line 235 "ael.flex" { STORE_POS; return KW_BREAK;} YY_BREAK case 31: YY_RULE_SETUP -#line 217 "ael.flex" +#line 236 "ael.flex" { STORE_POS; return KW_CONTINUE;} YY_BREAK case 32: YY_RULE_SETUP -#line 218 "ael.flex" +#line 237 "ael.flex" { STORE_POS; return KW_FOR;} YY_BREAK case 33: YY_RULE_SETUP -#line 219 "ael.flex" +#line 238 "ael.flex" { STORE_POS; return KW_WHILE;} YY_BREAK case 34: YY_RULE_SETUP -#line 220 "ael.flex" +#line 239 "ael.flex" { STORE_POS; return KW_CASE;} YY_BREAK case 35: YY_RULE_SETUP -#line 221 "ael.flex" +#line 240 "ael.flex" { STORE_POS; return KW_DEFAULT;} YY_BREAK case 36: YY_RULE_SETUP -#line 222 "ael.flex" +#line 241 "ael.flex" { STORE_POS; return KW_PATTERN;} YY_BREAK case 37: YY_RULE_SETUP -#line 223 "ael.flex" +#line 242 "ael.flex" { STORE_POS; return KW_CATCH;} YY_BREAK case 38: YY_RULE_SETUP -#line 224 "ael.flex" +#line 243 "ael.flex" { STORE_POS; return KW_SWITCHES;} YY_BREAK case 39: YY_RULE_SETUP -#line 225 "ael.flex" +#line 244 "ael.flex" { STORE_POS; return KW_ESWITCHES;} YY_BREAK case 40: YY_RULE_SETUP -#line 226 "ael.flex" +#line 245 "ael.flex" { STORE_POS; return KW_INCLUDES;} YY_BREAK case 41: YY_RULE_SETUP -#line 227 "ael.flex" +#line 246 "ael.flex" { BEGIN(comment); my_col += 2; } YY_BREAK case 42: YY_RULE_SETUP -#line 229 "ael.flex" +#line 248 "ael.flex" { my_col += yyleng; } YY_BREAK case 43: /* rule 43 can match eol */ YY_RULE_SETUP -#line 230 "ael.flex" +#line 249 "ael.flex" { ++my_lineno; my_col=1;} YY_BREAK case 44: YY_RULE_SETUP -#line 231 "ael.flex" +#line 250 "ael.flex" { my_col += yyleng; } YY_BREAK case 45: /* rule 45 can match eol */ YY_RULE_SETUP -#line 232 "ael.flex" +#line 251 "ael.flex" { ++my_lineno; my_col=1;} YY_BREAK case 46: YY_RULE_SETUP -#line 233 "ael.flex" -{ my_col += 2; BEGIN(INITIAL); } +#line 252 "ael.flex" +{ my_col += 2; BEGIN(INITIAL); } /* the nice thing about comments is that you know exactly what ends them */ YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP -#line 235 "ael.flex" +#line 254 "ael.flex" { my_lineno++; my_col = 1; } YY_BREAK case 48: YY_RULE_SETUP -#line 236 "ael.flex" +#line 255 "ael.flex" { my_col += yyleng; } YY_BREAK case 49: YY_RULE_SETUP -#line 237 "ael.flex" +#line 256 "ael.flex" { my_col += (yyleng*8)-(my_col%8); } YY_BREAK case 50: YY_RULE_SETUP -#line 239 "ael.flex" +#line 258 "ael.flex" +{ + /* boy did I open a can of worms when I changed the lexical token "word". + all the above keywords can be used as a beginning to a "word".- + before, a "word" would match a longer sequence than the above + keywords, and all would be well. But now "word" is a single char + and feeds into a statemachine sort of sequence from there on. So... + I added the {KEYWORD}? to the beginning of the word match sequence */ + + if (!strcmp(yytext,"${")) { + parencount2 = 0; + pbcpos2 = 0; + pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */ + BEGIN(curlystate); + yymore(); + } else if (!strcmp(yytext,"$[")) { + parencount3 = 0; + pbcpos3 = 0; + pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */ + BEGIN(brackstate); + yymore(); + } else { + BEGIN(wordstate); + yymore(); + } + } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 283 "ael.flex" +{ yymore(); /* Keep going */ } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 284 "ael.flex" +{ yymore(); /* Keep Going */ } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 285 "ael.flex" +{ /* the beginning of a ${} construct. prepare and pop into curlystate */ + parencount2 = 0; + pbcpos2 = 0; + pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */ + BEGIN(curlystate); + yymore(); + } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 292 "ael.flex" +{ /* the beginning of a $[] construct. prepare and pop into brackstate */ + parencount3 = 0; + pbcpos3 = 0; + pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */ + BEGIN(brackstate); + yymore(); + } + YY_BREAK +case 55: +/* rule 55 can match eol */ +YY_RULE_SETUP +#line 299 "ael.flex" { + /* a non-word constituent char, like a space, tab, curly, paren, etc */ + char c = yytext[yyleng-1]; STORE_POS; yylval->str = strdup(yytext); + yylval->str[yyleng-1] = 0; + unput(c); /* put this ending char back in the stream */ + BEGIN(0); prev_word = yylval->str; return word; } YY_BREAK +case 56: +/* rule 56 can match eol */ +YY_RULE_SETUP +#line 310 "ael.flex" +{ + if ( pbcpop2('}') ) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + parencount2--; + if ( parencount2 >= 0) { + yymore(); + } else { + BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */ + yymore(); + } + } + YY_BREAK +case 57: +/* rule 57 can match eol */ +YY_RULE_SETUP +#line 327 "ael.flex" +{ + char c = yytext[yyleng-1]; + if (c == '{') + parencount2++; + pbcpush2(c); + yymore(); + } + YY_BREAK +case 58: +/* rule 58 can match eol */ +YY_RULE_SETUP +#line 335 "ael.flex" +{ + char c = yytext[yyleng-1]; + if ( pbcpop2(c)) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", + my_file, my_lineno, my_col, c); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + yymore(); + } + YY_BREAK +case 59: +/* rule 59 can match eol */ +YY_RULE_SETUP +#line 349 "ael.flex" +{ + if ( pbcpop3(']') ) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + parencount3--; + if ( parencount3 >= 0) { + yymore(); + } else { + BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */ + yymore(); + } + } + YY_BREAK +case 60: +/* rule 60 can match eol */ +YY_RULE_SETUP +#line 366 "ael.flex" +{ + char c = yytext[yyleng-1]; + if (c == '[') + parencount3++; + pbcpush3(c); + yymore(); + } + YY_BREAK +case 61: +/* rule 61 can match eol */ +YY_RULE_SETUP +#line 374 "ael.flex" +{ + char c = yytext[yyleng-1]; + if ( pbcpop3(c)) { /* error */ + STORE_LOC; + ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", + my_file, my_lineno, my_col, c); + BEGIN(0); + yylval->str = strdup(yytext); + return word; + } + yymore(); + } + YY_BREAK /* * context used for arguments of if_head, random_head, switch_head, * for (last statement), while (XXX why not iftime_head ?). @@ -1501,10 +1714,10 @@ YY_RULE_SETUP * A comma at the top level is valid here, unlike in argg where it * is an argument separator so it must be returned as a token. */ -case 51: -/* rule 51 can match eol */ +case 62: +/* rule 62 can match eol */ YY_RULE_SETUP -#line 255 "ael.flex" +#line 395 "ael.flex" { if ( pbcpop(')') ) { /* error */ STORE_LOC; @@ -1527,10 +1740,10 @@ YY_RULE_SETUP } } YY_BREAK -case 52: -/* rule 52 can match eol */ +case 63: +/* rule 63 can match eol */ YY_RULE_SETUP -#line 277 "ael.flex" +#line 417 "ael.flex" { char c = yytext[yyleng-1]; if (c == '(') @@ -1539,10 +1752,10 @@ YY_RULE_SETUP yymore(); } YY_BREAK -case 53: -/* rule 53 can match eol */ +case 64: +/* rule 64 can match eol */ YY_RULE_SETUP -#line 285 "ael.flex" +#line 425 "ael.flex" { char c = yytext[yyleng-1]; if ( pbcpop(c)) { /* error */ @@ -1564,10 +1777,10 @@ YY_RULE_SETUP * of the (external) call, which happens when parencount == 0 * before the decrement. */ -case 54: -/* rule 54 can match eol */ +case 65: +/* rule 65 can match eol */ YY_RULE_SETUP -#line 307 "ael.flex" +#line 447 "ael.flex" { char c = yytext[yyleng-1]; if (c == '(') @@ -1576,10 +1789,10 @@ YY_RULE_SETUP yymore(); } YY_BREAK -case 55: -/* rule 55 can match eol */ +case 66: +/* rule 66 can match eol */ YY_RULE_SETUP -#line 315 "ael.flex" +#line 455 "ael.flex" { if ( pbcpop(')') ) { /* error */ STORE_LOC; @@ -1604,10 +1817,10 @@ YY_RULE_SETUP } } YY_BREAK -case 56: -/* rule 56 can match eol */ +case 67: +/* rule 67 can match eol */ YY_RULE_SETUP -#line 339 "ael.flex" +#line 479 "ael.flex" { if( parencount != 0) { /* printf("Folding in a comma!\n"); */ yymore(); @@ -1622,10 +1835,10 @@ YY_RULE_SETUP } } YY_BREAK -case 57: -/* rule 57 can match eol */ +case 68: +/* rule 68 can match eol */ YY_RULE_SETUP -#line 353 "ael.flex" +#line 493 "ael.flex" { char c = yytext[yyleng-1]; if ( pbcpop(c) ) { /* error */ @@ -1643,20 +1856,20 @@ YY_RULE_SETUP * or in the first and second operand of a 'for'. As above, match * commas and use ';' as a separator (hence return it as a separate token). */ -case 58: -/* rule 58 can match eol */ +case 69: +/* rule 69 can match eol */ YY_RULE_SETUP -#line 370 "ael.flex" +#line 510 "ael.flex" { char c = yytext[yyleng-1]; yymore(); pbcpush(c); } YY_BREAK -case 59: -/* rule 59 can match eol */ +case 70: +/* rule 70 can match eol */ YY_RULE_SETUP -#line 376 "ael.flex" +#line 516 "ael.flex" { char c = yytext[yyleng-1]; if ( pbcpop(c) ) { /* error */ @@ -1669,10 +1882,10 @@ YY_RULE_SETUP yymore(); } YY_BREAK -case 60: -/* rule 60 can match eol */ +case 71: +/* rule 71 can match eol */ YY_RULE_SETUP -#line 388 "ael.flex" +#line 528 "ael.flex" { STORE_LOC; yylval->str = strdup(yytext); @@ -1682,10 +1895,10 @@ YY_RULE_SETUP return word; } YY_BREAK -case 61: -/* rule 61 can match eol */ +case 72: +/* rule 72 can match eol */ YY_RULE_SETUP -#line 397 "ael.flex" +#line 537 "ael.flex" { char fnamebuf[1024],*p1,*p2; int glob_ret; @@ -1731,7 +1944,10 @@ case YY_STATE_EOF(paren): case YY_STATE_EOF(semic): case YY_STATE_EOF(argg): case YY_STATE_EOF(comment): -#line 438 "ael.flex" +case YY_STATE_EOF(curlystate): +case YY_STATE_EOF(wordstate): +case YY_STATE_EOF(brackstate): +#line 578 "ael.flex" { char fnamebuf[2048]; if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) { @@ -1764,12 +1980,12 @@ case YY_STATE_EOF(comment): } } YY_BREAK -case 62: +case 73: YY_RULE_SETUP -#line 470 "ael.flex" +#line 610 "ael.flex" ECHO; YY_BREAK -#line 1772 "ael_lex.c" +#line 1988 "ael_lex.c" case YY_END_OF_BUFFER: { @@ -2054,7 +2270,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 239 ) + if ( yy_current_state >= 284 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2083,11 +2299,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 239 ) + if ( yy_current_state >= 284 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 238); + yy_is_jam = (yy_current_state == 283); return yy_is_jam ? 0 : yy_current_state; } @@ -2894,7 +3110,7 @@ void *ael_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 470 "ael.flex" +#line 610 "ael.flex" @@ -2920,6 +3136,38 @@ static int pbcpop(char x) return 1; /* error */ } +static void pbcpush2(char x) +{ + pbcstack2[pbcpos2++] = x; +} + +static int pbcpop2(char x) +{ + if ( ( x == ')' && pbcstack2[pbcpos2-1] == '(' ) + || ( x == ']' && pbcstack2[pbcpos2-1] == '[' ) + || ( x == '}' && pbcstack2[pbcpos2-1] == '{' )) { + pbcpos2--; + return 0; + } + return 1; /* error */ +} + +static void pbcpush3(char x) +{ + pbcstack3[pbcpos3++] = x; +} + +static int pbcpop3(char x) +{ + if ( ( x == ')' && pbcstack3[pbcpos3-1] == '(' ) + || ( x == ']' && pbcstack3[pbcpos3-1] == '[' ) + || ( x == '}' && pbcstack3[pbcpos3-1] == '{' )) { + pbcpos3--; + return 0; + } + return 1; /* error */ +} + static int c_prevword(void) { char *c = prev_word; |