On Mon, Feb 8, 2010 at 10:51 PM, Balachandar <[email protected]> wrote: > Hi guys, > As a part of my project i need to parse a "c source code" into tokens.I > need > to process the tokens to identify some predefined patterns.I searched in > google > and got some suggestions about pycparser and ply.
ply looks like a general purpose lex/yacc replacement... pycparser uses ply internally and generates the AST. I am doubtful if you need pycparser. Take the source and use only the lexer... You do not need a parser to tokenize. This is a lex version of the C language http://www.lysator.liu.se/c/ANSI-C-grammar-l.html Do the values 'returned' contain enough info for you? If so, lex is the tool. --- Ashok `ScriptDevil` Gautham _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
