From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/49949 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: BNF grammar for ConTeXt (was: What happened with sectionworld?) Date: Thu, 30 Apr 2009 10:57:04 +0200 Message-ID: References: <1D0F418D-E66C-4A90-9616-8757CDB08058@fiee.net> <20090429174315.3d61cce0@KUBUNTU64> <20090429184654.740d27cf@KUBUNTU64> <20090429231641.693c8867@KUBUNTU64> <20090430101646.237ad726@KUBUNTU64> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1154035595==" X-Trace: ger.gmane.org 1241081911 28544 80.91.229.12 (30 Apr 2009 08:58:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Apr 2009 08:58:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 30 10:58:22 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LzS62-00015u-CN for gctc-ntg-context-518@m.gmane.org; Thu, 30 Apr 2009 10:58:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 363F31FDE6; Thu, 30 Apr 2009 10:58:20 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 24836-08; Thu, 30 Apr 2009 10:57:23 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 851D81FD09; Thu, 30 Apr 2009 10:57:23 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A97FD1FCF6 for ; Thu, 30 Apr 2009 10:57:21 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09393-05 for ; Thu, 30 Apr 2009 10:57:11 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by ronja.ntg.nl (Postfix) with ESMTP id EF08A1FCBD for ; Thu, 30 Apr 2009 10:57:10 +0200 (CEST) Original-Received: from mail-ew0-f173.google.com (mail-ew0-f173.google.com [209.85.219.173]) by filter2-ams.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n3U8v5oH003028 for ; Thu, 30 Apr 2009 10:57:09 +0200 Original-Received: by ewy21 with SMTP id 21so1756205ewy.2 for ; Thu, 30 Apr 2009 01:57:05 -0700 (PDT) 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=GW+pUp+mBDDBCgLRRVq5Z8IRoH/vf9o2eR/P3g6sQ3Q=; b=tc65lUwTj4xPm0Vt8dbwdVZsLITS9lo8hoe5akBlEBYg/utLJsRzyFu76dDM5rArZx 18ZuOgyPOEVhmI8jMedIBsesk5Ddff7ZNRJp5pxpdL5/rwNvLlGgyKwMACab16PQ+M8A b0vXEngibyQibM1QbtYrYFiNf/Lm2b9ck8Crg= 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=YSl2SnLDZDnBpxI1YR0k8ImlWQKMFNNvu6eRTtff3BQtHlRe7/MvTChnwzZJ1rGkZw sY1XnMSD8RbL2sXk/qSDW9SVvnHW7u5JfqhCwB/Xz19rJOvoMIhQE5t6IBpuqcwcb1Sg //J7HXZClKtApu0MSWH+aKWRNJqVqYArLuork= Original-Received: by 10.216.28.75 with SMTP id f53mr344646wea.165.1241081824899; Thu, 30 Apr 2009 01:57:04 -0700 (PDT) In-Reply-To: <20090430101646.237ad726@KUBUNTU64> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.219.173; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 217511891 - 575595dc948f - 20090430 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:49949 Archived-At: --===============1154035595== Content-Type: multipart/alternative; boundary=0016e6d27c934f71f20468c1e1c4 --0016e6d27c934f71f20468c1e1c4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Thu, Apr 30, 2009 at 10:16 AM, R. Bastian wrote: > On Thu, 30 Apr 2009 09:48:40 +0200 > luigi scarso scribit: > > > R. Bastian: > > > > > CONTEXT_SOURCE ::= PREAMBLE "\starttext" TEXT "\stoptext" | > CONTEXT_SOURCE > > >>> TEXT ::= STARTSTOPS | SETUPS | DEFINES | OTHERS [ TEXT > > >> > > >> luigi: > > > > > To be general, i think > > >> MY_CONTEXT_SOURCE ::= MACRO* END > > >> > > > > > R. Bastian: > > > > > I dont understand the sense of "\end\starttext" > > > > sense==semantic > > > > "\end""\starttext" is a valid string for a hypothetical bnf grammar of > > ContTeXt > > which is not valid for your bnf ; > > "\end""\starttext""\stoptext" is in your bnf grammar > > and has the same semantic of "\end""\starttext" . > > > > The point is : a bnf for Context can be hard to define > > > > > > luigi: > > > > think that a bnf or lpeg grammar is really useful for a sort of > > >> standard-ConTeXt > > >> or minimal-ConTeXt or light-ConTeXt > > >> ie a ConTeXt to use as "reference" > > >> > > > > > R. Bastian: > > > > > Exactly what I need : standard, minimal and light > > > > > > > Exactly what can be hard to define and capture in a bnf . > > > > wolfgang > > > > > > > > How could a BNF grammar help to learn ConTeXt, > > > > a bnf can help to build a syntax checker, a highlighter etc. > > Actually the only way to say that you have a valid ConTeXt string > > is running context on that string . > > > > The semantic is another story. > > OK - but isn't it not worth to try it ? > sure, and I encourage you to go on and possibly write something x next eurotex. My suggestions to start : 1) define a **simple but significative** domain ,ie "this grammar is for subset of ConTeXt language dedicated to variable-data pdf forms" 2) make a bnf grammar spec 3) build a parser lex/yacc for 2) 4) make a lpeg grammar 5) user lpeg inside context for 3) PS it was just a coincidence , but for other reasons I have found this link http://martinfowler.com/dslwip/ -- luigi --0016e6d27c934f71f20468c1e1c4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Thu, Apr 30, 2009 at 10:16 AM, R. Bas= tian <rbastian@fre= e.fr> wrote:
On Thu, 30 Apr 2009 09:48:40 +0200
luigi scarso <luigi.scarso@gma= il.com> scribit:

