Skipping input for which no grammar is writtedn

14 views
Skip to first unread message

Dhandapani Ponnurangam

unread,
Jul 5, 2013, 1:21:30 AM7/5/13
to antlr-di...@googlegroups.com
I have written grammar to parse the 'interface' blocks (bounded by !\n) in the following snippet.
--------------------------------------------------
!
interface FastEthernet 1/0
no ip address
shutdown
!
ip route 0.0.0.0
!
interface Vlan 100
ip address 192.168.20.1
no shutdown
!
---------------------------------------------------
I have not written grammar for the 'ip route 0.0.0.0', but it is (and similar blocks are) prone to appear in the input. How do I go about skipping the 'unwanted' and proceed with only the 'intended' blocks? Am new to ANTLR, but have learnt to write grammar for similar stuff in the past couple of weeks. I have started with ANTLRv3.5 and v4 is going to be new.

Reply all
Reply to author
Forward
0 new messages