Gist 782256
✓ Published0🌍 Public
XXXX
Last edited Jan 16, 2011
Created on Jan 16, 2011
The example demonstrates a syntax-tree rewriting workflow for LPC source code, showing a crash during tree optimization. It parses input through `LPC::Parser`, extracts the parse tree, and feeds it into `LPCTreeRewrites::TreeParser` via an ANTLR3 `CommonTreeNodeStream`, then calls `downup` to rewrite the tree. The run terminates with a `TypeError` (`nil is not a symbol`) inside ANTLR3’s `recognize` method, revealing a failure in the grammar’s rewrite rules. The code relies on the ANTLR3 Ruby runtime and a custom generated lexer/parser, with the error trace pinpointing the exact library call where the issue occurs.
AI-generated description