lua-users home
lua-l archive

Re: lua parser generator or c-grammar parser

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Dave Dodge wrote:
On Mon, Jul 25, 2005 at 10:59:24AM +0700, Antero Vipunen wrote:
Well, even simple C-grammar parser would be enough for my needs.(I mean it should parse C files, and be written in lua)
Note that the C grammar is a bit tricky because of the preprocessor.
Consider what happens if the code has macros, stringization, token
pasting, or #if statements with mathematical expressions. If you
implement your own preprocessor, you also have the issue that
conditional code might expect compiler-specific predefined values.
In general, I don't need `understanding-parser'. I need `silly-parser' that will only build syntax trees for me,
so I can do some code preprocessing.
I only mention this stuff because I was working on a C parser (sorry,
not in Lua) in recent weeks and ran into all of this myself.
Can you share with me your code?
AMDG,
 Antero Vipunen.

AltStyle によって変換されたページ (->オリジナル) /