Browse code

core: request_route alised to main route block

- request_route { ... } can be used instead of main route { ... }
- more suggestive in relation with its purpose and easier to spot and
refer to it

Daniel-Constantin Mierla authored on 22/05/2011 12:48:05
Showing 2 changed files
... ...
@@ -200,6 +200,7 @@ SEND_TCP	send_tcp
200 200
 LOG		log
201 201
 ERROR	error
202 202
 ROUTE	route
203
+ROUTE_REQUEST request_route
203 204
 ROUTE_FAILURE failure_route
204 205
 ROUTE_ONREPLY onreply_route
205 206
 ROUTE_BRANCH branch_route
... ...
@@ -585,6 +586,7 @@ SUBST       subst
585 585
 <INITIAL>{AVPFLAGS_DECL}	{ count(); yylval.strval=yytext; return AVPFLAGS_DECL; }
586 586
 <INITIAL>{MSGLEN}	{ count(); yylval.strval=yytext; return MSGLEN; }
587 587
 <INITIAL>{ROUTE}	{ count(); yylval.strval=yytext; return ROUTE; }
588
+<INITIAL>{ROUTE_REQUEST}	{ count(); yylval.strval=yytext; return ROUTE_REQUEST; }
588 589
 <INITIAL>{ROUTE_ONREPLY}	{ count(); yylval.strval=yytext;
589 590
 								return ROUTE_ONREPLY; }
590 591
 <INITIAL>{ROUTE_FAILURE}	{ count(); yylval.strval=yytext;
... ...
@@ -307,6 +307,7 @@ extern char *finame;
307 307
 %token LOG_TOK
308 308
 %token ERROR
309 309
 %token ROUTE
310
+%token ROUTE_REQUEST
310 311
 %token ROUTE_FAILURE
311 312
 %token ROUTE_ONREPLY
312 313
 %token ROUTE_BRANCH
... ...
@@ -1769,8 +1770,13 @@ route_name:		NUMBER	{
1769 1769
 			|	STRING	{ $$=$1; }
1770 1770
 ;
1771 1771
 
1772
+
1773
+route_main:	ROUTE { ; }
1774
+		  | ROUTE_REQUEST { ; }
1775
+;
1776
+
1772 1777
 route_stm:
1773
-	ROUTE LBRACE actions RBRACE {
1778
+	route_main LBRACE actions RBRACE {
1774 1779
 	#ifdef SHM_MEM
1775 1780
 		if (!shm_initialized() && init_shm()<0) {
1776 1781
 			yyerror("Can't initialize shared memory");
... ...
@@ -1798,6 +1804,7 @@ route_stm:
1798 1798
 		push($6, &main_rt.rlist[i_tmp]);
1799 1799
 	}
1800 1800
 	| ROUTE error { yyerror("invalid  route  statement"); }
1801
+	| ROUTE_REQUEST error { yyerror("invalid  request_route  statement"); }
1801 1802
 	;
1802 1803
 failure_route_stm:
1803 1804
 	ROUTE_FAILURE LBRACE actions RBRACE {