~/talk

How to parse a file

Talkat NDC London 2018 · 2018-01-15..01-19· [frontend-architecture]
slides:none on file

A practical ShaderLab parser for Rider/Resharper Unity support builds a PSI concrete syntax tree (including whitespace and comments) so the IDE can do highlighting, folding and refactorings. The pipeline uses lexer generators (Lex/Flex, CSharp/FSharp/Java ports) where lexer generates state tables and parser generators or hand-rolled top‑down recursive descent; bottom‑up uses shift‑reduce. Error recovery mixes panic mode, token insertion/removal and grammar-encoded errors. Nested comments, injected CG blocks and incremental parsing are handled with lexer actions and token stream decorators.

AI-written summary · about

  1. 0:00Introduction
  2. 1:00Why pass a file
  3. 7:00Naive parser
  4. 14:12Regular expressions
  5. 19:14State transitions
  6. 23:29Syntax analysis
  7. 29:00Topdown parse
  8. 32:43Topdown vs bottomup
  9. 35:10Parser combinators
  10. 36:08FParsec
  11. 37:14CParsec
  12. 39:04Filter
  13. 41:02Syntax Trees
  14. 41:46Filter Tokens
  15. 42:05Mechanical Process
  16. 42:21Significant Whitespace
  17. 42:49Insert Tokens
  18. 44:48Nested Comments
  19. 45:30Summary
  20. 45:49Surprise tokens
  21. 46:45Passing
  22. 47:29Error Handling
  23. 47:44Why do we care
  24. 48:51Error elements
  25. 49:31How to find an error
  26. 50:00Panic mode
  27. 51:51Token insertion
  28. 52:34Token removal
  29. 53:04Errors
  30. 53:46Incremental parsing
  31. 54:41Composable languages
  32. 56:26Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.