[asterisk-commits] trunk r23807 - in /trunk/pbx/ael: ael.flex ael_lex.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Apr 30 17:31:47 MST 2006


Author: rizzo
Date: Sun Apr 30 19:31:47 2006
New Revision: 23807

URL: http://svn.digium.com/view/asterisk?rev=23807&view=rev
Log:
more simplifications


Modified:
    trunk/pbx/ael/ael.flex
    trunk/pbx/ael/ael_lex.c

Modified: trunk/pbx/ael/ael.flex
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael.flex?rev=23807&r1=23806&r2=23807&view=diff
==============================================================================
--- trunk/pbx/ael/ael.flex (original)
+++ trunk/pbx/ael/ael.flex Sun Apr 30 19:31:47 2006
@@ -74,7 +74,6 @@
 static int pbcpop(char x);
 
 static int parencount = 0;
-static int commaout = 0;
 
 /*
  * current line, column and filename, updated as we read the input.
@@ -320,23 +319,12 @@
 			yymore();
 		} else  {
 			STORE_LOC;
-			if( !commaout ) {
-				if( !strcmp(yytext,"," ) ) {
-					commaout = 0;
-					my_col+=1;
-					return COMMA;
-				}
-				yylval->str = strdup(yytext);
-				/* printf("Got argg2 word %s\n", yylval->str); */
-				unput(',');
-				commaout = 1;
-				yylval->str[yyleng-1] = '\0';
-				return word;
-			} else {
-				commaout = 0;
-				my_col+=1;
+			if( !strcmp(yytext,"," ) )
 				return COMMA;
-			}
+			yylval->str = strdup(yytext);
+			yylval->str[yyleng-1] = '\0';
+			unput(',');
+			return word;
 		}
 	}
 
@@ -540,7 +528,6 @@
 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 	parencount = 0;
 	pbcpos = 0;
-	commaout = 0;
 	pbcpush('(');	/* push '(' so the last pcbpop (parencount= -1) will succeed */
 	c_prevword();
 	BEGIN(argg);

Modified: trunk/pbx/ael/ael_lex.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael_lex.c?rev=23807&r1=23806&r2=23807&view=diff
==============================================================================
--- trunk/pbx/ael/ael_lex.c (original)
+++ trunk/pbx/ael/ael_lex.c Sun Apr 30 19:31:47 2006
@@ -690,7 +690,6 @@
 static int pbcpop(char x);
 
 static int parencount = 0;
-static int commaout = 0;
 
 /*
  * current line, column and filename, updated as we read the input.
@@ -776,7 +775,7 @@
 #define	STORE_POS
 #define	STORE_LOC
 #endif
-#line 780 "ael_lex.c"
+#line 779 "ael_lex.c"
 
 #define INITIAL 0
 #define paren 1
@@ -1016,10 +1015,10 @@
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 172 "ael.flex"
-
-
-#line 1023 "ael_lex.c"
+#line 171 "ael.flex"
+
+
+#line 1022 "ael_lex.c"
 
     yylval = yylval_param;
 
@@ -1110,218 +1109,218 @@
 
 case 1:
 YY_RULE_SETUP
+#line 173 "ael.flex"
+{ STORE_POS; return LC;}
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
 #line 174 "ael.flex"
-{ STORE_POS; return LC;}
-	YY_BREAK
-case 2:
+{ STORE_POS; return RC;}
+	YY_BREAK
+case 3:
 YY_RULE_SETUP
 #line 175 "ael.flex"
-{ STORE_POS; return RC;}
-	YY_BREAK
-case 3:
+{ STORE_POS; return LP;}
+	YY_BREAK
+case 4:
 YY_RULE_SETUP
 #line 176 "ael.flex"
-{ STORE_POS; return LP;}
-	YY_BREAK
-case 4:
+{ STORE_POS; return RP;}
+	YY_BREAK
+case 5:
 YY_RULE_SETUP
 #line 177 "ael.flex"
-{ STORE_POS; return RP;}
-	YY_BREAK
-case 5:
+{ STORE_POS; return SEMI;}
+	YY_BREAK
+case 6:
 YY_RULE_SETUP
 #line 178 "ael.flex"
-{ STORE_POS; return SEMI;}
-	YY_BREAK
-case 6:
+{ STORE_POS; return EQ;}
+	YY_BREAK
+case 7:
 YY_RULE_SETUP
 #line 179 "ael.flex"
-{ STORE_POS; return EQ;}
-	YY_BREAK
-case 7:
+{ STORE_POS; return COMMA;}
+	YY_BREAK
+case 8:
 YY_RULE_SETUP
 #line 180 "ael.flex"
-{ STORE_POS; return COMMA;}
-	YY_BREAK
-case 8:
+{ STORE_POS; return COLON;}
+	YY_BREAK
+case 9:
 YY_RULE_SETUP
 #line 181 "ael.flex"
-{ STORE_POS; return COLON;}
-	YY_BREAK
-case 9:
+{ STORE_POS; return AMPER;}
+	YY_BREAK
+case 10:
 YY_RULE_SETUP
 #line 182 "ael.flex"
-{ STORE_POS; return AMPER;}
-	YY_BREAK
-case 10:
+{ STORE_POS; return BAR;}
+	YY_BREAK
+case 11:
 YY_RULE_SETUP
 #line 183 "ael.flex"
-{ STORE_POS; return BAR;}
-	YY_BREAK
-case 11:
+{ STORE_POS; return EXTENMARK;}
+	YY_BREAK
+case 12:
 YY_RULE_SETUP
 #line 184 "ael.flex"
-{ STORE_POS; return EXTENMARK;}
-	YY_BREAK
-case 12:
+{ STORE_POS; return AT;}
+	YY_BREAK
+case 13:
 YY_RULE_SETUP
 #line 185 "ael.flex"
-{ STORE_POS; return AT;}
-	YY_BREAK
-case 13:
+{/*comment*/}
+	YY_BREAK
+case 14:
 YY_RULE_SETUP
 #line 186 "ael.flex"
