by Allistar >> Tue, 18 Sep 2007 4:49:42 GMT
Hi all,
Has anyone done any research or implemented a lex/yacc style parsing system on Jade code? I wish to implement a system that will give me the equivalent of a parse tree for Jade code so I can walk through it an automatically detect bugs and non adherence to development standards. Think of this as like a LINT tool. Rather than parsing the Jade code myself (using standard String manipulation routines) I'd like to implement a proper parser so it is more flexible.
I have looked at the JadeMetadataAnalyzer class but that only reports on feature usage and a small set of statements (like "if" and "return"). I would like the full parse tree, including assignments, comments, variable names etc.
Doing a bit of poking around in the Jade internals I have discovered that the JadeMethod class has two binaries on them: one called "code" and one called "symbolTable" - reverse engineering this is proving difficult. (And it's undocumented, and hence probably unsafe to rely on it).
Does anyone have any suggestions or experience to share with this goal?
Thanks,
Allistar.