cisco.grammar
changeset 13 30f4c4346810
parent 12 0b509f26f4d3
child 14 dbd1564b0444
equal deleted inserted replaced
12:0b509f26f4d3 13:30f4c4346810
    25 		line(s) eofile
    25 		line(s) eofile
    26 
    26 
    27 line: 		s_controller
    27 line: 		s_controller
    28 		| s_interface
    28 		| s_interface
    29 		| s_vrf
    29 		| s_vrf
       
    30 		| s_vlan
    30 		| indent comment
    31 		| indent comment
    31 		| indent cmdline 
    32 		| indent cmdline 
    32 		| indent emptyline
    33 		| indent emptyline
    33 		| <error>
    34 		| <error>
    34 
    35 
   124 		| /\d+/
   125 		| /\d+/
   125 		{ $arg{ctx}->{$arg{key}}->{$item[1]} = 1 }
   126 		{ $arg{ctx}->{$arg{key}}->{$item[1]} = 1 }
   126 vlan_range: 	vlan_s_range","vlan_range
   127 vlan_range: 	vlan_s_range","vlan_range
   127 		| vlan_s_range
   128 		| vlan_s_range
   128 
   129 
       
   130 # vlan section
       
   131 s_vlan:		"0" "vlan" num eol "1" "name" identifier eol
       
   132 		{ $::res->{vlans}->{$item{num}}->{name} = $item{identifier} }
       
   133 
   129 # interface section
   134 # interface section
   130 iface_name:	/\w+(-\w+)?\d+[0-9\/\.:]*/
   135 iface_name:	/\w+(-\w+)?\d+[0-9\/\.:]*/
   131 		{ $item[1] }
   136 		{ $item[1] }
   132 
   137 
   133 s_interface:	"0" "interface" iface_name /\S*/ eol s_interface_l[ctx => ctx("interface", $item{iface_name}) ](s) "0" "!" eol
   138 s_interface:	"0" "interface" iface_name /\S*/ eol s_interface_l[ctx => ctx("interface", $item{iface_name}) ](s) "0" "!" eol
   187 		| "route-target" /export|import/ rd_val
   192 		| "route-target" /export|import/ rd_val
   188 		{
   193 		{
   189 		$arg{ctx}->{"route-target"}->{$item[2]} = []
   194 		$arg{ctx}->{"route-target"}->{$item[2]} = []
   190 			unless exists $arg{ctx}->{"route-target"}->{$item[2]};
   195 			unless exists $arg{ctx}->{"route-target"}->{$item[2]};
   191 		push @{$arg{ctx}->{"route-target"}->{$item[2]}}, $item{rd_val};
   196 		push @{$arg{ctx}->{"route-target"}->{$item[2]}}, $item{rd_val};
   192 		}
   197 		} 
   193 
   198