> R. Bastian:
>
> > CONTEXT_SOURCE ::=3D PREAMBLE "\starttext" TEXT "\= stoptext" | CONTEXT_SOURCE
> >>> =C2=A0TEXT ::=3D STARTSTOPS | SETUPS | DEFINES | OTHERS [= TEXT
> >>
> >> luigi:
>
> > =C2=A0 To be general, i think
> >> =C2=A0 MY_CONTEXT_SOURCE ::=3D MACRO* END
> >>
> >
> R. Bastian:
>
> > I dont understand the sense of "\end\starttext"
>
> sense=3D=3Dsemantic
>
> "\end""\starttext" is a valid string for a hypothe= tical =C2=A0bnf grammar of
> ContTeXt
> which is not valid for your bnf ;
> "\end""\starttext""\stoptext" is in your= bnf grammar
> and has the same semantic of =C2=A0"\end""\starttext&qu= ot; .
>
> The point is : a bnf for Context can be hard to define
>
>
> =C2=A0luigi:
>
> think that a bnf or lpeg grammar is really useful for a sort of
> >> standard-ConTeXt
> >> or minimal-ConTeXt or light-ConTeXt
> >> ie a ConTeXt to use as "reference"
> >>
> >
> R. Bastian:
>
> > Exactly what I need : standard, minimal and light
> >
>
> Exactly what can be hard to define and capture in a bnf .
>
> wolfgang
>
> >
> > How could a BNF grammar help to learn ConTeXt,
>
> a bnf can help to build a syntax checker, a highlighter etc.
> Actually the only way to say that you have a valid ConTeXt string
> is running context on that string .
>
> The semantic is another story.

OK - but isn't it not worth to try it ?
sure, and I encourage you to go on and possibly write so= mething x next eurotex.

My suggestions to start :
1= ) define a **simple but significative** domain ,ie "this grammar is fo= r=C2=A0 subset of ConTeXt language dedicated to variable-data pdf forms&quo= t;
2) make a bnf grammar spec
3) build a parser lex/yacc for 2)
4) make = a lpeg grammar
5) user lpeg inside context for 3)

PS
it was = just a coincidence , but for other reasons I have found this link
http://martinfowler.com/dslwip/
--
luigi

--0016e6d27c934f71f20468c1e1c4-- --===============1154035595== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1154035595==--