-{/*comment*/}
-	YY_BREAK
-case 14:
+{ STORE_POS; return KW_CONTEXT;}
+	YY_BREAK
+case 15:
 YY_RULE_SETUP
 #line 187 "ael.flex"
-{ STORE_POS; return KW_CONTEXT;}
-	YY_BREAK
-case 15:
+{ STORE_POS; return KW_ABSTRACT;}
+	YY_BREAK
+case 16:
 YY_RULE_SETUP
 #line 188 "ael.flex"
-{ STORE_POS; return KW_ABSTRACT;}
-	YY_BREAK
-case 16:
+{ STORE_POS; return KW_MACRO;};
+	YY_BREAK
+case 17:
 YY_RULE_SETUP
 #line 189 "ael.flex"
-{ STORE_POS; return KW_MACRO;};
-	YY_BREAK
-case 17:
+{ STORE_POS; return KW_GLOBALS;}
+	YY_BREAK
+case 18:
 YY_RULE_SETUP
 #line 190 "ael.flex"
-{ STORE_POS; return KW_GLOBALS;}
-	YY_BREAK
-case 18:
+{ STORE_POS; return KW_IGNOREPAT;}
+	YY_BREAK
+case 19:
 YY_RULE_SETUP
 #line 191 "ael.flex"
-{ STORE_POS; return KW_IGNOREPAT;}
-	YY_BREAK
-case 19:
+{ STORE_POS; return KW_SWITCH;}
+	YY_BREAK
+case 20:
 YY_RULE_SETUP
 #line 192 "ael.flex"
-{ STORE_POS; return KW_SWITCH;}
-	YY_BREAK
-case 20:
+{ STORE_POS; return KW_IF;}
+	YY_BREAK
+case 21:
 YY_RULE_SETUP
 #line 193 "ael.flex"
-{ STORE_POS; return KW_IF;}
-	YY_BREAK
-case 21:
+{ STORE_POS; return KW_IFTIME;}
+	YY_BREAK
+case 22:
 YY_RULE_SETUP
 #line 194 "ael.flex"
-{ STORE_POS; return KW_IFTIME;}
-	YY_BREAK
-case 22:
+{ STORE_POS; return KW_RANDOM;}
+	YY_BREAK
+case 23:
 YY_RULE_SETUP
 #line 195 "ael.flex"
-{ STORE_POS; return KW_RANDOM;}
-	YY_BREAK
-case 23:
+{ STORE_POS; return KW_REGEXTEN;}
+	YY_BREAK
+case 24:
 YY_RULE_SETUP
 #line 196 "ael.flex"
-{ STORE_POS; return KW_REGEXTEN;}
-	YY_BREAK
-case 24:
+{ STORE_POS; return KW_HINT;}
+	YY_BREAK
+case 25:
 YY_RULE_SETUP
 #line 197 "ael.flex"
-{ STORE_POS; return KW_HINT;}
-	YY_BREAK
-case 25:
+{ STORE_POS; return KW_ELSE;}
+	YY_BREAK
+case 26:
 YY_RULE_SETUP
 #line 198 "ael.flex"
