> But perhaps I should write a C-language parser in J? That's ambititous. And would be quite a boon to the community.
> I could see this being useful in the context of cd and Agreed, and also a good example of J, not to mention a propoganda piece. > extracting values from C's include files. We do already have ~system\main\defs\build\sym2ijs.ijs but that requires a C compiler, which is completely different from your proposal (for one thing, Windows machines do not usually have a C compiler). OTOH sym2ijs knows what, e.g. "long" means according to its host system. On that note: * sym2ijs needs to be run through http://www.jsoftware.com/jwiki/Scripts/Fixargs * Why can't I find this script in http://www.jsoftware.com/svn/base/ ? Is that repository kept up to date? I can't ever seem to find what I want in there. > (Do you know of any concise references describing C's syntax?) Not off the top of my head, but I did some googling. Besides the normative reference, which isn't concise, most parsers I found (e.g. in CPAN) depended upon a C compiler. Which defeats the purpose of the project. Here's one I found implemented in ANTLR and Java, http://www.antlr.org/grammar/cgram/grammars In particular, you'll probably want to look at this file: http://www.antlr.org/grammar/cgram/grammars/StdCParser.g (scroll past all the Java until you get to the translationUnit identifier; the grammar starts there). Note the caveats at the top of the file, though. I'll keep looking, there has to be another programming language out there that implemented a C parser, just for the sake of it. -Dan -- View this message in context: http://www.nabble.com/parsing-tf4888496s24193.html#a14007806 Sent from the J Programming mailing list archive at Nabble.com. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
