pyparsing: ensuring all sections are parsed -


i write parser evice configuration files. there lot of sections interfaces, contain number of configuration commands. , because of fact different devices (firmware versions) may have different defaults , don't know possible commands @ point --- how write parser in case?

when write:

# cisco: iface = header \     + iftype + ifname \     + descr \     + switchport_options \     + skipto(comment).suppress() \     + comment.suppress()  ifaces = group(oneormore(iface)) 

--- in case miss interfaces ip address before descr token. ok, know this, can use optional every possible command, there can other configuration commands unaware of far.

and list of interfaces without not parsed language definition.

i guess can in 2 passes. first, ifaces having defined them "everything interface comment" , trying parse them 1 one. , possible exceptions me fine-tune definitions.

is right way?

how can this?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -