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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38d32527e76861de X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-10 14:25:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-han1.dfn.de!news-nue1.dfn.de!newsfeed.r-kom.de!netnews.web.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Oliver Kellogg" Newsgroups: comp.lang.ada Subject: Re: GPS - A new kind of IDE? Date: Tue, 11 Feb 2003 02:24:07 +0100 Organization: T-Online Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1044915771 06 300 KstfEsESpAuDA 030210 22:22:51 X-Complaints-To: abuse@t-online.com X-Sender: 520012863826-0001@t-dialin.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Xref: archiver1.google.com comp.lang.ada:33970 Date: 2003-02-11T02:24:07+01:00 List-Id: I've just bumped into an interesting data point on parser contruction with ANTLR regarding parse speed. ANTLR supports syntactic predicates such as (subprog_body) => subprog_body where the rule subprog_body is applied on trial and if it turns out not to apply then the parser backs out and applies the next rule. Terence Parr, inventor of ANTLR, calls this "infinite lookahead". This feature makes for a prettier grammar because it allows more liberal reuse of rules. In the above example, we can write the subprog_body rule in a place where also a subprog_spec could be expected; the parser takes care of resolving the ambiguity. However, that beauty has its price. As a test, I submitted the source code of the Ada Graphics Package (agp95_v0.1_x11/src) to parsing (38560 LOC, 11851 executable semicolons.) With usage of syntactic predicate for the subprog_spec/subprog_body distinction ("pretty" soft-state grammar rule): real 1m16.635s user 1m15.930s sys 0m0.300s Without usage of syntactic predicate for the subprog_spec/subprog_body distinction ("ugly" hard-coded state): real 0m46.058s user 0m45.110s sys 0m0.370s So for kdevelop adasupport I'm going with the hard state rule for subprograms. Oliver Kellogg