How to make a grammar using python textx exclude tokens
I am trying to parse a network device configuration file, and though I would be going through the whole file, I will not want to include all the terms of the file, but only a subset. So assume that the configuration file is as follows: bootfile abc.bin motd "this is a message for everyone to follow" . . . group 1 group 2 . . . permit tcp ab.b.c.d b.b.b.y eq 222 permit tcp ab.b.c.d b.b.b.y eq 222 permit tcp ab.b.c.d b.b.b.y eq 222 . . . interface a description this is interface a vlan 33 interface b description craigs list no shut vlan 33 no ip address . . . I am only trying to capture the interface line (as is) and the description and vlan line as is - everything else would be ignore. Contents within the interface would be broken into 2 attributes: valid and invalid so the grammar would look something like this: Config[noskipsp]: interfaces *= !InterfaceDefinition | InterfaceDefinition ; InterfaceDefinition: interface = intf valids *= valid invalid...