diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-24 17:41:27 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-24 17:41:27 +0000 |
commit | 6baa8fbab851e094bc67dbe0dc67817e55a11075 (patch) | |
tree | 5ce36257d23c91be83f8acd95dbb5342a8b2dcfd /ast_expr2f.c | |
parent | e196b45892e129c7e3e877d4749b786c2cd8c2ee (diff) |
Merge Steve Murphy's (murf) complete re-implementation of AEL, which is now no longer considered experimental :-)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22273 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'ast_expr2f.c')
-rw-r--r-- | ast_expr2f.c | 841 |
1 files changed, 535 insertions, 306 deletions
diff --git a/ast_expr2f.c b/ast_expr2f.c index ed8745596..bc0dcb34f 100644 --- a/ast_expr2f.c +++ b/ast_expr2f.c @@ -523,34 +523,34 @@ static yyconst flex_int16_t yy_nxt[][128] = 7, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, 36, -11, 36, 36, 36, -11, 36, - -11, -11, -11, -11, 36, -11, 36, -11, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, -11, 36, - -11, 37, -11, -11, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, -11, 36, -11, 36, 36, -11, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, -11, -11, -11, -11, -11 + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, 36, -11, -11, -11, -11, -11, -11, -11, -11, + + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11 }, { - 7, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 39, 38, 38, 38, 38, 38, - - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38 + 7, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 38, 37, 37, 37, 37, 37, + + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37 }, { @@ -558,51 +558,51 @@ static yyconst flex_int16_t yy_nxt[][128] = -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, 36, -13, 36, 36, 36, -13, 36, - -13, -13, -13, -13, 36, -13, 36, -13, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, -13, 36, - -13, -13, -13, -13, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, -13, 36, -13, 36, 36, -13, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, -13, -13, -13, -13, -13 + -13, -13, -13, -13, -13, 39, 39, -13, -13, 39, + -13, -13, -13, -13, 39, -13, 39, -13, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, -13, 39, + -13, -13, -13, -13, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, -13, 39, -13, 39, 39, -13, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, -13, -13, -13, -13, -13 }, { 7, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, 36, -14, 36, 36, 36, -14, 36, - -14, -14, -14, -14, 36, -14, 36, -14, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, -14, 36, - -14, -14, -14, -14, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, -14, 36, -14, 36, 36, -14, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 40, -14, -14, -14, -14 + -14, -14, -14, -14, -14, 39, 39, -14, -14, 39, + -14, -14, -14, -14, 39, -14, 39, -14, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, -14, 39, + -14, -14, -14, -14, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, -14, 39, -14, 39, 39, -14, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 40, -14, -14, -14, -14 }, { 7, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, 36, -15, 36, 36, 36, -15, 36, - -15, -15, -15, -15, 36, -15, 36, -15, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, -15, 36, - -15, -15, -15, -15, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, -15, 36, -15, 36, 36, -15, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, -15, -15, -15, -15, -15 + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15 }, { @@ -610,7 +610,7 @@ static yyconst flex_int16_t yy_nxt[][128] = -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, 41, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, @@ -731,17 +731,17 @@ static yyconst flex_int16_t yy_nxt[][128] = -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, 36, -23, 36, 36, 36, -23, 36, - -23, -23, -23, -23, 36, -23, 36, -23, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, -23, 36, - -23, -23, -23, -23, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, -23, 36, -23, 36, 36, -23, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, -23, -23, -23, -23, -23 + -23, -23, -23, -23, -23, 39, 39, -23, -23, 39, + -23, -23, -23, -23, 39, -23, 39, -23, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, -23, 39, + -23, -23, -23, -23, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, -23, 39, -23, 39, 39, -23, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, -23, -23, -23, -23, -23 }, { @@ -750,7 +750,7 @@ static yyconst flex_int16_t yy_nxt[][128] = -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, 42, -24, + -24, -24, -24, -24, -24, -24, -24, -24, 43, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, @@ -769,7 +769,7 @@ static yyconst flex_int16_t yy_nxt[][128] = -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, 43, -25, -25, -25, -25, -25, -25, -25, -25, + -25, 44, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, @@ -786,14 +786,14 @@ static yyconst flex_int16_t yy_nxt[][128] = -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, 45, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26 + -26, -26, -26, -26, -26, -26, 46, -26 }, { @@ -803,7 +803,7 @@ static yyconst flex_int16_t yy_nxt[][128] = -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, - -27, 44, -27, -27, -27, -27, -27, -27, -27, -27, + -27, 47, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, @@ -844,25 +844,25 @@ static yyconst flex_int16_t yy_nxt[][128] = -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29 + -29, -29, -29, -29, 48, -29, -29, -29 }, { - 7, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 46, 45, 47, 45, 45 + 7, 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, 50, 49, 51, 49, 49 }, { @@ -900,21 +900,21 @@ static yyconst flex_int16_t yy_nxt[][128] = }, { - 7, 48, 48, 48, 48, 48, 48, 48, 48, -33, - - -33, 48, 48, -33, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, -33, -33, 48, 48, -33, -33, -33, 48, - -33, -33, -33, -33, 48, -33, 48, -33, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, -33, 48, - -33, -33, -33, -33, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, -33, 48, 48, 48 + 7, 52, 52, 52, 52, 52, 52, 52, 52, -33, + + -33, 52, 52, -33, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, -33, -33, 52, 52, -33, -33, -33, 52, + -33, -33, -33, -33, 52, -33, 52, -33, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, -33, 52, + -33, -33, -33, -33, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, -33, 52, 52, 52 }, { @@ -948,7 +948,7 @@ static yyconst flex_int16_t yy_nxt[][128] = -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, 49, -35, -35, -35, -35 + -35, -35, -35, 53, -35, -35, -35, -35 }, { @@ -956,51 +956,51 @@ static yyconst flex_int16_t yy_nxt[][128] = -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, 36, -36, 36, 36, 36, -36, 36, - -36, -36, -36, -36, 36, -36, 36, -36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, -36, 36, - -36, -36, -36, -36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, -36, 36, -36, 36, 36, -36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, -36, -36, -36, -36, -36 + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + + -36, -36, -36, -36, -36, -36, -36, -36 }, { - 7, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37 + 7, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 38, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37 }, { - 7, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 39, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38 + 7, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38 }, { @@ -1008,16 +1008,16 @@ static yyconst flex_int16_t yy_nxt[][128] = -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39 + -39, -39, -39, -39, -39, 39, 39, -39, -39, 39, + -39, -39, -39, -39, 39, -39, 39, -39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, -39, 39, + -39, -39, -39, -39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, -39, 39, -39, 39, 39, -39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, -39, -39, -39, -39, -39 }, @@ -1042,34 +1042,34 @@ static yyconst flex_int16_t yy_nxt[][128] = 7, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, 36, -41, 36, 36, 36, -41, 36, - -41, -41, -41, -41, 36, -41, 36, -41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, -41, 36, - -41, -41, -41, -41, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, -41, 36, -41, 36, 36, -41, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, -41, -41, -41, -41, -41 + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41 }, { 7, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42 + -42, -42, -42, -42, -42, 39, 39, -42, -42, 39, + + -42, -42, -42, -42, 39, -42, 39, -42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, -42, 39, + -42, -42, -42, -42, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, -42, 39, -42, 39, 39, -42, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, -42, -42, -42, -42, -42 }, { @@ -1108,20 +1108,20 @@ static yyconst flex_int16_t yy_nxt[][128] = }, { - 7, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 46, 45, 47, 45, 45 + 7, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45 }, { @@ -1160,38 +1160,107 @@ static yyconst flex_int16_t yy_nxt[][128] = }, { - 7, 48, 48, 48, 48, 48, 48, 48, 48, -48, - -48, 48, 48, -48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, -48, -48, 48, 48, -48, -48, -48, 48, - -48, -48, -48, -48, 48, -48, 48, -48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, -48, 48, - - -48, -48, -48, -48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, -48, 48, 48, 48 + 7, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48 }, { - 7, -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 + 7, 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, 50, 49, 51, 49, 49 + + }, + { + 7, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50 + }, + + { + 7, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51 + }, + + { + 7, 52, 52, 52, 52, 52, 52, 52, 52, -52, + -52, 52, 52, -52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, -52, -52, 52, 52, -52, -52, -52, 52, + + -52, -52, -52, -52, 52, -52, 52, -52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, -52, 52, + -52, -52, -52, -52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, -52, 52, 52, 52 + }, + + { + 7, -53, -53, -53, -53, -53, -53, -53, -53, -53, + + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53 }, } ; @@ -1212,8 +1281,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 30 -#define YY_END_OF_BUFFER 31 +#define YY_NUM_RULES 35 +#define YY_END_OF_BUFFER 36 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -1221,22 +1290,24 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[50] = +static yyconst flex_int16_t yy_accept[54] = { 0, - 0, 0, 0, 0, 27, 27, 31, 30, 20, 22, - 24, 30, 24, 24, 13, 2, 17, 18, 11, 9, - 10, 12, 23, 15, 5, 3, 4, 14, 1, 30, - 26, 25, 27, 28, 28, 24, 8, 0, 21, 19, - 23, 16, 7, 6, 0, 26, 25, 27, 29 + 0, 0, 0, 0, 32, 32, 36, 35, 25, 27, + 19, 35, 29, 29, 17, 2, 22, 23, 15, 13, + 14, 16, 28, 20, 9, 3, 8, 18, 1, 35, + 31, 30, 32, 33, 33, 12, 0, 26, 29, 24, + 5, 28, 21, 11, 6, 7, 10, 4, 0, 31, + 30, 32, 34 } ; -static yyconst yy_state_type yy_NUL_trans[50] = +static yyconst yy_state_type yy_NUL_trans[54] = { 0, 8, 8, 30, 30, 33, 33, 0, 0, 0, 0, - 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, - 0, 0, 48, 0, 0, 0, 0, 38, 0, 0, - 0, 0, 0, 0, 45, 0, 0, 48, 0 + 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, + 0, 0, 52, 0, 0, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, + 0, 52, 0 } ; /* The intent behind this definition is that it'll catch @@ -1248,9 +1319,27 @@ static yyconst yy_state_type yy_NUL_trans[50] = #define YY_RESTORE_YY_MORE_OFFSET #line 1 "ast_expr2.fl" #line 2 "ast_expr2.fl" +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 1999 - 2006, Digium, Inc. + * + * Mark Spencer <markster@digium.com> + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + /*! \file * - * \brief Dialplan Expression Parser + * \brief Dialplan Expression Lexical Scanner */ #include <sys/types.h> @@ -1304,8 +1393,9 @@ struct parse_io void ast_yyset_column(int column_no, yyscan_t yyscanner); int ast_yyget_column(yyscan_t yyscanner); static int curlycount = 0; +static char *expr2_token_subst(char *mess); -#line 1304 "ast_expr2f.c" +#line 1394 "ast_expr2f.c" #define INITIAL 0 #define var 1 @@ -1522,10 +1612,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 64 "ast_expr2.fl" +#line 83 "ast_expr2.fl" -#line 1524 "ast_expr2f.c" +#line 1614 "ast_expr2f.c" yylval = yylval_param; @@ -1608,167 +1698,192 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 66 "ast_expr2.fl" +#line 85 "ast_expr2.fl" { SET_COLUMNS; SET_STRING; return TOK_OR;} YY_BREAK case 2: YY_RULE_SETUP -#line 67 "ast_expr2.fl" +#line 86 "ast_expr2.fl" { SET_COLUMNS; SET_STRING; return TOK_AND;} YY_BREAK case 3: YY_RULE_SETUP -#line 68 "ast_expr2.fl" +#line 87 "ast_expr2.fl" { SET_COLUMNS; SET_STRING; return TOK_EQ;} YY_BREAK case 4: YY_RULE_SETUP -#line 69 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_GT;} +#line 88 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_OR;} YY_BREAK case 5: YY_RULE_SETUP -#line 70 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_LT;} +#line 89 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_AND;} YY_BREAK case 6: YY_RULE_SETUP -#line 71 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_GE;} +#line 90 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_EQ;} YY_BREAK case 7: YY_RULE_SETUP -#line 72 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_LE;} +#line 91 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_EQTILDE;} YY_BREAK case 8: YY_RULE_SETUP -#line 73 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_NE;} +#line 92 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_GT;} YY_BREAK case 9: YY_RULE_SETUP -#line 74 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_PLUS;} +#line 93 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_LT;} YY_BREAK case 10: YY_RULE_SETUP -#line 75 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_MINUS;} +#line 94 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_GE;} YY_BREAK case 11: YY_RULE_SETUP -#line 76 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_MULT;} +#line 95 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_LE;} YY_BREAK case 12: YY_RULE_SETUP -#line 77 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_DIV;} +#line 96 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_NE;} YY_BREAK case 13: YY_RULE_SETUP -#line 78 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_MOD;} +#line 97 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_PLUS;} YY_BREAK case 14: YY_RULE_SETUP -#line 79 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_COND;} +#line 98 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_MINUS;} YY_BREAK case 15: YY_RULE_SETUP -#line 80 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_COLON;} +#line 99 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_MULT;} YY_BREAK case 16: YY_RULE_SETUP -#line 81 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;} +#line 100 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_DIV;} YY_BREAK case 17: YY_RULE_SETUP -#line 82 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_LP;} +#line 101 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_MOD;} YY_BREAK case 18: YY_RULE_SETUP -#line 83 "ast_expr2.fl" -{ SET_COLUMNS; SET_STRING; return TOK_RP;} +#line 102 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_COND;} YY_BREAK case 19: YY_RULE_SETUP -#line 84 "ast_expr2.fl" +#line 103 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_COMPL;} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 104 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_COLON;} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 105 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 106 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_LP;} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 107 "ast_expr2.fl" +{ SET_COLUMNS; SET_STRING; return TOK_RP;} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 108 "ast_expr2.fl" {/* gather the contents of ${} expressions, with trailing stuff, into a single TOKEN. They are much more complex now than they used to be */ curlycount = 0; BEGIN(var); yymore();} YY_BREAK -case 20: +case 25: YY_RULE_SETUP -#line 87 "ast_expr2.fl" +#line 111 "ast_expr2.fl" {} YY_BREAK -case 21: -/* rule 21 can match eol */ +case 26: +/* rule 26 can match eol */ YY_RULE_SETUP -#line 88 "ast_expr2.fl" +#line 112 "ast_expr2.fl" {SET_COLUMNS; SET_STRING; return TOKEN;} YY_BREAK -case 22: -/* rule 22 can match eol */ +case 27: +/* rule 27 can match eol */ YY_RULE_SETUP -#line 90 "ast_expr2.fl" +#line 114 "ast_expr2.fl" {/* what to do with eol */} YY_BREAK -case 23: +case 28: YY_RULE_SETUP -#line 91 "ast_expr2.fl" +#line 115 "ast_expr2.fl" { SET_COLUMNS; /* the original behavior of the expression parser was to bring in numbers as a numeric string */ SET_NUMERIC_STRING; return TOKEN;} YY_BREAK -case 24: +case 29: YY_RULE_SETUP -#line 94 "ast_expr2.fl" +#line 119 "ast_expr2.fl" {SET_COLUMNS; SET_STRING; return TOKEN;} YY_BREAK -case 25: -/* rule 25 can match eol */ +case 30: +/* rule 30 can match eol */ YY_RULE_SETUP -#line 96 "ast_expr2.fl" +#line 121 "ast_expr2.fl" {curlycount--; if(curlycount < 0){ BEGIN(trail); yymore();} else { yymore();}} YY_BREAK -case 26: -/* rule 26 can match eol */ +case 31: +/* rule 31 can match eol */ YY_RULE_SETUP -#line 97 "ast_expr2.fl" +#line 122 "ast_expr2.fl" {curlycount++; yymore(); } YY_BREAK -case 27: +case 32: YY_RULE_SETUP -#line 98 "ast_expr2.fl" +#line 123 "ast_expr2.fl" {BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN;} YY_BREAK -case 28: -/* rule 28 can match eol */ +case 33: +/* rule 33 can match eol */ YY_RULE_SETUP -#line 99 "ast_expr2.fl" +#line 124 "ast_expr2.fl" {char c = yytext[yyleng-1]; BEGIN(0); unput(c); SET_COLUMNS; SET_STRING; return TOKEN;} YY_BREAK -case 29: +case 34: YY_RULE_SETUP -#line 100 "ast_expr2.fl" +#line 125 "ast_expr2.fl" {curlycount = 0; BEGIN(var); yymore(); } YY_BREAK case YY_STATE_EOF(trail): -#line 101 "ast_expr2.fl" -{BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN; /* actually, if an expr is only a variable ref, this could happen a LOT */} +#line 126 "ast_expr2.fl" +{BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN; /*actually, if an expr is only a variable ref, this could happen a LOT */} YY_BREAK -case 30: +case 35: YY_RULE_SETUP -#line 103 "ast_expr2.fl" +#line 128 "ast_expr2.fl" ECHO; YY_BREAK -#line 1767 "ast_expr2f.c" +#line 1882 "ast_expr2f.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(var): yyterminate(); @@ -2901,7 +3016,7 @@ void ast_yyfree (void * ptr , yyscan_t yyscanner) #undef YY_DECL_IS_OURS #undef YY_DECL #endif -#line 103 "ast_expr2.fl" +#line 128 "ast_expr2.fl" @@ -2955,16 +3070,129 @@ int ast_expr(char *expr, char *buf, int length) return return_value; } + +char extra_error_message[4095]; +int extra_error_message_supplied = 0; +void ast_expr_register_extra_error_info(char *message); +void ast_expr_clear_extra_error_info(void); + +void ast_expr_register_extra_error_info(char *message) +{ + extra_error_message_supplied=1; + strcpy(extra_error_message, message); +} + +void ast_expr_clear_extra_error_info(void) +{ + extra_error_message_supplied=0; + extra_error_message[0] = 0; +} + +static char *expr2_token_equivs1[] = +{ + "TOKEN", + "TOK_COND", + "TOK_COLONCOLON", + "TOK_OR", + "TOK_AND", + "TOK_EQ", + "TOK_GT", + "TOK_LT", + "TOK_GE", + "TOK_LE", + "TOK_NE", + "TOK_PLUS", + "TOK_MINUS", + "TOK_MULT", + "TOK_DIV", + "TOK_MOD", + "TOK_COMPL", + "TOK_COLON", + "TOK_EQTILDE", + "TOK_RP", + "TOK_LP" +}; + +static char *expr2_token_equivs2[] = +{ + "<token>", + "?", + "::", + "|", + "&", + "=", + ">", + "<", + ">=", + "<=", + "!=", + "+", + "-", + "*", + "/", + "%", + "!", + ":", + "=~", + ")", + "(" +}; + + +static char *expr2_token_subst(char *mess) +{ + /* calc a length, malloc, fill, and return; yyerror had better free it! */ + int len=0,i; + char *p; + char *res, *s,*t; + int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*); + + for (p=mess; *p; p++) { + for (i=0; i<expr2_token_equivs_entries; i++) { + if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) + { + len+=strlen(expr2_token_equivs2[i])+2; + p += strlen(expr2_token_equivs1[i])-1; + break; + } + } + len++; + } + res = (char*)malloc(len+1); + res[0] = 0; + s = res; + for (p=mess; *p;) { + int found = 0; + for (i=0; i<expr2_token_equivs_entries; i++) { + if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) { + *s++ = '\''; + for (t=expr2_token_equivs2[i]; *t;) { + *s++ = *t++; + } + *s++ = '\''; + p += strlen(expr2_token_equivs1[i]); + found = 1; + break; + } + } + if( !found ) + *s++ = *p++; + } + *s++ = 0; + return res; +} + int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio ) { struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner); char spacebuf[8000]; /* best safe than sorry */ char spacebuf2[8000]; /* best safe than sorry */ int i=0; + char *s2 = expr2_token_subst((char *)s); spacebuf[0] = 0; for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' '; /* uh... assuming yyg is defined, then I can use the yycolumn macro, - which is the same thing as... get this: + which is the same thing as... get this: yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column I was tempted to just use yy_buf_pos in the STATE, but..., well: a. the yy_buf_pos is the current position in the buffer, which @@ -2979,15 +3207,16 @@ int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio ) #ifdef STANDALONE3 /* easier to read in the standalone version */ - printf("ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n", - s, parseio->string,spacebuf2); + printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", + (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); #else - ast_log(LOG_WARNING,"ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n", - s, parseio->string,spacebuf2); + ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", + (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); #endif #ifndef STANDALONE ast_log(LOG_WARNING,"If you have questions, please refer to doc/channelvariables.txt in the asterisk source.\n"); #endif + free(s2); return(0); } |