Using Context Free Grammers
-
Suppose I want an application which takes a source file and outputs its data members and functions. Supposed to develop into a kind of class view explorer. Regarding parsing the source file .... should i go for using regular expressions rules for this parsing or should i go for a language representation in context free grammer[CFG] and use the CFG rules for parsing or is there any other possible ideas for source file parsing awaiting advice fordge
-
Suppose I want an application which takes a source file and outputs its data members and functions. Supposed to develop into a kind of class view explorer. Regarding parsing the source file .... should i go for using regular expressions rules for this parsing or should i go for a language representation in context free grammer[CFG] and use the CFG rules for parsing or is there any other possible ideas for source file parsing awaiting advice fordge
The by far easiest and most robust way is to use an existing parser generator like Goldparser http://www.devincook.com/goldparser/[^] Or ANTLR http://www.antlr.org/[^] they are both free to use and ive used goldparser before and it works very well... //Roger