C Declaration Parser from Wolfgang Stroh +++++++++++++++++++ Contact ------- Constructive critique welcomed! Send your email-letter to stroh@idefix.vmars.tuwien.ac.at (Wolfgang Stroh, Technical University, Vienna, Austria) Thanks for your interest in advanc! Wolfgang Abstract -------- The parser CTREE reads in an ANSI-compatible C program, analyzes it and prints out the syntax tree for all declarations. ctree.c only invokes the syntax tree printing facility. This, as any other syntax tree processing, is accomplished easily because off the tree's elegant recursive design. In the current version only global declarations are printed. All other information is thrown away but could be utilized easily. CTREE is based upon a major simplification: Only for declarations the syntax tree is synthesized. All expressions and statements are ignored. This makes parsing much simpler! Unlike real C compilers CTREE provides no type checking. Error reporting is done with a minimalistic approach. - It is assumed that tools like lint or gcc have shown the program's correctness before using CTREE. Normally CTREE is fed with the preprocessor's output. CTREE task to get the declarations of C program is the only function performed by the parser, which is therefore quite small. The parser is fully self-checking: All major preconditions are formulated with the assert()-macro. Therefore errors are detected as early as possible and changes to the parser do not affect its stability. Directories: ------------ docu Here is the documentation. - a PostScript file with the complete manual or the TeX source files include Here are all include files. parser The parser's source code Installation: ------------- A) Documentation: Print the file docu/manual.ps or use TeX: 'ectex manual'. B) Executable: cd parser; make make test Copyright: ---------- CTREE is in the public domain. To be precise: The Free Software Foundation's "GNU GENERAL PUBLIC LICENSE" apply to it.