~/talk

Source code processing with Python

Talkat EuroPython 2011 · 2011-06-20..06-26· [python, compilers-and-language-design]
links:none on file
slides:none on file

Shows how Python finds and rewrites real C and Objective C code by combining a Python parser generator, a C search object that iterates code and returns hits for specific function symbols, and a template library that performs token-aware templates substitutions. Demonstrates a search script that locates all calls and definitions of a function, a replacer that inserts missing tokens to keep code syntactically correct, and reports that token-level transforms are slower than plain parsing but produce valid, low‑noise edits.

AI-written summary · about

  1. 0:00Source code processing intro
  2. 2:00Why regular expressions fail for code parsing
  3. 5:00Tree-sitter for code analysis
  4. 9:00Custom languages with grammars
  5. 13:00Searching code with queries
  6. 16:30Template-based substitutions
  7. 20:00Token-level transformations
  8. 23:40Expression generation
  9. 28:45Handling multiplicities
  10. 29:56Tree-sitter performance
~/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.