Successfully reported this slideshow.
Your SlideShare is downloading. ×

Optimizing Parser Combinators

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
1
PetitParser Compiler
Jan Kurš & Jan Vraný
Mohammad Ghafari, Mircea Lungu and
Oscar Nierstrasz
2
3
Parsing
Contexts
Bounded
Seas
Furthest
Failure
Layout-
senstivity

YouTube videos are no longer supported on SlideShare

View original on YouTube

Loading in …3
×

Check these out next

1 of 25 Ad
Advertisement

More Related Content

More from ESUG (20)

Recently uploaded (20)

Advertisement

Optimizing Parser Combinators

  1. 1. 1 PetitParser Compiler Jan Kurš & Jan Vraný Mohammad Ghafari, Mircea Lungu and Oscar Nierstrasz
  2. 2. 2
  3. 3. 3 Parsing Contexts Bounded Seas Furthest Failure Layout- senstivity
  4. 4. 4
  5. 5. 5
  6. 6. 6 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  7. 7. 7 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  8. 8. 8 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  9. 9. 9 id ← #letter #word* expr ← term / ‘(‘ expr ‘)’ / …
  10. 10. 10 id ← #letter #word* expr ← term / ‘(‘ expr ‘)’ / …
  11. 11. 11 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  12. 12. 12 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  13. 13. 13 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  14. 14. 14 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  15. 15. 15 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  16. 16. 16
  17. 17. 17 id ← #letter #word* block ← #INDENT expr / block / … #DEDENT expr ← term / ‘(‘ expr ‘)’ / …
  18. 18. 18 PetitParser Compiler
  19. 19. 19 10k methods of Pharo code 3 parsers Compared to Compiled PetitParser Speedup
  20. 20. 20 PetitParser SmaCC RBParser 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
  21. 21. 21 Expressions Python Smalltalk Java Ruby 0 2 4 6 8 10 12 14
  22. 22. 22 PetitParser SmaCC RBParser 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 Compiler
  23. 23. 23 map: Plus program Token classToken Token idToken Sequence body Action class Sequence identifier Sequence ClassNode new   id: idToken value   body: body  CharClass #letter Choice letterOrDigit CharClass #digit Star … Indent indent Star Dedent dedent Choice Action method …
  24. 24. 24 0 0.2 0.4 0.6 0.8 1 1.2 Time[microseconds] Time per Character of Smalltalk Compiled Parser GC time

×