On Tue, 2004-02-10 at 17:04, David Burnett wrote:
Hi All,
I am trying to implement a parser for my FractaCanvas project to read fractint formulae. I have got as far as extracting tokens and checking for placement. Does anyone have any design doc that describes how parser.c works (you do use design doc don't you).
OK, this is not really all that similar to what you asked for, but... I've written a parser + compiler for Fractint .frm files in Python, using the PLY parser-generator. While this may not be directly usable for you, it is at least a concise description of what I think the Fractint parser understands. It actually parses a superset of the syntax accepted by Fractint and understands a bunch of UltraFractal constructs - that may or may not be a problem for you. The lexer + parser are relatively self-contained and output an AST. You can find them at http://cvs.sourceforge.net/viewcvs.py/gnofract4d/gnofract4d/libfract4d/compi... You'll need fractlexer.py, fractparser.py, absyn.py, lex.py and yacc.py. You could also try looking at the user documentation that comes with UltraFractal - it has a good, albeit informal, description of the syntax and standard library that I found that very useful. Regards, -- Edwin