--- a/cisco.grammar Thu Nov 26 11:07:18 2009 +0100
+++ b/cisco.grammar Fri Nov 27 23:12:08 2009 +0100
@@ -64,6 +64,8 @@
range: /\d+/"-"/\d+/
{ { from => $item[1], to => $item[3] } }
+ | /\d+/
+ { { from => $item[1], to => $item[1] } }
keyword: /[\w-]+/
{ $item[1] }
@@ -111,6 +113,9 @@
controller_num: /\d+\/\d+/
{ $item[1] }
+chan_grp_content: "channel-group" num "timeslots" range
+ { $arg{ctx}->{"channel-group"}->{$item{num}}->{ts} = $item{range} }
+
s_controller: "0" "controller" type controller_num eol s_controller_l[ctx => ctx('controller', $item{controller_num}) ](s) "0" "!" eol
{ $::res->{controller}->{$item{controller_num}}->{type} = $item{type} }
@@ -118,23 +123,26 @@
| l_section
s_controller_content: l_description[ctx => $arg{ctx}]
- | "channel-group" num "timeslots" range
- { $arg{ctx}->{"channel-group"}->{$item{num}}->{ts} = $item{range} }
+ | chan_grp_content[ctx => $arg{ctx}]
| "channel-group" num "unframed"
{ $arg{ctx}->{"channel-group"}->{$item{num}}->{unframed} = 1 }
| "framing" keyword
{ $arg{ctx}->{framing} = $item{keyword} }
| "au-4" num "tug-3" num eol s_tug_l[ctx => ctx_rel($arg{ctx}, 'au', $item[2], 'tug', $item[4]) ](s)
+ | s_e3_l[ctx => $arg{ctx}]
+# SONET controller specific
s_tug_l: "2" "tug-2" num "e1" num tug_content[ctx => ctx_rel($arg{ctx}, $item[3].'/'.$item[5]) ] eol
tug_content: l_description[ctx => $arg{ctx}]
| "unframed"
{ $arg{ctx}->{unframed} = 1 }
- | "channel-group" num "timeslots" range
- { $arg{ctx}->{"channel-group"}->{$item{num}}->{ts} = $item{range} }
+ | chan_grp_content[ctx => $arg{ctx}]
| word(s)
+# E3 controller specific
+s_e3_l: "e1" num chan_grp_content[ctx => ctx_rel($arg{ctx}, 'e1', $item{num})]
+
# Vlan range
vlan_s_range: /\d+/"-"/\d+/
{
@@ -180,6 +188,8 @@
{ $arg{ctx}->{"frame-relay"} = {type => $item[2], value => $item[3]} }
| "bandwidth" num
{ $arg{ctx}->{bandwidth} = $item{num} }
+ | "speed" num
+ { $arg{ctx}->{speed} = $item{num} }
| "ip" "vrf" "forwarding" word
{ $arg{ctx}->{"ip-vrf-fwd"} = $item{word} }
| "switchport" "mode" /access|trunk/