From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e0c572c66918d29d X-Google-Attributes: gid103376,public X-Google-Thread: 107d55,e0c572c66918d29d X-Google-Attributes: gid107d55,public X-Google-Thread: 1014db,e0c572c66918d29d X-Google-Attributes: gid1014db,public X-Google-Thread: f5e83,e0c572c66918d29d X-Google-Attributes: gidf5e83,public X-Google-Thread: 109fba,e0c572c66918d29d X-Google-Attributes: gid109fba,public X-Google-Thread: 10a146,e0c572c66918d29d X-Google-Attributes: gid10a146,public From: "The Wilkinsons" Subject: Re: Identifying language constructs Date: 2000/02/04 Message-ID: #1/1 X-Deja-AN: 581837605 References: <389BA0DC.F1FD7C73@uah.edu> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 X-Trace: news.premier1.net 949735522 206.129.117.122 (Fri, 04 Feb 2000 23:25:22 PST) Organization: Premier1 Internet Services, Inc. NNTP-Posting-Date: Fri, 04 Feb 2000 23:25:22 PST Newsgroups: comp.lang.c++,comp.lang.java.programmer,comp.lang.java.softwaretools,comp.lang.java.tech,comp.lang.c,comp.lang.ada Date: 2000-02-04T00:00:00+00:00 List-Id: Lab User wrote in message <389BA0DC.F1FD7C73@uah.edu>... >I need a way to programically recognise basic construct of the following >languages: >Ada, C, C++, Java. >I need to recognise comments statements, declarations, assignments, >function calls, >other operations, class declarations, list of inherited methods for the >class, >list of newly defined methods, correctly recognise if a class is defined >inside other class, etc. > >Any suggestion how to do it? Get a decent "yacc" and "lex" and the appropriate ".y" and ".l" files for those languages. Should be available somewhere under GNU license. Making yacc simply *recognize* the constructs, rather than generate code for them, isn't overwhelmingly difficult, except for figuring out what to do with shift/reduce conflicts. (Probably just ignore them for your purposes?)