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
-
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
C++ code is hard to parse, unless you have an LL(k)-parser, IIRC. I believe ANTLR is a generalized LL(k) parser generator. But I'm unsure if there are any freely available LL(k) grammars for ISO/IEC 14882 C++. Many class viewers do heuristic parsing, which are basically "creatively guessing" parsers. I don't think they are strict CFG parsers. Good music: In my rosary[^]