Convert right-recursive rules to left-recursive ones. trunk
authorriastradh <riastradh@NetBSD.org>
Sat, 15 Mar 2014 15:22:37 +0000
branchtrunk
changeset 225578 3b3c86a40f8f
parent 225577 2cb3adce3ea6
child 225579 3fe05fbcf4db
Convert right-recursive rules to left-recursive ones. This should obviate the need for the workaround of a large stack in order to handle many rules. No change in the resulting plists. ok rmind
usr.sbin/npf/npfctl/npf_parse.y
--- a/usr.sbin/npf/npfctl/npf_parse.y	Sat Mar 15 15:15:26 2014 +0000
+++ b/usr.sbin/npf/npfctl/npf_parse.y	Sat Mar 15 15:22:37 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_parse.y,v 1.34 2014/03/14 11:29:45 rmind Exp $	*/
+/*	$NetBSD: npf_parse.y,v 1.35 2014/03/15 15:22:37 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@@ -189,7 +189,7 @@
 	;
 
 lines
-	: line SEPLINE lines
+	: lines SEPLINE line
 	| line
 	;
 
@@ -235,7 +235,7 @@
 	;
 
 list_elems
-	: element COMMA list_elems
+	: list_elems COMMA element
 	{
 		npfvar_add_elements($1, $3);
 	}
@@ -346,7 +346,7 @@
 	;
 
 procs
-	: proc_call SEPLINE procs
+	: procs SEPLINE proc_call
 	{
 		$$ = npfvar_add_elements($1, $3);
 	}
@@ -367,7 +367,7 @@
 	;
 
 proc_param_list
-	: proc_param COMMA proc_param_list
+	: proc_param_list COMMA proc_param
 	{
 		$$ = npfvar_add_elements($1, $3);
 	}
@@ -447,7 +447,7 @@
 	;
 
 ruleset_def
-	: rule_group SEPLINE ruleset_def
+	: ruleset_def SEPLINE rule_group
 	| rule_group
 	;