Re: Pyparsing help
- From: Paul McGuire <ptmcg@xxxxxxxxxxxxx>
- Date: Sat, 22 Mar 2008 18:30:20 -0700 (PDT)
Oof, I see that you have multiple "Layer" entries, with different
qualifying labels. Since the dicts use "Layer" as the key, you only
get the last "Layer" value, with qualifier "PRBOUNDARY", and lose the
"Layer" for "METAL2". To fix this, you'll have to move the optional
alias term to the key, and merge "Layer" and "PRBOUNDARY" into a
single key, perhaps "Layer/PRBOUNDARY" or "Layer(PRBOUNDARY)" - a
parse action should take care of this for you. Unfortnately, these
forms will not allow you to use object attribute form
(md.Layer.lineStyle), you will have to use dict access form
(md["Layer(PRBOUNDARY)"].lineStyle), since these keys have characters
that are not valid attribute name characters.
Or you could add one more level of Dict nesting to your grammar, to
permit access like "md.Layer.PRBOUNDARY.lineStyle".
-- Paul
.
- Follow-Ups:
- Re: Pyparsing help
- From: rh0dium
- Re: Pyparsing help
- References:
- Pyparsing help
- From: rh0dium
- Re: Pyparsing help
- From: Paul McGuire
- Pyparsing help
- Prev by Date: Re: Problem with complex numbers
- Next by Date: Re: Do any of you recommend Python as a first programming language?
- Previous by thread: Re: Pyparsing help
- Next by thread: Re: Pyparsing help
- Index(es):