-{ STORE_POS; return KW_ELSE;}
-	YY_BREAK
-case 26:
+{ STORE_POS; return KW_GOTO;}
+	YY_BREAK
+case 27:
 YY_RULE_SETUP
 #line 199 "ael.flex"
-{ STORE_POS; return KW_GOTO;}
-	YY_BREAK
-case 27:
+{ STORE_POS; return KW_JUMP;}
+	YY_BREAK
+case 28:
 YY_RULE_SETUP
 #line 200 "ael.flex"
-{ STORE_POS; return KW_JUMP;}
-	YY_BREAK
-case 28:
+{ STORE_POS; return KW_RETURN;}
+	YY_BREAK
+case 29:
 YY_RULE_SETUP
 #line 201 "ael.flex"
-{ STORE_POS; return KW_RETURN;}
-	YY_BREAK
-case 29:
+{ STORE_POS; return KW_BREAK;}
+	YY_BREAK
+case 30:
 YY_RULE_SETUP
 #line 202 "ael.flex"
-{ STORE_POS; return KW_BREAK;}
-	YY_BREAK
-case 30:
+{ STORE_POS; return KW_CONTINUE;}
+	YY_BREAK
+case 31:
 YY_RULE_SETUP
 #line 203 "ael.flex"
-{ STORE_POS; return KW_CONTINUE;}
-	YY_BREAK
-case 31:
+{ STORE_POS; return KW_FOR;}
+	YY_BREAK
+case 32:
 YY_RULE_SETUP
 #line 204 "ael.flex"
-{ STORE_POS; return KW_FOR;}
-	YY_BREAK
-case 32:
+{ STORE_POS; return KW_WHILE;}
+	YY_BREAK
+case 33:
 YY_RULE_SETUP
 #line 205 "ael.flex"
-{ STORE_POS; return KW_WHILE;}
-	YY_BREAK
-case 33:
+{ STORE_POS; return KW_CASE;}
+	YY_BREAK
+case 34:
 YY_RULE_SETUP
 #line 206 "ael.flex"
-{ STORE_POS; return KW_CASE;}
-	YY_BREAK
-case 34:
+{ STORE_POS; return KW_DEFAULT;}
+	YY_BREAK
+case 35:
 YY_RULE_SETUP
 #line 207 "ael.flex"
-{ STORE_POS; return KW_DEFAULT;}
-	YY_BREAK
-case 35:
+{ STORE_POS; return KW_PATTERN;}
+	YY_BREAK
+case 36:
 YY_RULE_SETUP
 #line 208 "ael.flex"
-{ STORE_POS; return KW_PATTERN;}
-	YY_BREAK
-case 36:
+{ STORE_POS; return KW_CATCH;}
+	YY_BREAK
+case 37:
 YY_RULE_SETUP
 #line 209 "ael.flex"
-{ STORE_POS; return KW_CATCH;}
-	YY_BREAK
-case 37:
+{ STORE_POS; return KW_SWITCHES;}
+	YY_BREAK
+case 38:
 YY_RULE_SETUP
 #line 210 "ael.flex"
-{ STORE_POS; return KW_SWITCHES;}
-	YY_BREAK
-case 38:
+{ STORE_POS; return KW_ESWITCHES;}
+	YY_BREAK
+case 39:
 YY_RULE_SETUP
 #line 211 "ael.flex"
-{ STORE_POS; return KW_ESWITCHES;}
-	YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 212 "ael.flex"
 { STORE_POS; return KW_INCLUDES;}
 	YY_BREAK
 case 40:
 /* rule 40 can match eol */
 YY_RULE_SETUP
+#line 213 "ael.flex"
+{ my_lineno++; my_col = 1; }
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
 #line 214 "ael.flex"
-{ my_lineno++; my_col = 1; }
-	YY_BREAK
-case 41:
+{ my_col += yyleng; }
+	YY_BREAK
+case 42:
 YY_RULE_SETUP
 #line 215 "ael.flex"
-{ my_col += yyleng; }
-	YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 216 "ael.flex"
 { my_col += (yyleng*8)-(my_col%8); }
 	YY_BREAK
 case 43:
 YY_RULE_SETUP
