~/talk

Writing a language parser in 15min (or less)

Talkat GoDays 2020 · 2020-01-21..01-23· [compilers-and-language-design]
links:none on file
slides:none on file

Shows how to turn a PEG grammar for a small Asciidoc subset into a working Go parser in minutes, using the Parsing Expression Grammars model and the pigeon generator to produce a Go file that emits an AST. Captures nested bold/italic/monospace, wires rule captures to Go constructors, runs targeted rule-level tests, then renders the AST to HTML via templates. Demonstration compiles the generated code and proves the pipeline from Asciidoc→HTML works end-to-end.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:05What is AsciiDoc markup
  3. 2:50Limitations of regex for parsing
  4. 3:12Introduction to PEG parsers
  5. 3:54Defining grammar rules
  6. 5:40How PEG parsing works in practice
  7. 7:49Handling parsing errors
  8. 8:31Generating parsers with Pigeon
  9. 9:55Extending PEG with Go code
  10. 11:00Live demo and generated parser
  11. 12:52Output as AST and HTML conversion
  12. 13:58Project resources and conclusion
  13. 14:47Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.