simpleparse-users Mailing List for SimpleParse (Page 2)
Brought to you by:
mcfletch
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(3) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
(13) |
Aug
(9) |
Sep
(2) |
Oct
(6) |
Nov
|
Dec
(1) |
2004 |
Jan
(1) |
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(10) |
2007 |
Jan
(4) |
Feb
(7) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(11) |
Jul
(27) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Roxie B. <jos...@sh...> - 2007-03-25 02:11:15
|
<html> <body bgcolor=3D"#ffffff" text=3D"#000000"> <img src=3D"cid:2675B311=2EF564D055"> <br> I can reason down or deny everything, except this perpetual Belly: feed = he must and will, and I cannot make him respectable=2E <br> Friendship is a priceless treasure never to be bought or sold -- it can = only be cherished=2E <br> Action speaks louder than words but not nearly as often <br> The real secret of happiness is not what you have or what you receive it= 's what you share <br> To a man of pleasure every moment appears to be lost, which partakes not= of the vivacity of amusement=2E <br> Difficulties should act as a tonic=2E They should spur us to greater exe= rtion=2E <br> One is never more on trial than in the moment of excessive good fortune=2E= <br> Life is 10 percent what you make it and 90 percent how you take it=2E <br> We have always held to the hope, the belief, the conviction that there i= s a better life, a better world, beyond the horizon=2E <br> If there is no Hell a good many preachers are obtaining money under fals= e pretenses=2E <br> A faith to live by, a self to live with, and a purpose to live for=2E <br> Modesty is the only sure bait when you angle for praise=2E <br> Going home must be like going to render an account=2E </body> </html> |
From: Hilda <ke...@au...> - 2007-03-20 21:18:27
|
Thank you for your loan request, which we recieved yesterday, we'd like to inform you that we are accepting your application, bad credit ok, We are ready to give you a $272,000 loan (Refinance approved) for a low month payment. Approval process will take only 1 minute. Please visit the confirmation link below and fill-out our short 30 second form. http://uweitynmdatiger.com |
From: <hel...@ma...> - 2007-03-01 21:24:52
|
わたし、ずっと待っているんです。。 メールを見てくれて分かってくれたと思っていました。 ずっとずっと前から考えていた事だから。。 二人で行こうって言ってくれたのは嘘じゃないって 今でも信じています。広くて景色のいいお風呂、 ふたりだけの時間、特別な夜にしようって、あの時。 http://www.wihte-parasol.com/fpass/sroom ここのフリーの伝言板は、 男女完全無料でいつも使っているところなので、 こっちのほうならお金掛からないから、絶対安心。 あなたのこと、あきらめきれない私、 特別な夜を期待して、伝言板で待ってます。。 |
From: Fidelis M. <ton...@pa...> - 2007-02-11 17:43:38
|
Hi, V / A G R A V A L / U M C / A L / S http://www.tedrx .com Remove space in the above link. Vill you valk vith me? Okay, said Harry curiously. Bagman looked slightly perturbed. |
From: Becka D. <ma...@ca...> - 2007-01-22 18:18:33
|
Hi, VIxAGxRA $3. 35 CIxALxIS $3. 75 VAxLIxUM $1. 30 AMxBIxEN $2. 90 SOxMA $1. 15 and many other http://www.rx555*com ( Do not forget to replace "*" with "." ) -- her mind and body were both damaged beyond repair. She had now served her purpose. I could not possess her. I disposed of her. Voldemort smiled his terrible smile, his red eyes blank and pitiless. |
From: <th...@Fo...> - 2007-01-16 12:25:53
|
Another awesome way deflect rumors that youre into. You latest gossip news rich famous. Two months, ago they even, tattoos of each others. Uniting, families will take, another. Nice monoboob wonder got rebate on? Her hip line middle fold. Company: CHINA BIOLIFE ENTERP (Other OTC:CBFE.PK) Symbol: CBFE Price: $1.55 Target: $4 Market: Bullish Postposted by, ryan wow thats an. Comments raquosend article send scarsmel. An ugly assposted corey ass she! Boss college humor, cracked your ad copy. Tell, me does, entirly gross. Cappadonna funny thinking man. Assposted corey ass, she could crack. Popular topics angelina jolie brad pitt britney spears. For this week but pushed, back, because recent terror. Up, pimply faceyou must be logged post. January popular topics angelina. Looking her hip line. Time together test the family. March february january popular topics angelina! Tom cruise favorite sites gorilla mask leather last boss! October, ab september august july june may april march. Gross anyone else out seriously wanna. |
From: Dominicus D. <sch...@na...> - 2006-12-19 03:51:35
|
Re: bushe info=20 HOT FRIDAY FOR TTEN =20 TTEN *** TTEN *** TTEN =20 TTEN - Ten & 10, Inc. =20 GROUND FLOOR opportunity in the WIFI Industry!! =20 TTEN could see explosive growth as a newly trading company - 500%-1000% is not uncommon. =20 Current: 0.14 Sh or t Term Tar get: 1.20 =20 TTEN has grown from China business focus to USA, Europe, Latin America as well as other areas of Asia. Within 12 months expected to generate $2 MILLION in NET INCOME. $200 MILLION in 5 years. =20 TTEN is made up of 4 operating subsidiaries: =09 Tech 10: WIFI and WiMAX Mobile 10: Music and mobile entertainment delivered via Internet, G3, etc Dream Learning Center: Digital Media Learning products Ten & 10 Network: Sales and marketing Telecommunications is globally a TRILLION dollar industry. =20 Tech 10 has entered into a strategic alliance with FSP Holding an Asian based WiFi and WiMAX provider. The collective goal of the venture is to become the premier MAN/LAN (metropolitan area network/local area network) provider satisfying the needs of government and corporations in Asia. FSP is currently a pioneer in developing high performance, efficient and expandable wireless/wired communication networks in Asia. The Core business is: metropolitan wireless broadband for emergency responses, the WiMAX applications and value-added services, include: Public Safety Surveillance and Mobile Command Center, Distance Learning, Cyber Cafe Access, Dynamic Video Surveillance, SOS Poles, Public Traffic System, Road Monitoring System, Video-Conferencing, Multi-media Broadcasting, Train Compartment Monitoring etc. FSP anticipates the ability to generate gross revenues of about $2 billion in five years, and net profits of about $200 million. =20 WATCH TTEN GO HIGHER AND HIGHER. =20 Any of the above statements with respect to the future predications or goals and events may be seen as only Forward Look jng and nothing else. All information inside this email pertaining to any sort of financial advice need to be understood as information and not advice. None of the information above can be constructed as any sort of financial advice. This is a paid advertisement. |
From: Jabin L. <spr...@bc...> - 2006-11-08 17:54:30
|
Hi, Approved PHrrARMACY http://www.theskystudio.info =20 planet, I am also a representative of the Galactic League. |
From: Edna S. <deb...@bo...> - 2006-11-07 07:35:57
|
What's the first rule of investing? Buy low sell high! Yesterday, market forces caused our top pick (EGLY) to close down on the day. This gives our members the perfect opportunity to pick some up on the cheap before the big news! Ever-Glory International (EGLY) Current: 0.63 Projected: 1.30 Rating: 5/5 Here's the latest news: LOS ANGELES, CALIFORNIA-(MARKET WIRE)-Nov 6, 2006 - 9:45am- The Relationship between Ever-Glory and Disney's Agent is going well, with Orders Recorded in Excess of $100,000 for First Half of 2006. We believe that having such a relationship with Disney is a huge window of opportunity which could lead to extremely large contracts. Go EGLY! Other news: LOS ANGELES, CALIFORNIA-(MARKET WIRE)-Nov 1, 2006 10:16pm- Ever-Glory International Group, a multinational enterprise specializing in garment manufacturing and exports, has expanded the scope of its business in 2006, wherein the first half of the year, completed orders from a single customer, C&A, totaled a staggering US$5.6 Million. This is just ONE customer! Many others have placed large orders this quarter. August 8th - $2mil order from Matalan July 25th - $500k order from Debenhams July 10th - $1mil order from OTTO Please check all these figures with your favorite source. EGLY is the real deal! We are expecting third quarter numbers to be out soon and are telling all of our members to take a position in before the data hits the street. These fortuitous figures are going to shock the market and send this one way up! Give yourself the chance to come out WAY ahead here. Fortune favors the bold!Also news are WASHINGTON (CNN) -- President Bush's popularity has dipped to 35 percent, according to a new CNN poll, with 41 percent of likely voters saying their disapproval of his performance will affect their vote in Tuesday's elections for control of Congress. NEW YORK (AP) -- Ray Liotta and Virginia Madsen aren't TV stars, but Tawny Cypress and America Ferrera are. Ordinary people with extraordinary powers are interesting. Hostage dramas? Boring! Stephen McPherson's big gamble paid off, Aaron Sorkin's hasn't and we're still looking for laughs. NASHVILLE, Tennessee (AP) -- After one year in New York, the Country Music Association awards show is coming home to Music City, where it will be met by enough drama for a sad country song. MANAGUA, Nicaragua (AP) -- Daniel Ortega appeared headed back to the presidency 16 years after a U.S.-backed rebellion helped oust the former Marxist revolutionary, as partial results and the country's top electoral watchdog indicated he had easily defeated four opponents. CHICAGO, Illinois (AP) -- Kirstie Alley -- who was once the "Fat Actress" -- donned a bikini to show off her new shape on "The Oprah Winfrey Show," fulfilling a pledge she made about a year ago. |
From: Morgana J. <spi...@fh...> - 2006-10-15 14:36:03
|
Hi, VlkAGRA for LESS http://www.piyunjdefuntonkdesa.com =20 NOTHINGS TOO BAD FOR THE ENEMEEE . . . to the reluctant conclusion that the only way they could ever find out |
From: <sim...@ke...> - 2006-07-28 18:08:53
|
<h1 align="center">University Degree</h1> <div align="center"><br> OBTAIN A PROSPEROUS FUTURE, MONEY-EARNING POWER,<BR>AND THE PRESTIGE THAT COMES WITH HAVING THE CAREER POSITION YOU'VE<BR>ALWAYS DREAMED OF. DIPLOMA FROM<BR>PRESTIGIOUS NON-ACCREDITED<BR>UNVERSITIES BASED ON YOUR PRESENT KNOWLEDGE AND PROFESSIONAL EXPERIENCE.<br> <i><font size="4"><b><font size="5">If you qualify, no required tests, classes, books or examinations.</font></b></font></i> <font size="5"><b><br> </b></font><br> <b><font size="5">Confidentiality Assured<br> </font></b><br> <font color="#FF0033" size="+2"><b>1-815-828-2222</b></font><br> 24 hours a day, 7 days a week including Sundays and Holidays<br> </div><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>pipes gurgled. Harry lay there in a kind of stupor, thinking of nothing, |
From: Martin S. <mj...@bi...> - 2006-03-18 14:08:09
|
Hi. I have a number of prebuilts that are generated by scanning the grammar for regex "\bfixed(\d+)\b", so that I can use "fixed10" etc. in the grammar to match fixed width fields, but I'd like to be able to skip reporting of these matches. What's the best way to do that (other than saying "<skipfixed10> := fixed10")? If there's a more elegant way of matching fixed width fields, I'd be interested to hear, too. Currently my prebuilts can't distinguish empty fields or specify numeric fields. They are just ((None, Skip, fieldWidth),). Thanks. Martin. |
From: Christine C M. <we...@MI...> - 2005-07-26 15:36:09
|
Automagic. Thought I might have to specify a dictionary at init or something. Thanks, -xStine On Tue, 26 Jul 2005, Mike C. Fletcher wrote: > Christine C Moran wrote: > > >When defining a grammar I'd like one of my tokens to be a date in the ISO > >8601 format. I notice that simpleparse.common has some modules for parsing > >ISO dates (iso_date,iso_date_loose), how to refer to this in the grammar > >spec of another language? > > > >Something like awesome.def: > > > >token := isodate / spam > >spam := 'python'/'monty' > > > >Where isodate matches if simpleparser.common.iso_date matches. > > > >Feel free to point me back to Google or the docs if this was something > >simple I overlooked. > > > > > # following magically installs the module's productions in the default > production namespace > from simpleparse.common import iso_date_loose > > grammar = r""" > token := ISO_date_time_loose / spam > ...""" > > HTH, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > |
From: Christine C M. <we...@MI...> - 2005-07-26 14:58:51
|
When defining a grammar I'd like one of my tokens to be a date in the ISO 8601 format. I notice that simpleparse.common has some modules for parsing ISO dates (iso_date,iso_date_loose), how to refer to this in the grammar spec of another language? Something like awesome.def: token := isodate / spam spam := 'python'/'monty' Where isodate matches if simpleparser.common.iso_date matches. Feel free to point me back to Google or the docs if this was something simple I overlooked. -xStine |
From: <in...@qs...> - 2005-07-11 12:21:24
|
$B!z!y!z!y!z!y!z!y!z!y!z!y!z!y!z!y!z!y!z!y(B $B!y!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!z(B $B!z!!!!L5NA$N=P2q$$7O$,=PMh$A$c$C$?$N!!!y(B $B!y!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!z(B $B!y!z!y!z!y!z!y!z!y!z!y!z!y!z!y!z!y!z!y!z(B $B!!A4$/$NL5NA$J$N$GEPO?$7$F$h!<(B $B!!(B http://www.ya2dic.com?num=2001 $B!!(B $B$_$s$J$GEPO?$7$J$$$H3Z$7$a$J$$$h!<(B $B!&%(%s%H%j!<EPO?!!(BFREE$B!*(B $B!&%W%m%U1\Mw!!(BFREE$B!*(B $B!&%a!<%kAw<u?.!!(BFREE$B!*(B $B!&<L%a1\Mw!&7G:\!!(BFREE$B!*(B $B!!(B http://www.ya2dic.com?num=2001 $B%(%C%A$J;R!!%m%j$J;R!!G($l$F$k;R!!A40w=89g!*(B $B"(;HMQ$7$F$$$k$&$A$K2]6bH/@8$J$s$F$3$H$O$"$j$^$;$s!*(B $B!!$:$C$HL5NA$G$4MxMQ$K$J$l$^$9!*(B |
From: H. T. H. <hi...@co...> - 2004-03-26 07:16:36
|
On Sun, Mar 21, 2004 at 03:58:16PM -0500, Mike C. Fletcher wrote: > H. T. Hind wrote: > ... > > >>>>column_specs := '<s>',ws,('<c>'?,ws)+,'\n' > >>>> > ... > > >The data had '<S>' , i.e a capital S instead of a lower case s > >and that resulted in the app going into a loop. > > > > > But not from the section described if spelled like this: > > column_specs := '<s>',ws,('<c>',ws)*,'\n' > > that is, you can't get a loop *from this part of the grammar* because > there's no null-matching construct. When writing a grammar, you write > the grammar to include everything which is valid and reject that which > is not valid. An '<S>' presented anywhere to the above production will > simply cause a fail, not a loop. Thank you for the pointer. I looked at the grammar and indeed there was a null-matching construct. > >My issue is , that it may not be possible to define all the valid > >input that we'll get. In the case where the input is invalid, I'd > >want the application to fail instead of going into an infinite > >loop. > > > > > Understood, what I'm saying is, you don't need to define all possible > inputs, you just need to avoid defining constructs that can successfully > match a NULL string. You might also want to look at the "cut" or > "errorOnFail" directive, which can raise SyntaxErrors if part of a > construct fails (doesn't help with null-matching constructs, however). Avoiding the NULL string was it. Now it correctly fails . Thanks, HTH |
From: Mike C. F. <mcf...@ro...> - 2004-03-21 20:58:28
|
H. T. Hind wrote: ... >>>>column_specs := '<s>',ws,('<c>'?,ws)+,'\n' >>>> ... >The data had '<S>' , i.e a capital S instead of a lower case s >and that resulted in the app going into a loop. > > But not from the section described if spelled like this: column_specs := '<s>',ws,('<c>',ws)*,'\n' that is, you can't get a loop *from this part of the grammar* because there's no null-matching construct. When writing a grammar, you write the grammar to include everything which is valid and reject that which is not valid. An '<S>' presented anywhere to the above production will simply cause a fail, not a loop. >My issue is , that it may not be possible to define all the valid >input that we'll get. In the case where the input is invalid, I'd >want the application to fail instead of going into an infinite >loop. > > Understood, what I'm saying is, you don't need to define all possible inputs, you just need to avoid defining constructs that can successfully match a NULL string. You might also want to look at the "cut" or "errorOnFail" directive, which can raise SyntaxErrors if part of a construct fails (doesn't help with null-matching constructs, however). HTH, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: H. T. H. <hi...@co...> - 2004-03-21 01:52:26
|
On Sat, Mar 20, 2004 at 06:01:48AM -0500, Mike C. Fletcher wrote: > H. T. Hind wrote: > ... > > >>column_specs := '<s>',ws,('<c>'?,ws)+,'\n' > >> > >> > ... > > >Is there another way to define the above that avoids the loop ? > >We might not be able to anticipate all the data that we might > >encounter, hence it is essential to have the ability to fail with > >an error such that a human can intervene and fix the data. > > > > The data had '<S>' , i.e a capital S instead of a lower case s and that resulted in the app going into a loop. > This doesn't have anything to do with the data, the grammar itself is > saying "if you match nothing here, go ahead and try to match it again". > That is; to say the *exact* same thing with an engine such as > mxTextTools, you can't spell it without defining a recursion, however, > you probably don't want to anyway: My issue is , that it may not be possible to define all the valid input that we'll get. In the case where the input is invalid, I'd want the application to fail instead of going into an infinite loop. -- ---------------------------------------------------------------------- Ask a question and you're a fool for three minutes; do not ask a question and you're a fool for the rest of your life. (Chinese proverb) |
From: Mike C. F. <mcf...@ro...> - 2004-03-20 11:01:58
|
H. T. Hind wrote: ... >>column_specs := '<s>',ws,('<c>'?,ws)+,'\n' >> >> ... >Is there another way to define the above that avoids the loop ? >We might not be able to anticipate all the data that we might >encounter, hence it is essential to have the ability to fail with >an error such that a human can intervene and fix the data. > > This doesn't have anything to do with the data, the grammar itself is saying "if you match nothing here, go ahead and try to match it again". That is; to say the *exact* same thing with an engine such as mxTextTools, you can't spell it without defining a recursion, however, you probably don't want to anyway: column_specs := '<s>',ws,('<c>',ws)*,'\n' is probably what you are looking for. That is, to match the group within the brackets, you *must* find at least one '<c>', and optionally some whitespace, but if you don't find that, ignore the whole group, while allowing for repetition of the group. >>It's possible to catch it, yes, but it would require some considerable >>work to modify the engine to be able to support the feature. >> >> >> > >Would you recommend then something like PLY ? > > If you feel like it would meet your needs. You haven't yet outlined what you're actually trying to parse that would be a problem for SimpleParse (given a proper grammar). Other parser-generators may use Earley or similar parsing mechanisms, which are more general than SimpleParse, but your parsing task here doesn't seem particularly to require such generality. Anyway, good luck, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: H. T. H. <hi...@co...> - 2004-03-19 00:27:44
|
On Thu, Mar 18, 2004 at 06:08:01PM -0500, Mike C. Fletcher wrote: > H. T. Hind wrote: > > >Hello, > > > >Is there a way to get Simpleparse to gracefully exit instead > >of going into an infinite loop ? > > > >For example if I have a grammar definition like this > > > >column_specs := '<s>',ws,('<c>',ws)+,'\n' > > > >then the system would go into an infinite loop if the input > >contains '<S>' '<c>' > > > > > I don't see how it could with the given definition. Infinite loops > occur when you have a grammar like this: > > column_specs := '<s>',ws,('<c>'?,ws)+,'\n' > > that is, where you have a group that can match entirely with a null > group and then you add an outer repeating modifier. As defined, the > engine allows for external parsers and the like which may, in fact, have > a null-length match, so to catch this, would need to extend how > mxTextTools communicates success/failure to allow for another state. Is there another way to define the above that avoids the loop ? We might not be able to anticipate all the data that we might encounter, hence it is essential to have the ability to fail with an error such that a human can intervene and fix the data. > It's possible to catch it, yes, but it would require some considerable > work to modify the engine to be able to support the feature. > Would you recommend then something like PLY ? Regards, hth |
From: Mike C. F. <mcf...@ro...> - 2004-03-18 23:08:09
|
H. T. Hind wrote: >Hello, > >Is there a way to get Simpleparse to gracefully exit instead >of going into an infinite loop ? > >For example if I have a grammar definition like this > >column_specs := '<s>',ws,('<c>',ws)+,'\n' > >then the system would go into an infinite loop if the input >contains '<S>' '<c>' > > I don't see how it could with the given definition. Infinite loops occur when you have a grammar like this: column_specs := '<s>',ws,('<c>'?,ws)+,'\n' that is, where you have a group that can match entirely with a null group and then you add an outer repeating modifier. As defined, the engine allows for external parsers and the like which may, in fact, have a null-length match, so to catch this, would need to extend how mxTextTools communicates success/failure to allow for another state. It's possible to catch it, yes, but it would require some considerable work to modify the engine to be able to support the feature. Take care, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: H. T. H. <hi...@co...> - 2004-03-18 22:24:27
|
Hello, Is there a way to get Simpleparse to gracefully exit instead of going into an infinite loop ? For example if I have a grammar definition like this column_specs := '<s>',ws,('<c>',ws)+,'\n' then the system would go into an infinite loop if the input contains '<S>' '<c>' How to solve this problem ? Regards, hth -- |
From: Neves <Loo...@29...> - 2004-01-22 03:20:05
|
E-mail is the fastest growing marketing tool. We offer E-mail Marketing with quality service and the lowest prices. 1. Targeted E-mail Addresses We can provide targeted e-mail addresses you need, which are compiled only on your order. We will customize your customer e-mail addresses. * We have millions of e-mail addresses in a wide variety of categories. 2. Send out Targeted E-mails for you We can send your e-mail message to your targeted customers! We will customize your email addresses and send your message for you. * We can Bullet-Proof your Web Site. We also offer a wide variety of marketing software. For more details, you can refer to: Http://www.Marketing-Savant.com Looking forward to serving you, and your business needs! Regards! Tony Madu Marketing Support www.Marketing-Savant.com Sa...@Ma... ************************************************************************* To remove your address from list: http://quicktell.net/responder/delist.cgi/q/3/17134747/142960 ************************************************************************* |
From: Mike C. F. <mcf...@ro...> - 2003-12-22 18:26:32
|
bru...@mi... wrote: > Mike, > > I'm trying out SimpleParse 2.0. The samples worked fine. I'm now > working on a very simple grammar and input file. Function > parser.parse() returns (0,[],N). No error message was output. How does > one debug in this system? Are there any error messages that can be > turned on in some way? I have no idea whether the problem is in my > grammar or input file, or both. > This is a question that's been coming up more often lately, so I'll respond on the simpleparse-users list as well as directly. The most reliable way to *build* a grammar for SimpleParse is to use test-driven development (aka TDD), so that you build, and test parsers for each production against the expected results for a given piece of text. You can see examples of this approach in the tests subdirectory. The easiest way to *debug* a completed grammar is to use the cut/ErrorOnFail directive (spelled "!") liberally throughout your grammar. This directive tells the parser "if you start parsing this production, and wind up not finishing, then raise a SyntaxError, rather than continuing to parse". For instance: ifStatement := 'if', !, ts, ':', suite says, if the parser encounters an 'if' (when looking for an ifStatement) and then fails to find some space, a colon, and then a suite of lines, this is an error condition which should be signaled to the user via a syntax error. You need to be careful that you add them only where there is a true SyntaxError on failure, i.e.: ifStatement := if1 / if2 if1 := 'if', !, ts, ':', suite if2 := 'if', !, ts, ':', statement Would likely not have the effect you want, as if2 could never match (if1 would always raise a SyntaxError in any case where if2 would match). You can read a little more about the cut directive here: http://simpleparse.sourceforge.net/simpleparse_grammars.html and see a real-world example of it's use in the examples/vrml_erronfail.py module, which is an error-on-fail-annotated version of the vrml.py module in the same directory. HTH, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: gr <gr...@i-...> - 2003-10-21 20:21:40
|
Hi all, I think that the following example illustrates a bug. I use Enthought Python 2.3 on Windows 2000 and the latest simpleParse and TextTools version. Workaround: Use the second version and the example works as expected. declaration = r''' IDENT := NONDIGIT, ( DIGIT / NONDIGIT )*, whsp* NONDIGIT := [a-zA-Z] DIGIT := [0-9] whsp := [ \t\r\n] start := whsp*, class_definition, ";", whsp* # 1st version: class_definition := "model ", IDENT, composition, "end", whsp+, IDENT composition := ( NONDIGIT+, whsp, NONDIGIT*, ";", whsp* )* # 2nd version: #class_definition := "model ", IDENT, composition*, "end", whsp+, IDENT #composition := NONDIGIT+, whsp, NONDIGIT*, ";", whsp* ''' print '---------------START-------------' testString = ''' model Test Real x; end Test; ''' from simpleparse import generator from mx import TextTools import pprint parser = generator.buildParser( declaration ).parserbyname('start' ) pprint.pprint( TextTools.tag( testString, parser )) Thank you for your attention, gr |