remove duplicated code
authorLuigi Rizzo <rizzo@icir.org>
Thu, 27 Apr 2006 11:20:26 +0000 (11:20 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Thu, 27 Apr 2006 11:20:26 +0000 (11:20 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@22842 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx/ael/ael.flex
pbx/ael/ael_lex.c

index a217652..7e81101 100644 (file)
@@ -167,51 +167,24 @@ includes  { STORE_POS; return KW_INCLUDES;}
                }
        }
 
-<paren>{NOPARENS}\(    {
+<paren>{NOPARENS}[\(\[\{]      {
+               char c = yytext[yyleng-1];
                yylloc->first_line = my_lineno;
                yylloc->first_column=my_col;
-               parencount++;
-               pbcpush('(');
-               yymore();
-       }
-
-<paren>{NOPARENS}\[    {
-               yylloc->first_line = my_lineno;
-               yylloc->first_column=my_col;
-               pbcpush('[');
-               yymore();
-       }
-
-<paren>{NOPARENS}\]    {
-               yylloc->first_line = my_lineno;
-               yylloc->first_column=my_col;
-               if ( pbcpop(']') ) { /* error */
-                       pbcwhere(yytext, &my_lineno, &my_col);
-                       ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ']' in expression!\n",
-                               my_file, my_lineno, my_col);
-                       BEGIN(0);
-                       yylloc->last_line = my_lineno;
-                       yylloc->last_column = my_col;
-                       yylval->str = strdup(yytext);
-                       return word;
-               }
-               yymore();
-       }
-
-<paren>{NOPARENS}\{    {
-               yylloc->first_line = my_lineno;
-               yylloc->first_column=my_col;
-               pbcpush('{');
+               if (c == '(')
+                       parencount++;
+               pbcpush(c);
                yymore();
        }
 
-<paren>{NOPARENS}\}    {
+<paren>{NOPARENS}[\]\}]        {
+               char c = yytext[yyleng-1];
                yylloc->first_line = my_lineno;
                yylloc->first_column=my_col;
-               if ( pbcpop('}') ) { /* error */
+               if ( pbcpop(c))  { /* error */
                        pbcwhere(yytext, &my_lineno, &my_col);
-                       ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '}' in expression!\n",
-                               my_file, my_lineno, my_col);
+                       ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
+                               my_file, my_lineno, my_col, c);
                        BEGIN(0);
                        yylloc->last_line = my_lineno;
                        yylloc->last_column = my_col;
@@ -221,9 +194,6 @@ includes    { STORE_POS; return KW_INCLUDES;}
                yymore();
        }
 
-
-
-
 <argg>{NOARGG}\(         {
                /* printf("ARGG:%s\n",yytext); */
                /* printf("GOT AN LP!!!\n"); */
@@ -539,18 +509,22 @@ static int pbcpop(char x)
 static int c_prevword(void)
 {
        char *c = prev_word;
-       int ret = 0;
-       while ( c && *c ) {
+       if (c == NULL)
+               return 0;
+       while ( *c ) {
                switch (*c) {
-               case '{': pbcpush('{');break;
-               case '}': ret = pbcpop('}');break;
-               case '[':pbcpush('[');break;
-               case ']':ret = pbcpop(']');break;
-               case '(':pbcpush('(');break;
-               case ')':ret = pbcpop(')'); break;
+               case '{':
+               case '[':
+               case '(':
+                       pbcpush(*c);
+                       break;
+               case '}':
+               case ']':
+               case ')':
+                       if (pbcpop(*c))
+                               return 1;
+                       break;
                }
-               if( ret )
-                       return 1;
                c++;
        }
        return 0;
index 56ffed4..8be184f 100644 (file)
@@ -356,8 +356,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 65
-#define YY_END_OF_BUFFER 66
+#define YY_NUM_RULES 62
+#define YY_END_OF_BUFFER 63
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -365,33 +365,32 @@ struct yy_trans_info
        flex_int32_t yy_verify;
        flex_int32_t yy_nxt;
        };
-static yyconst flex_int16_t yy_accept[226] =
+static yyconst flex_int16_t yy_accept[220] =
     {   0,
-        0,    0,    0,    0,    0,    0,    0,    0,   66,   65,
+        0,    0,    0,    0,    0,    0,    0,    0,   63,   62,
        42,   40,   41,   43,   43,    9,    3,    4,    7,   43,
         8,    5,    6,   12,   43,   43,   43,   43,   43,   43,
        43,   43,   43,   43,   43,   43,   43,   43,   43,    1,
-       10,    2,   65,   45,   44,   46,   47,   48,   49,   65,
-       59,   62,   63,   57,   60,   58,   61,   65,   50,   53,
-       54,   51,   56,   52,   55,   42,   41,   43,   43,   13,
-       11,   43,   43,   43,   43,   43,   43,   43,   43,   43,
-       43,   43,   20,   43,   43,   43,   43,   43,   43,   43,
-       43,   43,    0,   45,   44,   46,   47,   48,   49,    0,
-
-       59,   62,   63,   57,   60,   58,   61,    0,   50,   53,
-       54,   51,   56,   52,   55,   43,   13,   13,   43,   43,
-       43,   43,   43,   43,   43,   43,   31,   43,   43,   43,
-       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
-       43,   43,   43,   43,   33,   43,   43,   43,   25,   43,
-       43,   26,   24,   43,   43,   43,   27,   43,   43,   43,
-       43,   43,   43,   43,   43,   43,   29,   36,   43,   43,
-       43,   43,   43,   43,   43,   43,   16,   43,   43,   43,
-       43,   43,   32,   43,   43,   43,   43,   43,   43,   43,
-       21,   43,   43,   43,   22,   43,   28,   19,   43,   43,
-
-       14,   43,   34,   43,   17,   43,   43,   35,   43,   43,
-       43,   15,   30,   43,   43,   39,   23,   37,    0,   38,
-       18,    0,    0,   64,    0
+       10,    2,   62,   45,   44,   46,   62,   56,   59,   60,
+       54,   57,   55,   58,   62,   47,   50,   51,   48,   53,
+       49,   52,   42,   41,   43,   43,   13,   11,   43,   43,
+       43,   43,   43,   43,   43,   43,   43,   43,   43,   20,
+       43,   43,   43,   43,   43,   43,   43,   43,   43,    0,
+       45,   44,   46,    0,   56,   59,   60,   54,   57,   55,
+
+       58,    0,   47,   50,   51,   48,   53,   49,   52,   43,
+       13,   13,   43,   43,   43,   43,   43,   43,   43,   43,
+       31,   43,   43,   43,   43,   43,   43,   43,   43,   43,
+       43,   43,   43,   43,   43,   43,   43,   43,   33,   43,
+       43,   43,   25,   43,   43,   26,   24,   43,   43,   43,
+       27,   43,   43,   43,   43,   43,   43,   43,   43,   43,
+       29,   36,   43,   43,   43,   43,   43,   43,   43,   43,
+       16,   43,   43,   43,   43,   43,   32,   43,   43,   43,
+       43,   43,   43,   43,   21,   43,   43,   43,   22,   43,
+       28,   19,   43,   43,   14,   43,   34,   43,   17,   43,
+
+       43,   35,   43,   43,   43,   15,   30,   43,   43,   39,
+       23,   37,    0,   38,   18,    0,    0,   61,    0
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -435,64 +434,62 @@ static yyconst flex_int32_t yy_meta[46] =
         3,    3,    3,    1,    3
     } ;
 
-static yyconst flex_int16_t yy_base[236] =
+static yyconst flex_int16_t yy_base[230] =
     {   0,
         0,    0,   37,   40,   77,  114,  151,  188,  237,  507,
       234,  507,  228,    0,  201,  507,  507,  507,  507,  217,
       507,  507,  212,  507,  205,  189,   27,  200,   20,  189,
        19,  194,   37,  182,  200,  199,   40,  178,  190,  507,
-      507,  507,   57,  507,  507,  507,  507,  507,  507,  225,
-      507,  507,  507,  507,  507,  507,  507,  262,  507,  507,
-      507,  507,  507,  507,  507,  215,  212,    0,  181,  307,
-      507,  176,  188,   30,  178,  185,  172,  168,  169,  170,
-      165,  169,  184,  167,  177,  162,  170,  153,  157,   45,
-      161,  160,   69,  507,  507,  507,  507,  507,  507,  343,
-
-      507,  507,  507,  507,  507,  507,  507,  380,  507,  507,
-      507,  507,  507,  507,  507,  165,    0,  425,  148,  165,
-      160,  161,  144,  161,  156,  151,    0,  157,  143,  138,
-      147,  140,  142,  137,  135,  130,  144,  142,  126,  126,
-      132,  131,  121,  125,    0,  127,   45,  114,    0,  114,
-      131,    0,    0,  118,  113,  109,    0,  113,  122,  111,
-      103,  107,  120,  117,  101,  119,    0,    0,   97,  104,
-      105,  113,  103,  107,  106,  106,    0,   92,   94,   87,
-       91,   93,    0,   95,   95,   78,   76,   76,   85,   73,
-        0,   74,   84,   74,    0,   82,    0,   81,   80,   65,
-
-        0,   78,    0,   76,    0,   78,   60,    0,   61,   55,
-       51,    0,    0,   43,   36,    0,    0,    0,   88,    0,
-        0,    0,   67,  507,  507,  469,  473,  477,  479,  483,
-      487,  491,  495,  499,  503
+      507,  507,   57,  507,  507,  507,  225,  507,  507,  507,
+      507,  507,  507,  507,  262,  507,  507,  507,  507,  507,
+      507,  507,  215,  212,    0,  181,  307,  507,  176,  188,
+       30,  178,  185,  172,  168,  169,  170,  165,  169,  184,
+      167,  177,  162,  170,  153,  157,   45,  161,  160,   69,
+      507,  507,  507,  343,  507,  507,  507,  507,  507,  507,
+
+      507,  380,  507,  507,  507,  507,  507,  507,  507,  165,
+        0,  425,  148,  165,  160,  161,  144,  161,  156,  151,
+        0,  157,  143,  138,  147,  140,  142,  137,  135,  130,
+      144,  142,  126,  126,  132,  131,  121,  125,    0,  127,
+       45,  114,    0,  114,  131,    0,    0,  118,  113,  109,
+        0,  113,  122,  111,  103,  107,  120,  117,  101,  119,
+        0,    0,   97,  104,  105,  113,  103,  107,  106,  106,
+        0,   92,   94,   87,   91,   93,    0,   95,   95,   78,
+       76,   76,   85,   73,    0,   74,   84,   74,    0,   82,
+        0,   81,   80,   65,    0,   78,    0,   76,    0,   78,
+
+       60,    0,   61,   55,   51,    0,    0,   43,   36,    0,
+        0,    0,   88,    0,    0,    0,   67,  507,  507,  469,
+      473,  477,  479,  483,  487,  491,  495,  499,  503
     } ;
 
-static yyconst flex_int16_t yy_def[236] =
+static yyconst flex_int16_t yy_def[230] =
     {   0,
-      225,    1,  226,  226,  227,  227,  228,  228,  225,  225,
-      225,  225,  225,  229,  229,  225,  225,  225,  225,  229,
-      225,  225,  225,  225,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  225,
-      225,  225,  230,  225,  225,  225,  225,  225,  225,  231,
-      225,  225,  225,  225,  225,  225,  225,  232,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  229,  229,  233,
-      225,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  230,  225,  225,  225,  225,  225,  225,  231,
-
-      225,  225,  225,  225,  225,  225,  225,  232,  225,  225,
-      225,  225,  225,  225,  225,  229,  234,  233,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-
-      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229,  229,  229,  229,  229,  229,  229,  225,  229,
-      229,  235,  235,  225,    0,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225
+      219,    1,  220,  220,  221,  221,  222,  222,  219,  219,
+      219,  219,  219,  223,  223,  219,  219,  219,  219,  223,
+      219,  219,  219,  219,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  219,
+      219,  219,  224,  219,  219,  219,  225,  219,  219,  219,
+      219,  219,  219,  219,  226,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  223,  223,  227,  219,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  224,
+      219,  219,  219,  225,  219,  219,  219,  219,  219,  219,
+
+      219,  226,  219,  219,  219,  219,  219,  219,  219,  223,
+      228,  227,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+
+      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  219,  223,  223,  229,  229,  219,    0,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219
     } ;
 
 static yyconst flex_int16_t yy_nxt[553] =
@@ -501,63 +498,63 @@ static yyconst flex_int16_t yy_nxt[553] =
        19,   20,   21,   22,   23,   14,   24,   14,   14,   14,
        25,   26,   27,   28,   29,   30,   31,   32,   33,   34,
        14,   14,   35,   14,   14,   36,   37,   38,   14,   14,
-       39,   14,   40,   41,   42,   44,   45,   74,   44,   45,
-       80,   77,  219,   81,  219,   46,   47,   78,   46,   47,
-       89,   75,   83,   84,   90,   94,   95,  121,  122,  169,
-       85,  138,  224,  170,  221,   96,   97,   94,   95,   48,
-      220,   49,   48,  139,   49,   51,   52,   96,   97,  219,
-       53,  219,  218,  222,  217,   54,   55,  216,  215,   98,
-
-      214,   99,  213,  212,  211,  210,  209,  208,  207,  206,
-      205,   98,  204,   99,  203,  202,  201,  200,  199,   56,
-      198,   57,   51,   52,  197,  196,  195,   53,  194,  193,
-      192,  191,   54,   55,  190,  189,  188,  187,  186,  185,
-      184,  183,  182,  181,  180,  179,  178,  177,  176,  175,
-      174,  173,  172,  171,  168,  167,   56,  166,   57,   59,
-       60,   61,  165,  164,  163,  162,  161,  160,  159,   62,
-       63,  158,  157,  156,  155,  154,  153,  152,  151,  150,
-      149,  148,  147,  146,  145,  144,  143,  142,  141,  140,
-      137,  136,  135,   64,  134,   65,   59,   60,   61,  133,
-
-      132,  131,  130,  129,  128,  127,   62,   63,  126,  125,
-      124,  123,  120,  119,  116,   67,   66,   92,   91,   88,
-       87,   86,   82,   79,   76,   73,   72,   71,   70,   69,
-       64,   67,   65,  101,  102,   66,  225,  225,  103,  225,
-      225,  225,  225,  104,  105,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  106,  225,  107,
-      109,  110,  111,  225,  225,  225,  225,  225,  225,  225,
-      112,  113,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-
-      225,  225,  225,  225,  114,  225,  115,  117,  117,  225,
-      117,  225,  225,  225,  117,  117,  117,  117,  225,  117,
-      117,  117,  225,  117,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      117,  101,  102,  225,  225,  225,  103,  225,  225,  225,
-      225,  104,  105,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  106,  225,  107,  109,  110,
-      111,  225,  225,  225,  225,  225,  225,  225,  112,  113,
-
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  114,  225,  115,  117,  117,  225,  117,  225,
-      225,  225,  117,  117,  117,  117,  225,  117,  117,  117,
-      225,  117,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  117,   43,
-       43,   43,   43,   50,   50,   50,   50,   58,   58,   58,
-       58,   68,   68,   93,   93,   93,   93,  100,  100,  100,
-      100,  108,  108,  108,  108,  118,  225,  118,  118,  117,
-
-      225,  117,  117,  223,  223,  223,    9,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225
+       39,   14,   40,   41,   42,   44,   45,   71,   44,   45,
+       77,   74,  213,   78,  213,   44,   46,   75,   44,   46,
+       86,   72,   80,   81,   87,   91,   92,  115,  116,  163,
+       82,  132,  218,  164,  215,   91,   93,   91,   92,   44,
+      214,   46,   44,  133,   46,   48,   49,   91,   93,  213,
+       50,  213,  212,  216,  211,   51,   52,  210,  209,   91,
+
+      208,   93,  207,  206,  205,  204,  203,  202,  201,  200,
+      199,   91,  198,   93,  197,  196,  195,  194,  193,   53,
+      192,   54,   48,   49,  191,  190,  189,   50,  188,  187,
+      186,  185,   51,   52,  184,  183,  182,  181,  180,  179,
+      178,  177,  176,  175,  174,  173,  172,  171,  170,  169,
+      168,  167,  166,  165,  162,  161,   53,  160,   54,   56,
+       57,   58,  159,  158,  157,  156,  155,  154,  153,   59,
+       60,  152,  151,  150,  149,  148,  147,  146,  145,  144,
+      143,  142,  141,  140,  139,  138,  137,  136,  135,  134,
+      131,  130,  129,   61,  128,   62,   56,   57,   58,  127,
+
+      126,  125,  124,  123,  122,  121,   59,   60,  120,  119,
+      118,  117,  114,  113,  110,   64,   63,   89,   88,   85,
+       84,   83,   79,   76,   73,   70,   69,   68,   67,   66,
+       61,   64,   62,   95,   96,   63,  219,  219,   97,  219,
+      219,  219,  219,   98,   99,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  100,  219,  101,
+      103,  104,  105,  219,  219,  219,  219,  219,  219,  219,
+      106,  107,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+
+      219,  219,  219,  219,  108,  219,  109,  111,  111,  219,
+      111,  219,  219,  219,  111,  111,  111,  111,  219,  111,
+      111,  111,  219,  111,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      111,   95,   96,  219,  219,  219,   97,  219,  219,  219,
+      219,   98,   99,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  100,  219,  101,  103,  104,
+      105,  219,  219,  219,  219,  219,  219,  219,  106,  107,
+
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  108,  219,  109,  111,  111,  219,  111,  219,
+      219,  219,  111,  111,  111,  111,  219,  111,  111,  111,
+      219,  111,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  111,   43,
+       43,   43,   43,   47,   47,   47,   47,   55,   55,   55,
+       55,   65,   65,   90,   90,   90,   90,   94,   94,   94,
+       94,  102,  102,  102,  102,  112,  219,  112,  112,  111,
+
+      219,  111,  111,  217,  217,  217,    9,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219
     } ;
 
 static yyconst flex_int16_t yy_chk[553] =
@@ -567,62 +564,62 @@ static yyconst flex_int16_t yy_chk[553] =
         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,   27,    4,    4,
-       31,   29,  211,   31,  211,    3,    3,   29,    4,    4,
-       37,   27,   33,   33,   37,   43,   43,   74,   74,  147,
-       33,   90,  223,  147,  215,   43,   43,   93,   93,    3,
-      214,    3,    4,   90,    4,    5,    5,   93,   93,  219,
-        5,  219,  210,  219,  209,    5,    5,  207,  206,   43,
-
-      204,   43,  202,  200,  199,  198,  196,  194,  193,  192,
-      190,   93,  189,   93,  188,  187,  186,  185,  184,    5,
-      182,    5,    6,    6,  181,  180,  179,    6,  178,  176,
-      175,  174,    6,    6,  173,  172,  171,  170,  169,  166,
-      165,  164,  163,  162,  161,  160,  159,  158,  156,  155,
-      154,  151,  150,  148,  146,  144,    6,  143,    6,    7,
-        7,    7,  142,  141,  140,  139,  138,  137,  136,    7,
-        7,  135,  134,  133,  132,  131,  130,  129,  128,  126,
-      125,  124,  123,  122,  121,  120,  119,  116,   92,   91,
-       89,   88,   87,    7,   86,    7,    8,    8,    8,   85,
-
-       84,   83,   82,   81,   80,   79,    8,    8,   78,   77,
-       76,   75,   73,   72,   69,   67,   66,   39,   38,   36,
+       31,   29,  205,   31,  205,    3,    3,   29,    4,    4,
+       37,   27,   33,   33,   37,   43,   43,   71,   71,  141,
+       33,   87,  217,  141,  209,   43,   43,   90,   90,    3,
+      208,    3,    4,   87,    4,    5,    5,   90,   90,  213,
+        5,  213,  204,  213,  203,    5,    5,  201,  200,   43,
+
+      198,   43,  196,  194,  193,  192,  190,  188,  187,  186,
+      184,   90,  183,   90,  182,  181,  180,  179,  178,    5,
+      176,    5,    6,    6,  175,  174,  173,    6,  172,  170,
+      169,  168,    6,    6,  167,  166,  165,  164,  163,  160,
+      159,  158,  157,  156,  155,  154,  153,  152,  150,  149,
+      148,  145,  144,  142,  140,  138,    6,  137,    6,    7,
+        7,    7,  136,  135,  134,  133,  132,  131,  130,    7,
+        7,  129,  128,  127,  126,  125,  124,  123,  122,  120,
+      119,  118,  117,  116,  115,  114,  113,  110,   89,   88,
+       86,   85,   84,    7,   83,    7,    8,    8,    8,   82,
+
+       81,   80,   79,   78,   77,   76,    8,    8,   75,   74,
+       73,   72,   70,   69,   66,   64,   63,   39,   38,   36,
        35,   34,   32,   30,   28,   26,   25,   23,   20,   15,
-        8,   13,    8,   50,   50,   11,    9,    0,   50,    0,
-        0,    0,    0,   50,   50,    0,    0,    0,    0,    0,
+        8,   13,    8,   47,   47,   11,    9,    0,   47,    0,
+        0,    0,    0,   47,   47,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,   50,    0,   50,
-       58,   58,   58,    0,    0,    0,    0,    0,    0,    0,
-       58,   58,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   47,    0,   47,
+       55,   55,   55,    0,    0,    0,    0,    0,    0,    0,
+       55,   55,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
-        0,    0,    0,    0,   58,    0,   58,   70,   70,    0,
-       70,    0,    0,    0,   70,   70,   70,   70,    0,   70,
-       70,   70,    0,   70,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,   55,    0,   55,   67,   67,    0,
+       67,    0,    0,    0,   67,   67,   67,   67,    0,   67,
+       67,   67,    0,   67,    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,
-       70,  100,  100,    0,    0,    0,  100,    0,    0,    0,
-        0,  100,  100,    0,    0,    0,    0,    0,    0,    0,
+       67,   94,   94,    0,    0,    0,   94,    0,    0,    0,
+        0,   94,   94,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  100,    0,  100,  108,  108,
-      108,    0,    0,    0,    0,    0,    0,    0,  108,  108,
+        0,    0,    0,    0,    0,   94,    0,   94,  102,  102,
+      102,    0,    0,    0,    0,    0,    0,    0,  102,  102,
 
         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,  118,  118,    0,  118,    0,
-        0,    0,  118,  118,  118,  118,    0,  118,  118,  118,
-        0,  118,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  102,    0,  102,  112,  112,    0,  112,    0,
+        0,    0,  112,  112,  112,  112,    0,  112,  112,  112,
+        0,  112,    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,  118,  226,
-      226,  226,  226,  227,  227,  227,  227,  228,  228,  228,
-      228,  229,  229,  230,  230,  230,  230,  231,  231,  231,
-      231,  232,  232,  232,  232,  233,    0,  233,  233,  234,
-
-        0,  234,  234,  235,  235,  235,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225
+        0,    0,    0,    0,    0,    0,    0,    0,  112,  220,
+      220,  220,  220,  221,  221,  221,  221,  222,  222,  222,
+      222,  223,  223,  224,  224,  224,  224,  225,  225,  225,
+      225,  226,  226,  226,  226,  227,    0,  227,  227,  228,
+
+        0,  228,  228,  229,  229,  229,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219
     } ;
 
 /* The intent behind this definition is that it'll catch
@@ -699,7 +696,7 @@ static int include_stack_index = 0;
        } while (0)
 
 /* %option yylineno I've tried hard, but haven't been able to use this */
-#line 703 "ael_lex.c"
+#line 700 "ael_lex.c"
 
 #define INITIAL 0
 #define paren 1
@@ -942,7 +939,7 @@ YY_DECL
 #line 83 "ael.flex"
 
 
-#line 946 "ael_lex.c"
+#line 943 "ael_lex.c"
 
     yylval = yylval_param;
 
@@ -1005,13 +1002,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 >= 226 )
+                               if ( yy_current_state >= 220 )
                                        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 != 225 );
+               while ( yy_current_state != 219 );
                yy_cp = yyg->yy_last_accepting_cpos;
                yy_current_state = yyg->yy_last_accepting_state;
 
@@ -1292,35 +1289,27 @@ case 45:
 YY_RULE_SETUP
 #line 170 "ael.flex"
 {
+               char c = yytext[yyleng-1];
                yylloc->first_line = my_lineno;
                yylloc->first_column=my_col;
-               parencount++;
-               pbcpush('(');
+               if (c == '(')
+                       parencount++;
+               pbcpush(c);
                yymore();
        }
        YY_BREAK
 case 46:
 /* rule 46 can match eol */
 YY_RULE_SETUP
-#line 178 "ael.flex"
+#line 180 "ael.flex"
 {
+               char c = yytext[yyleng-1];
                yylloc->first_line = my_lineno;
                yylloc->first_column=my_col;
-               pbcpush('[');
-               yymore();
-       }
-       YY_BREAK
-case 47:
-/* rule 47 can match eol */
-YY_RULE_SETUP
-#line 185 "ael.flex"
-{
-               yylloc->first_line = my_lineno;
-               yylloc->first_column=my_col;
-               if ( pbcpop(']') ) { /* error */
+               if ( pbcpop(c))  { /* error */
                        pbcwhere(yytext, &my_lineno, &my_col);
-                       ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ']' in expression!\n",
-                               my_file, my_lineno, my_col);
+                       ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
+                               my_file, my_lineno, my_col, c);
                        BEGIN(0);
                        yylloc->last_line = my_lineno;
                        yylloc->last_column = my_col;
@@ -1330,41 +1319,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 48:
-/* rule 48 can match eol */
-YY_RULE_SETUP
-#line 201 "ael.flex"
-{
-               yylloc->first_line = my_lineno;
-               yylloc->first_column=my_col;
-               pbcpush('{');
-               yymore();
-       }
-       YY_BREAK
-case 49:
-/* rule 49 can match eol */
-YY_RULE_SETUP
-#line 208 "ael.flex"
-{
-               yylloc->first_line = my_lineno;
-               yylloc->first_column=my_col;
-               if ( pbcpop('}') ) { /* error */
-                       pbcwhere(yytext, &my_lineno, &my_col);
-                       ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '}' in expression!\n",
-                               my_file, my_lineno, my_col);
-                       BEGIN(0);
-                       yylloc->last_line = my_lineno;
-                       yylloc->last_column = my_col;
-                       yylval->str = strdup(yytext);
-                       return word;
-               }
-               yymore();
-       }
-       YY_BREAK
-case 50:
-/* rule 50 can match eol */
+case 47:
+/* rule 47 can match eol */
 YY_RULE_SETUP
-#line 227 "ael.flex"
+#line 197 "ael.flex"
 {
                /* printf("ARGG:%s\n",yytext); */
                /* printf("GOT AN LP!!!\n"); */
@@ -1375,10 +1333,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 51:
-/* rule 51 can match eol */
+case 48:
+/* rule 48 can match eol */
 YY_RULE_SETUP
-#line 237 "ael.flex"
+#line 207 "ael.flex"
 {
                /*printf("ARGG:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1387,10 +1345,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 52:
-/* rule 52 can match eol */
+case 49:
+/* rule 49 can match eol */
 YY_RULE_SETUP
-#line 245 "ael.flex"
+#line 215 "ael.flex"
 {
                /*printf("ARGG:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1399,10 +1357,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 53:
-/* rule 53 can match eol */
+case 50:
+/* rule 50 can match eol */
 YY_RULE_SETUP
-#line 253 "ael.flex"
+#line 223 "ael.flex"
 {
                /* printf("ARGG:%s\n",yytext); */
                yylloc->first_line = my_lineno;
@@ -1441,10 +1399,10 @@ YY_RULE_SETUP
                }
        }
        YY_BREAK
-case 54:
-/* rule 54 can match eol */
+case 51:
+/* rule 51 can match eol */
 YY_RULE_SETUP
-#line 291 "ael.flex"
+#line 261 "ael.flex"
 {
                /* printf("ARGG:%s\n",yytext); */
                if( parencount != 0) {
@@ -1478,10 +1436,10 @@ YY_RULE_SETUP
                }
        }
        YY_BREAK
-case 55:
-/* rule 55 can match eol */
+case 52:
+/* rule 52 can match eol */
 YY_RULE_SETUP
-#line 324 "ael.flex"
+#line 294 "ael.flex"
 {
                /*printf("ARGG:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1498,10 +1456,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 56:
-/* rule 56 can match eol */
+case 53:
+/* rule 53 can match eol */
 YY_RULE_SETUP
-#line 340 "ael.flex"
+#line 310 "ael.flex"
 {
                /*printf("ARGG:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1518,10 +1476,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 57:
-/* rule 57 can match eol */
+case 54:
+/* rule 54 can match eol */
 YY_RULE_SETUP
-#line 359 "ael.flex"
+#line 329 "ael.flex"
 {
                /*printf("SEMIC:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1530,10 +1488,10 @@ YY_RULE_SETUP
                pbcpush('[');
                }
        YY_BREAK
-case 58:
-/* rule 58 can match eol */
+case 55:
+/* rule 55 can match eol */
 YY_RULE_SETUP
-#line 367 "ael.flex"
+#line 337 "ael.flex"
 {
                /*printf("SEMIC:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1542,10 +1500,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 59:
-/* rule 59 can match eol */
+case 56:
+/* rule 56 can match eol */
 YY_RULE_SETUP
-#line 375 "ael.flex"
+#line 345 "ael.flex"
 {
                /*printf("SEMIC:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1554,10 +1512,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 60:
-/* rule 60 can match eol */
+case 57:
+/* rule 57 can match eol */
 YY_RULE_SETUP
-#line 383 "ael.flex"
+#line 353 "ael.flex"
 {
                /*printf("SEMIC:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1574,10 +1532,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 61:
-/* rule 61 can match eol */
+case 58:
+/* rule 58 can match eol */
 YY_RULE_SETUP
-#line 399 "ael.flex"
+#line 369 "ael.flex"
 {
                /*printf("SEMIC:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1594,10 +1552,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 62:
-/* rule 62 can match eol */
+case 59:
+/* rule 59 can match eol */
 YY_RULE_SETUP
-#line 415 "ael.flex"
+#line 385 "ael.flex"
 {
                /*printf("SEMIC:%s\n",yytext);*/
                yylloc->first_line = my_lineno;
@@ -1614,10 +1572,10 @@ YY_RULE_SETUP
                yymore();
        }
        YY_BREAK
-case 63:
-/* rule 63 can match eol */
+case 60:
+/* rule 60 can match eol */
 YY_RULE_SETUP
-#line 431 "ael.flex"
+#line 401 "ael.flex"
 {
                yylloc->first_line = my_lineno;
                yylloc->first_column=my_col;
@@ -1633,10 +1591,10 @@ YY_RULE_SETUP
                return word;
        }
        YY_BREAK
-case 64:
-/* rule 64 can match eol */
+case 61:
+/* rule 61 can match eol */
 YY_RULE_SETUP
-#line 446 "ael.flex"
+#line 416 "ael.flex"
 {
                FILE *in1;
                char fnamebuf[1024],*p1,*p2;
@@ -1703,7 +1661,7 @@ case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(paren):
 case YY_STATE_EOF(semic):
 case YY_STATE_EOF(argg):
-#line 508 "ael.flex"
+#line 478 "ael.flex"
 {
                if ( --include_stack_index < 0 ) {
                        yyterminate();
@@ -1717,12 +1675,12 @@ case YY_STATE_EOF(argg):
                }
        }
        YY_BREAK
-case 65:
+case 62:
 YY_RULE_SETUP
-#line 521 "ael.flex"
+#line 491 "ael.flex"
 ECHO;
        YY_BREAK
-#line 1726 "ael_lex.c"
+#line 1684 "ael_lex.c"
 
        case YY_END_OF_BUFFER:
                {
@@ -2007,7 +1965,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 >= 226 )
+                       if ( yy_current_state >= 220 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -2036,11 +1994,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 >= 226 )
+               if ( yy_current_state >= 220 )
                        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 == 225);
+       yy_is_jam = (yy_current_state == 219);
 
        return yy_is_jam ? 0 : yy_current_state;
 }
@@ -2852,7 +2810,7 @@ void ael_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 521 "ael.flex"
+#line 491 "ael.flex"
 
 
 
@@ -2875,18 +2833,22 @@ static int pbcpop(char x)
 static int c_prevword(void)
 {
        char *c = prev_word;
-       int ret = 0;
-       while ( c && *c ) {
+       if (c == NULL)
+               return 0;
+       while ( *c ) {
                switch (*c) {
-               case '{': pbcpush('{');break;
-               case '}': ret = pbcpop('}');break;
-               case '[':pbcpush('[');break;
-               case ']':ret = pbcpop(']');break;
-               case '(':pbcpush('(');break;
-               case ')':ret = pbcpop(')'); break;
+               case '{':
+               case '[':
+               case '(':
+                       pbcpush(*c);
+                       break;
+               case '}':
+               case ']':
+               case ')':
+                       if (pbcpop(*c))
+                               return 1;
+                       break;
                }
-               if( ret )
-                       return 1;
                c++;
        }
        return 0;