Re: Pyparsing help

2008-03-24 Thread Paul McGuire
On Mar 23, 4:04 pm, rh0dium <[EMAIL PROTECTED]> wrote: > > I needed to tweak it a bit to ignore the comments..  Namely this fixed > it up.. > >     mainDict = dictOf( >             Group(Word(alphas)+Optional(quotedString)), >             Suppress("{") + attrDict + Suppress("}") >             ) | c

Re: Pyparsing help

2008-03-24 Thread Francesco Bochicchio
Il Sat, 22 Mar 2008 14:11:16 -0700, rh0dium ha scritto: > Hi all, > > I am struggling with parsing the following data: > > test1 = """ > Technology { > name= "gtc" dielectric >= 2.75e-05 unitTimeName

Re: Pyparsing help

2008-03-23 Thread rh0dium
On Mar 23, 1:48 pm, rh0dium <[EMAIL PROTECTED]> wrote: > On Mar 23, 12:26 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > > > There are a couple of bugs in our program so far. > > > First of all, our grammar isn't parsing the METAL2 entry at all.  We > > should change this line: > > >     md = ma

Re: Pyparsing help

2008-03-23 Thread rh0dium
On Mar 23, 12:26 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > There are a couple of bugs in our program so far. > > First of all, our grammar isn't parsing the METAL2 entry at all.  We > should change this line: > >     md = mainDict.parseString(test1) > > to > >     md = (mainDict+stringEnd).pars

Re: Pyparsing help

2008-03-23 Thread Arnaud Delobelle
On Mar 22, 9:11 pm, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, Hi, > I am struggling with parsing the following data: > > test1 = """ > Technology      { >                 name                            = "gtc" >                 dielectric                      = 2.75e-05 [...] I know it's che

Re: Pyparsing help

2008-03-23 Thread Paul McGuire
There are a couple of bugs in our program so far. First of all, our grammar isn't parsing the METAL2 entry at all. We should change this line: md = mainDict.parseString(test1) to md = (mainDict+stringEnd).parseString(test1) The parser is reading as far as it can, but then stopping onc

Re: Pyparsing help

2008-03-22 Thread rh0dium
On Mar 22, 6:30 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > 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

Re: Pyparsing help

2008-03-22 Thread Paul McGuire
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, an

Re: Pyparsing help

2008-03-22 Thread Paul McGuire
On Mar 22, 4:11 pm, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > I am struggling with parsing the following data: > > As a side note:  Is this the right approach to using pyparsing.  Do we > start from the inside and work our way out or should I have started > with looking at the bigger pictur

Pyparsing help

2008-03-22 Thread rh0dium
Hi all, I am struggling with parsing the following data: test1 = """ Technology { name= "gtc" dielectric = 2.75e-05 unitTimeName= "ns" timePrecision