Return-Path: Delivered-To: apmail-incubator-general-archive@www.apache.org Received: (qmail 80087 invoked from network); 16 Nov 2009 07:11:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Nov 2009 07:11:10 -0000 Received: (qmail 94290 invoked by uid 500); 16 Nov 2009 07:11:09 -0000 Delivered-To: apmail-incubator-general-archive@incubator.apache.org Received: (qmail 94104 invoked by uid 500); 16 Nov 2009 07:11:08 -0000 Mailing-List: contact general-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@incubator.apache.org Delivered-To: mailing list general@incubator.apache.org Received: (qmail 94093 invoked by uid 99); 16 Nov 2009 07:11:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2009 07:11:08 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cgurkanerdogdu@gmail.com designates 74.125.78.150 as permitted sender) Received: from [74.125.78.150] (HELO ey-out-1920.google.com) (74.125.78.150) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2009 07:11:05 +0000 Received: by ey-out-1920.google.com with SMTP id 26so1628722eyw.8 for ; Sun, 15 Nov 2009 23:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=buOG3vTuGU11U41E+MTm0yzbrkeDYU7AwQ+Zu+8yXO8=; b=KX2ICGtpX0xpTiBS8GR5SrHTEz585AyaaK7sAxxiLTf/Ibm0sxNrr9yYs6VlV3QKbw 8edQwtdFY1cQSOpjCkCeJ9HTY8Ytoba9pKwB5WFW5AidHHwzHcfVyy789g3THafHjuNB 5kMKLIQibQbxQkt1gtVNq5RJ9kjQ/S3l6iu7g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=T3bymzBfl9byMXwKChW+1w8rxoOp7dpHcVfpbru0k0aQlGbDQTQ+tNR9Op396TAbFJ Dye0HdC32G8dA/tsVf6Uef3fj0rH4KlWhsxoC6mHBGFDUjYEXYVYLPQfx1RCHYenMrUf vi1bRECrUr/aS9AzP0pCRqmcYW+LuzNEB8Z58= MIME-Version: 1.0 Received: by 10.213.24.24 with SMTP id t24mr1134256ebb.90.1258355443684; Sun, 15 Nov 2009 23:10:43 -0800 (PST) In-Reply-To: <08ADCB09-3824-45DF-BF90-540DDF5D3312@gmail.com> References: <08ADCB09-3824-45DF-BF90-540DDF5D3312@gmail.com> Date: Mon, 16 Nov 2009 09:10:43 +0200 Message-ID: Subject: Re: [grammar] pure java syntax analyzer (this is not a compiler of compiler) From: Gurkan Erdogdu To: general@incubator.apache.org Content-Type: multipart/alternative; boundary=000e0cdfc5be38d59d047877b561 --000e0cdfc5be38d59d047877b561 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi: I think that writing some incubator proposal document related with your project is a good idea to start discussions. You could look at sample proposals here . http://wiki.apache.org/incubator/ Thanks; --Gurkan 2009/11/15 Ga=EBl Lalire > Hello, > > Today if you want to do syntax analysis, you have to use a compiler of > compiler (bison, yacc, javaCC ...) which generates source code. > After generation, you need to compile your generated source code and then > you can parse some input. > > I dislike this method because : > - you need to learn a meta-language (the language which describe the > grammar) > - reusability of grammar is excluded > - the grammar cannot be dynamic (self described) > > However I did not found any dynamical grammar analyzer so I decided to > write it. > I separate my project in 3 modules : > - API : define Token, Terminal, Grammar, exceptions, ... ; A lexical > analyzer have to depends on this module to send terminals to the syntax > analyzer > - Impl : The analyzers (LR, LL, SLR, ...) and some calculation utilities. > - SPI : This module provide user friendly abstract classes. For example, = if > you create a grammar using this module there will be a type checking > (generics) on non-terminals > and its rules, so you will be sure that there will be no > ClassCastException. It also provide a easy way to create arithmetic > expression (you just need to provide terminals, the helper > will create the rules). > > Why donate to apache ? > I hope that I'm not the only one interested by having a runtime grammar > tool, and I hope I could create a community on this project (because I'm > alone). > This isn't an easy domain, there is many things I do not know about > compilation, so a community could bring speeder or new implementations. > Also apache is well-known in university, which could be interested on thi= s > project for practical exercises. > > Future tasks : > - LL(*) to create (abstract LL exists and is untested) > - LR(1+) to create (I need documentations) > - LALR(*) to create (need documentations too) > - SLR(2+) to create (need documentations always) > - Naming issue (bad english, bad words ...) > - Comments > - Tutorial > - Find a way to serialize the grammar's states (actions on terminal input > maps) and restore it with a simple bindings of terminals instead of gramm= ar > analyze. > - Create bindings with a lexer (ORO ? JDK ?) > - More reusable grammar part (boolean expression, sql parser, ...) > - Parsing error management > - Create a BNF to the SPI convertor > - ... > > I join a source code to this mail. > This is a maven2 / eclipse project [eclipse is not mandatory but the > .project is provided] > > Now I need a champion (If I understand the mechanism : apache rule are no= t > simple) to integrate the project. > > Best regards, > Gael Lalire > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: general-unsubscribe@incubator.apache.org > For additional commands, e-mail: general-help@incubator.apache.org > --=20 Gurkan Erdogdu http://gurkanerdogdu.blogspot.com --000e0cdfc5be38d59d047877b561--