-#line 218 "ael.flex"
+#line 217 "ael.flex"
 {
 		STORE_POS;
 		yylval->str = strdup(yytext);
@@ -1339,7 +1338,7 @@
 case 44:
 /* rule 44 can match eol */
 YY_RULE_SETUP
-#line 234 "ael.flex"
+#line 233 "ael.flex"
 {
 		if ( pbcpop(')') ) {	/* error */
 			STORE_LOC;
@@ -1365,7 +1364,7 @@
 case 45:
 /* rule 45 can match eol */
 YY_RULE_SETUP
-#line 256 "ael.flex"
+#line 255 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if (c == '(')
@@ -1377,7 +1376,7 @@
 case 46:
 /* rule 46 can match eol */
 YY_RULE_SETUP
-#line 264 "ael.flex"
+#line 263 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if ( pbcpop(c))  { /* error */
@@ -1402,7 +1401,7 @@
 case 47:
 /* rule 47 can match eol */
 YY_RULE_SETUP
-#line 286 "ael.flex"
+#line 285 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if (c == '(')
@@ -1414,7 +1413,7 @@
 case 48:
 /* rule 48 can match eol */
 YY_RULE_SETUP
-#line 294 "ael.flex"
+#line 293 "ael.flex"
 {
 		if ( pbcpop(')') ) { /* error */
 			STORE_LOC;
@@ -1442,36 +1441,25 @@
 case 49:
 /* rule 49 can match eol */
 YY_RULE_SETUP
-#line 318 "ael.flex"
+#line 317 "ael.flex"
 {
 		if( parencount != 0) { /* printf("Folding in a comma!\n"); */
 			yymore();
 		} else  {
 			STORE_LOC;
-			if( !commaout ) {
-				if( !strcmp(yytext,"," ) ) {
-					commaout = 0;
-					my_col+=1;
-					return COMMA;
-				}
-				yylval->str = strdup(yytext);
-				/* printf("Got argg2 word %s\n", yylval->str); */
-				unput(',');
-				commaout = 1;
-				yylval->str[yyleng-1] = '\0';
-				return word;
-			} else {
-				commaout = 0;
-				my_col+=1;
+			if( !strcmp(yytext,"," ) )
 				return COMMA;
-			}
+			yylval->str = strdup(yytext);
+			yylval->str[yyleng-1] = '\0';
+			unput(',');
+			return word;
 		}
 	}
 	YY_BREAK
 case 50:
 /* rule 50 can match eol */
 YY_RULE_SETUP
-#line 343 "ael.flex"
+#line 331 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if ( pbcpop(c) ) { /* error */
@@ -1492,7 +1480,7 @@
 case 51:
 /* rule 51 can match eol */
 YY_RULE_SETUP
-#line 360 "ael.flex"
+#line 348 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		yymore();
@@ -1502,7 +1490,7 @@
 case 52:
 /* rule 52 can match eol */
 YY_RULE_SETUP
-#line 366 "ael.flex"
+#line 354 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if ( pbcpop(c) ) { /* error */
@@ -1518,7 +1506,7 @@
 case 53:
 /* rule 53 can match eol */
 YY_RULE_SETUP
-#line 378 "ael.flex"
+#line 366 "ael.flex"
 {
 		STORE_LOC;
 		yylval->str = strdup(yytext);
@@ -1531,7 +1519,7 @@
 case 54:
 /* rule 54 can match eol */
 YY_RULE_SETUP
-#line 387 "ael.flex"
+#line 375 "ael.flex"
 {
 		FILE *in1;
 		char fnamebuf[1024],*p1,*p2;
@@ -1598,7 +1586,7 @@
 case YY_STATE_EOF(paren):
 case YY_STATE_EOF(semic):
 case YY_STATE_EOF(argg):
-#line 449 "ael.flex"
+#line 437 "ael.flex"
 {
 		if ( --include_stack_index < 0 ) {
 			yyterminate();
@@ -1614,10 +1602,10 @@
 	YY_BREAK
 case 55:
 YY_RULE_SETUP
-#line 462 "ael.flex"
+#line 450 "ael.flex"
 ECHO;
 	YY_BREAK
-#line 1621 "ael_lex.c"
+#line 1609 "ael_lex.c"
 
 	case YY_END_OF_BUFFER:
 		{
@@ -2747,7 +2735,7 @@
 
 #define YYTABLES_NAME "yytables"
 
-#line 462 "ael.flex"
+#line 450 "ael.flex"
 
 
 
@@ -2830,7 +2818,6 @@
 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 	parencount = 0;
 	pbcpos = 0;
-	commaout = 0;
 	pbcpush('(');	/* push '(' so the last pcbpop (parencount= -1) will succeed */
 	c_prevword();
 	BEGIN(argg);



More information about the asterisk-commits mailing list