Path: utzoo!attcan!uunet!aplcen!samsung!rex!ukma!dftsrv!tsingle From: tsingle@sunland.sunland.gsfc.nasa.gov (Tim Singletary) Newsgroups: comp.lang.c Subject: need lex/yacc grammar for c Message-ID: Date: 12 Jul 90 14:35:20 GMT Sender: news@dftsrv.gsfc.nasa.gov Distribution: comp Organization: Goddard Space Flight Center, Greenbelt, MD Lines: 31 We need to do various transformations on C programs, one of the more interesting of which is to transform stuff like: struct { unsigned int a: 3; unsigned int b: 4; unsigned int c: 1; } bitfields; into struct { unsigned int c: 1; unsigned int b: 4; unsigned int a: 3; } bitfields; Sed and lex are powerful enough to do most of our transformations, but stuff like the above will (I think) require yacc. Does anyone have a lex/yacc grammar which recognizes C (or at least a substantial subset of C), and if you do, would you mind mailing it to me? Thanks, tim -- Tim Singletary, August Automation Inc., (301) 286-7942 -- NRA extremist, etc.