Pro Yearly is on sale from $80 to $50! »

Parsers in JavaScript

Parsers in JavaScript

This is an introduction to parsers in JavaScript with examples of PEG.js

84cd9fd20832381fc78084aac4cb4b6c?s=128

Leif Gensert

April 22, 2020
Tweet

Transcript

  1. Hello World Parsers with JavaScript

  2. None
  3. Programming === Hiking

  4. Compilers Reverse Engineering Building Developer Tools

  5. You don't Say

  6. Every single program can be reduced to Input Transformation Output

    * Former Boss
  7. None
  8. Human Readable Parsing Machine Readable Grammar

  9. None
  10. "in 11 seconds" 11 "11 seconds ago" -11 "in 5

    minutes" 300 "in 1 minute and 30 seconds ago" 90 "now" 0
  11. Leif Demo

  12. // 1 + 2 add(1,2) // 1 + (5 -

    3) add(1, subtract(5,3)) // 1 + 5 * 3 add(1, multiply(5,3)) // (1 + 5) * 3 multiply(add(1,5), 3)
  13. Leif Demo

  14. What else? Domain Specific NLP Config Files (Re)Implement Programming Languages

  15. Abstract Syntax Tree add(1, multiply(5,3)) { type: "callExpression", name: "add",

    arguments: [1 { type: "callExpression", name: "add", arguments: [5, 3] }] }
  16. Why?

  17. Focus!

  18. None
  19. Leif Demo

  20. - Parsers seem intimidating - Helps you understand Recursion -

    Try out formulon.io
  21. Shopping List

  22. Back

  23. Back