Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
Seaside - The Revenge of Smalltalk
Next
Download to read offline and view in fullscreen.

Share

A Parser in my Pocket

Download to read offline

Martin McClure: A Parser in my Pocket. ESUG 2010, Barcelona, Spain

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

A Parser in my Pocket

  1. 1. A Parser in my Pocket Martin McClure ESUG 2010
  2. 2. Once upon a time...
  3. 3. Smalltalk PEG-Based Parsers ● Xstreams PEG parser ● OMeta ● PetitParser ● ...?
  4. 4. The rest of this talk ● Grammars, PEGs ● OMeta2 with Examples ● Parser Combinators and PetitParser
  5. 5. Context-free grammars conditional ::= “if” cond “then” statement | “if” cond “then” statement “else” statement Works for generation, but not sufficient for recognition
  6. 6. PEG Ordered Choice conditional = “if” cond “then” statement “else” statement | “if” cond “then” statement Makes recognition unambiguous
  7. 7. Example 1 File Server Incremental Backup
  8. 8. time ( rsync -aHxi --numeric-ids --delete --link-dest=/mnt/backup/caboodle1/2010-08-03 /caboodle1/ /mnt/backup/caboodle1/2010-09-08 )
  9. 9. For more information on Ometa: http://tinlizzie.org/ometa/ http://tinlizzie.org/~awarth/ometa/ometa2.html http://www.squeaksource.com/OMeta/
  10. 10. http://www.lukas-renggli.ch/blog/petitparser-1 http://source.lukas-renggli.ch/petit.html
  11. 11. BNF ID ::= letter { letter | digit } ;
  12. 12. BNF ID ::= letter { letter | digit } ; Ometa2 id = letter (letter | digit)*
  13. 13. BNF ID ::= letter { letter | digit } ; Ometa2 id = letter (letter | digit)* PetitParser id := #letter asParser , (#letter asParser / #digit asParser) star
  14. 14. id := #letter asParser , (#letter asParser / #digit asParser) star
  15. 15. ¿ questions ? Martin McClure ESUG 2010

Martin McClure: A Parser in my Pocket. ESUG 2010, Barcelona, Spain

Views

Total views

1,156

On Slideshare

0

From embeds

0

Number of embeds

2

Actions

Downloads

9

Shares

0

Comments

0

Likes

0

×