POV-Ray : Newsgroups : povray.general : SDL grammar Server Time
2 Aug 2024 02:21:15 EDT (-0400)
  SDL grammar (Message 1 to 5 of 5)  
From: Elias Pschernig
Subject: SDL grammar
Date: 4 Mar 2005 17:35:01
Message: <web.4228e18f3b5d8251fdfc77bc0@news.povray.org>
I was just wondering, does anyone know about the origin of the grammar used
for describing the SDL throughout the pov docs? I looked at the pov source,
and it doesn't seem to be actually used in it.

I started playing around with some python code to parse simple .pov scripts
based on SDL grammar snippets from the docs - so now I was wondering if
there's somewhere the complete grammar, and maybe even a utility to
generate a parser based on it? (Else I have to copy&paste it all out of the
docs..)


Post a reply to this message

From: Warp
Subject: Re: SDL grammar
Date: 4 Mar 2005 20:34:36
Message: <42290cac@news.povray.org>
Elias Pschernig <elias at users sf net> wrote:
> I was just wondering, does anyone know about the origin of the grammar used
> for describing the SDL throughout the pov docs?

  It's a kind of BNF derivative. The BNF notation is quite common in
many places as it's a formal way to define the syntax of things.

> I started playing around with some python code to parse simple .pov scripts
> based on SDL grammar snippets from the docs - so now I was wondering if
> there's somewhere the complete grammar, and maybe even a utility to
> generate a parser based on it? (Else I have to copy&paste it all out of the
> docs..)

  I think yacc and lex are often used to create language parsers with
some BNF-style syntax.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Elias Pschernig
Subject: Re: SDL grammar
Date: 5 Mar 2005 07:15:00
Message: <web.4229a2898c7fd44c969560f60@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Elias Pschernig <elias at users sf net> wrote:
> > I was just wondering, does anyone know about the origin of the grammar used
> > for describing the SDL throughout the pov docs?
>
>   It's a kind of BNF derivative. The BNF notation is quite common in
> many places as it's a formal way to define the syntax of things.
>
> > I started playing around with some python code to parse simple .pov scripts
> > based on SDL grammar snippets from the docs - so now I was wondering if
> > there's somewhere the complete grammar, and maybe even a utility to
> > generate a parser based on it? (Else I have to copy&paste it all out of the
> > docs..)
>
>   I think yacc and lex are often used to create language parsers with
> some BNF-style syntax.
>

Thanks. I was actually hoping to find the program which was used to test the
BNF used in the docs, since the pov source itself apparently doesn't use
it. Or maybe just the complete grammar in one file, not scattered into the
docs. But I guess, I must just to some copy&pasting :)


Post a reply to this message

From: Warp
Subject: Re: SDL grammar
Date: 5 Mar 2005 16:53:42
Message: <422a2a66@news.povray.org>
Elias Pschernig <elias at users sf net> wrote:
> Or maybe just the complete grammar in one file, not scattered into the
> docs. But I guess, I must just to some copy&pasting :)

  How about http://povray.org/documentation/view/3.6.1/502/

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Elias Pschernig
Subject: Re: SDL grammar
Date: 5 Mar 2005 20:00:01
Message: <web.422a55b08c7fd44c693b070f0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> > Or maybe just the complete grammar in one file, not scattered into the
> > docs. But I guess, I must just to some copy&pasting :)
>
>   How about http://povray.org/documentation/view/3.6.1/502/
>

Heh, I could have sworn that is not in the docs that shipped with my pov :)
That indeed makes it easier, thanks.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.