Click here to Skip to main content
15,885,869 members
Articles / Containers / Virtual Machine

Parsing Expression Grammar Support for C# 3.0 Part 1 - PEG Lib and Parser Generator

Rate me:
Please Sign up or sign in to vote.
4.95/5 (49 votes)
7 Oct 2008CPOL40 min read 202.9K   2.1K   118  
Introduction to the parsing method PEG with library and parser generator
{"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","id":{"$t":"tag:blogger.com,1999:blog-5140583693537295147"},"updated":{"$t":"2008-01-31T18:55:39.753-08:00"},"title":{"type":"text","$t":"buenos noches from a lonely condado"},"link":[{"rel":"alternate","type":"text/html","href":"http://blogname.blogspot.com/"},{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/posts/default"},{"rel":"self","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/posts/default?alt\u003djson-in-script"}],"author":[{"name":{"$t":"El Serracho!"}}],"generator":{"version":"7.00","uri":"http://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"5"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"25"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-5140583693537295147.post-931944870551900026"},"published":{"$t":"2007-11-16T13:11:00.000-08:00"},"updated":{"$t":"2007-11-16T13:12:26.750-08:00"},"title":{"type":"text","$t":"it\u0027s just the way"},"content":{"type":"html","$t":"first. right off the bat i want to warn you that this is a story of me being verbally accosted in a public place. this sort of thing doesn\u0027t actually happen every day but it does happen more frequently than i\u0027d like. and in each and every case the person who berates me is fat. i don\u0027t know why this is. do fat people inherently feel the need to point out my shortcomings? do they just hate me? i don\u0027t know. so the warning is there for you, read no further if you may be offended by my calling someone fat. \u003cbr /\u003e\u003cbr /\u003elike each and every occurrence in my life it starts with - i was minding my own. and i was. i go to considerable pains to avoid shopping at our local jumbo supermarket chains. i\u0027ve always had a preference for trader joe\u0027s or the occasional indie shop but a couple years back workers at the big chains went on strike. i opted to not cross their picket lines and i\u0027ve never been back.\u003cbr /\u003e\u003cbr /\u003ewell, almost never. on an ugly, santa ana wind infested sunday afternoon i was tired and needed a couple items and the jumbo was so easy and on the way home, i bit the bullet and went in. i managed the find the items i was looking for without much trouble and got into line. there were two shoppers ahead of me, both with items on the conveyer belt and shortly after arriving, someone was behind me in line. i walked forward when there was room and began to place my items on the conveyor when the woman behind me said something so i turned around and drank in her enormitude and knew it was going downhill from there. \u003cbr /\u003e\u003cbr /\u003eshe: \u0022you\u0027re doing it wrong\u0022\u003cbr /\u003e\u003cbr /\u003eme: \u0022what?\u0022\u003cbr /\u003e\u003cbr /\u003eshe: \u0022that\u0022\u003cbr /\u003e\u003cbr /\u003ei looked where she pointed, in the general direction of my groin, and looked back in what must have appeared as simian incomprehensive (or maybe that puppy thing with the turned head). \u003cbr /\u003e\u003cbr /\u003eshe: \u0022you can\u0027t do it like that. the cart has to be in front of you\u0022\u003cbr /\u003e\u003cbr /\u003esure enough, i was in fact standing in front of my cart, reaching to my left (as i faced the register) to pick my items up. \u003cbr /\u003e\u003cbr /\u003eshe: \u0022i can\u0027t put my stuff up there with your cart in the way\u0022\u003cbr /\u003e\u003cbr /\u003ehere is where i should have left well enough alone. i know that now, ok? so no need to point it out. instead, i said something like..\u003cbr /\u003e\u003cbr /\u003eme: \u0022irrespective of where i\u0027m standing in relation to the cart we (the cart and i) occupy the same amount of space\u0022 i did NOT add \u0022which is roughly half of the space you occupy on your own\u0022.. see? i DO self-censor.\u003cbr /\u003e\u003cbr /\u003eshe: \u0022no. that\u0027s wrong\u0022\u003cbr /\u003e\u003cbr /\u003enow i have a feeling this last comment was calculated to get me to do what she wanted. and it did. to demonstrate i switched places with the cart and yep, same amount of space. undeterred she reached across me, practically bent over at the waist to show that NOW she could reach the belt. she went on to explain that i \u0022need to learn the rules\u0022 and \u0022do it right.\u0022 i asked her simply \u0022please stop talking to me\u0022 and with one more \u0022gladly!\u0022, she did.\u003cbr /\u003e\u003cbr /\u003ethis is at least the third time i\u0027ve been yelled at by other customers in big chain stores by fat people. so now it\u0027s my stock reply when asked why i don\u0027t visit wal-mart, k-mart, ralphs, or costco. \u0022the fat people there HATE me!\u0022"},"link":[{"rel":"alternate","type":"text/html","href":"http://blogname.blogspot.com/2007/11/its-just-way.html","title":"it\u0027s just the way"},{"rel":"replies","type":"text/html","href":"http://www.blogger.com/comment.g?blogID\u003d5140583693537295147\u0026postID\u003d931944870551900026","title":"0 Comments"},{"rel":"replies","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/931944870551900026/comments/default","title":"Post Comments"},{"rel":"self","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/posts/default/931944870551900026"},{"rel":"edit","type":"application/atom+xml","href":"http://www.blogger.com/feeds/5140583693537295147/posts/default/931944870551900026"}],"author":[{"name":{"$t":"El Serracho!"}}]},{"id":{"$t":"tag:blogger.com,1999:blog-5140583693537295147.post-4669448449755367061"},"published":{"$t":"2007-08-20T10:35:00.001-07:00"},"updated":{"$t":"2007-08-20T10:37:01.321-07:00"},"title":{"type":"text","$t":""},"content":{"type":"html","$t":"\u003cobject width\u003d\u0022425\u0022 height\u003d\u0022350\u0022\u003e\u003cparam name\u003d\u0022movie\u0022 value\u003d\u0022http://www.youtube.com/v/Zp0Bju0H4Q4\u0022\u003e\u003c/param\u003e\u003cparam name\u003d\u0022wmode\u0022 value\u003d\u0022transparent\u0022\u003e\u003c/param\u003e\u003cembed src\u003d\u0022http://www.youtube.com/v/Zp0Bju0H4Q4\u0022 type\u003d\u0022application/x-shockwave-flash\u0022 wmode\u003d\u0022transparent\u0022 width\u003d\u0022425\u0022 height\u003d\u0022350\u0022\u003e\u003c/embed\u003e\u003c/object\u003e"},"link":[{"rel":"alternate","type":"text/html","href":"http://blogname.blogspot.com/2007/08/blog-post.html","title":""},{"rel":"replies","type":"text/html","href":"http://www.blogger.com/comment.g?blogID\u003d5140583693537295147\u0026postID\u003d4669448449755367061","title":"0 Comments"},{"rel":"replies","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/4669448449755367061/comments/default","title":"Post Comments"},{"rel":"self","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/posts/default/4669448449755367061"},{"rel":"edit","type":"application/atom+xml","href":"http://www.blogger.com/feeds/5140583693537295147/posts/default/4669448449755367061"}],"author":[{"name":{"$t":"El Serracho!"}}]},{"id":{"$t":"tag:blogger.com,1999:blog-5140583693537295147.post-8420204408388089253"},"published":{"$t":"2007-08-18T15:51:00.000-07:00"},"updated":{"$t":"2007-08-18T15:59:48.213-07:00"},"title":{"type":"text","$t":""},"content":{"type":"html","$t":"\u003ca onblur\u003d\u0022try {parent.deselectBloggerImageGracefully();} catch(e) {}\u0022 href\u003d\u0022http://bp3.blogger.com/_EFip6BmW3v4/Rsd53C7qSZI/AAAAAAAAAAg/Ian0Nbw0IyY/s1600-h/546301a7415b66787ae0feae4b0ae5ca.jpg\u0022\u003e\u003cimg style\u003d\u0022margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;\u0022 src\u003d\u0022http://bp3.blogger.com/_EFip6BmW3v4/Rsd53C7qSZI/AAAAAAAAAAg/Ian0Nbw0IyY/s320/546301a7415b66787ae0feae4b0ae5ca.jpg\u0022 alt\u003d\u0022\u0022 id\u003d\u0022BLOGGER_PHOTO_ID_5100179089607248274\u0022 border\u003d\u00220\u0022 /\u003e\u003c/a\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003efast is as fast does. little amber neben outta orange county california \u003ca href\u003d\u0022http://www.org-rc.fr/acceuil.php?page\u003d2007/resultat.php\u0022\u003ewrapped u\u003c/a\u003ep the tour de france de femenin (that\u0027s the chick\u0027s tour and here\u0027s the \u003ca href\u003d\u0022http://www.org-rc.fr/course/2007/resultats/7etape/classement%20general%20-%20etape%207.pdf\u0022\u003estandings in pdf\u003c/a\u003e). it\u0027s well deserved and well fought. when she\u0027s not in france crushing the french, she also enjoys emasculating folks back home. seems like only yesterday when i used to think i was fast and as such showed up on saturday mornings up at crystal lake for some climbing action. one day in particular i found myself with lil tim jones and amber off the front, well away from the rest of the group.. climbing ... climbing.. thinking to myself that we were the elite.the badasses. about 3/4 of the way up the 9 mile(ish) climb coach dave pulled up next to us in his suv and looked everyone over. you guys alright? tim and i: \u0022hells yes.\u0022 how bout you amber? feeling ok?\u003cbr /\u003e\u003cbr /\u003eyes.\u003cbr /\u003e\u003cbr /\u003ethen go.\u003cbr /\u003e\u003cbr /\u003eand she went. i think i stood out of the saddle for about 3 revolutions before i realized how utterly futile it was. we were fast. she was a LOT faster. she was kind enough to wait for us at the top to descend together.\u003cbr /\u003e\u003cbr /\u003enow the french know."},"link":[{"rel":"alternate","type":"text/html","href":"http://blogname.blogspot.com/2007/08/fast-is-as-fast-does.html","title":""},{"rel":"replies","type":"text/html","href":"http://www.blogger.com/comment.g?blogID\u003d5140583693537295147\u0026postID\u003d8420204408388089253","title":"3 Comments"},{"rel":"replies","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/8420204408388089253/comments/default","title":"Post Comments"},{"rel":"self","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/posts/default/8420204408388089253"},{"rel":"edit","type":"application/atom+xml","href":"http://www.blogger.com/feeds/5140583693537295147/posts/default/8420204408388089253"}],"author":[{"name":{"$t":"El Serracho!"}}]},{"id":{"$t":"tag:blogger.com,1999:blog-5140583693537295147.post-1338082142485017370"},"published":{"$t":"2007-08-16T14:37:00.001-07:00"},"updated":{"$t":"2007-08-16T14:39:00.161-07:00"},"title":{"type":"text","$t":""},"content":{"type":"html","$t":"\u003ca onblur\u003d\u0022try {parent.deselectBloggerImageGracefully();} catch(e) {}\u0022 href\u003d\u0022http://bp2.blogger.com/_EFip6BmW3v4/RsTD5i7qSYI/AAAAAAAAAAU/dJilzyvtEtA/s1600-h/omfg.jpg\u0022\u003e\u003cimg style\u003d\u0022margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;\u0022 src\u003d\u0022http://bp2.blogger.com/_EFip6BmW3v4/RsTD5i7qSYI/AAAAAAAAAAU/dJilzyvtEtA/s320/omfg.jpg\u0022 alt\u003d\u0022\u0022 id\u003d\u0022BLOGGER_PHOTO_ID_5099416071487244674\u0022 border\u003d\u00220\u0022 /\u003e\u003c/a\u003e\u003cbr /\u003e\u003cbr /\u003eapparently \u003ca href\u003d\u0022http://omfg.com/\u0022\u003efor real\u003c/a\u003e"},"link":[{"rel":"alternate","type":"text/html","href":"http://blogname.blogspot.com/2007/08/apparently-for-real.html","title":""},{"rel":"replies","type":"text/html","href":"http://www.blogger.com/comment.g?blogID\u003d5140583693537295147\u0026postID\u003d1338082142485017370","title":"1 Comments"},{"rel":"replies","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/1338082142485017370/comments/default","title":"Post Comments"},{"rel":"self","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/posts/default/1338082142485017370"},{"rel":"edit","type":"application/atom+xml","href":"http://www.blogger.com/feeds/5140583693537295147/posts/default/1338082142485017370"}],"author":[{"name":{"$t":"El Serracho!"}}]},{"id":{"$t":"tag:blogger.com,1999:blog-5140583693537295147.post-5919047915192058629"},"published":{"$t":"2007-08-16T13:36:00.001-07:00"},"updated":{"$t":"2007-08-16T13:44:39.765-07:00"},"title":{"type":"text","$t":""},"content":{"type":"html","$t":"as GOS and i drove past orange county\u0027s \u003ca href\u003d\u0022http://www.ocregister.com/money/axtell-district-nguyen-1811147-center-open\u0022\u003enewest shopping destination\u003c/a\u003e last night we witnessed the following: a maintenance man of some sort hosing off the (functioning) water fountain. can\u0027t be too clean or to conspicuous in the land of orange."},"link":[{"rel":"alternate","type":"text/html","href":"http://blogname.blogspot.com/2007/08/as-gos-and-i-drove-past-orange-countys.html","title":""},{"rel":"replies","type":"text/html","href":"http://www.blogger.com/comment.g?blogID\u003d5140583693537295147\u0026postID\u003d5919047915192058629","title":"0 Comments"},{"rel":"replies","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/5919047915192058629/comments/default","title":"Post Comments"},{"rel":"self","type":"application/atom+xml","href":"http://blogname.blogspot.com/feeds/posts/default/5919047915192058629"},{"rel":"edit","type":"application/atom+xml","href":"http://www.blogger.com/feeds/5140583693537295147/posts/default/5919047915192058629"}],"author":[{"name":{"$t":"El Serracho!"}}]}]}}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions