POV-Ray : Newsgroups : povray.programming : Example files for the POVRAY's grammar ? Server Time
28 Mar 2024 16:22:15 EDT (-0400)
  Example files for the POVRAY's grammar ? (Message 1 to 7 of 7)  
From: denis beurive
Subject: Example files for the POVRAY's grammar ?
Date: 5 Jan 2013 04:50:01
Message: <web.50e7f6edc0915e8bbe007bed0@news.povray.org>
Hello,

I try to deeply understand the PovRay's grammar.

I have the specification : http://www.povray.org/documentation/view/3.6.1/224/

But are there test files (used to test the parser) ?

I am looking from some examples that illustrate the grammar.

Thank you,

Denis


Post a reply to this message

From: clipka
Subject: Re: Example files for the POVRAY's grammar ?
Date: 5 Jan 2013 07:29:14
Message: <50e81c9a$1@news.povray.org>
Am 05.01.2013 10:48, schrieb denis.beurive:
>
> I try to deeply understand the PovRay's grammar.

Frankly there's not much to deeply understand. POV-Ray's parser is a 
kludgy old incoherent mess, and while there are structures that /seem/ 
to form a common pattern among all the statements, there are probably 
exceptions to each and every one of them. There's absolutely no hidden 
core grammar to be found in there, everything is in the individual 
statements (except for the tokenization rules, but they're quite 
straightforward).


Post a reply to this message

From: denis beurive
Subject: Re: Example files for the POVRAY's grammar ?
Date: 5 Jan 2013 11:20:00
Message: <web.50e8520861000dc7be007bed0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 05.01.2013 10:48, schrieb denis.beurive:
> >
> > I try to deeply understand the PovRay's grammar.
>
> Frankly there's not much to deeply understand. POV-Ray's parser is a
> kludgy old incoherent mess, and while there are structures that /seem/
> to form a common pattern among all the statements, there are probably
> exceptions to each and every one of them. There's absolutely no hidden
> core grammar to be found in there, everything is in the individual
> statements (except for the tokenization rules, but they're quite
> straightforward).

My idea is this one :

If I can find a logic behind the grammar, I can model the relation between
objects (that form the scene) in a class hierarchy (in the sense of object
oriented programming).

For example :

A sphere is an object.
All objects share some properties. For example, all objects may have a color.
It is possible to apply some common transformation to all objects.

Therefore :
The class sphere inherits from the class object.
The class object has some methods (the common transformations).



We could produce object oriented representation of a scene.

Then :



output.

Step 2 : Get rid of the intermediate step that consists on producing the POVRAY
output. We produce a "binary" representation og the scene that we give to the
renderer?

Do you think it is possible ?

Thank you,

Denis


Post a reply to this message

From: clipka
Subject: Re: Example files for the POVRAY's grammar ?
Date: 5 Jan 2013 13:08:19
Message: <50e86c13$1@news.povray.org>
Am 05.01.2013 17:17, schrieb denis.beurive:

> My idea is this one :
>
> If I can find a logic behind the grammar, I can model the relation between
> objects (that form the scene) in a class hierarchy (in the sense of object
> oriented programming).

Ah, now I understand.

I guess your best starting point would be the quick reference:

   http://www.povray.org/documentation/view/3.6.1/502/

You can safely ignore the LANGUAGE_DIRECTIVE stuff.

You might also try to dig your way through the source code.


Post a reply to this message

From: Le Forgeron
Subject: Re: Example files for the POVRAY's grammar ?
Date: 5 Jan 2013 16:02:05
Message: <50e894cd$1@news.povray.org>
Le 05/01/2013 17:17, denis.beurive nous fit lire :
> If I can find a logic behind the grammar, I can model the relation between
> objects (that form the scene) in a class hierarchy (in the sense of object
> oriented programming).

Be my guest, if you can read UML... page 18, figure 1.1 of old model

http://jgrimbert.free.fr/crayon.pdf

It's a bit far from the actual grammar, and nearer the actual objects
created during the parsing (of the povray version of that time: 2005).
(and it does not show the location of internal transformations, and some
features might be missing)

The document is out-dated & in French, but that's another story.

Notice that all the possible shapes are just one single box of that figure.


Post a reply to this message

From: denis beurive
Subject: Re: Example files for the POVRAY's grammar ?
Date: 6 Jan 2013 17:10:00
Message: <web.50e9f58d61000dc7be007bed0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 05.01.2013 17:17, schrieb denis.beurive:
>
> > My idea is this one :
> >
> > If I can find a logic behind the grammar, I can model the relation between
> > objects (that form the scene) in a class hierarchy (in the sense of object
> > oriented programming).
>
> Ah, now I understand.
>
> I guess your best starting point would be the quick reference:
>
>    http://www.povray.org/documentation/view/3.6.1/502/
>
> You can safely ignore the LANGUAGE_DIRECTIVE stuff.
>
> You might also try to dig your way through the source code.

Thank you for the information.

I'll take a look.

Regards,

Denis


Post a reply to this message

From: denis beurive
Subject: Re: Example files for the POVRAY's grammar ?
Date: 6 Jan 2013 17:10:01
Message: <web.50e9f5b561000dc7be007bed0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 05/01/2013 17:17, denis.beurive nous fit lire :
> > If I can find a logic behind the grammar, I can model the relation between
> > objects (that form the scene) in a class hierarchy (in the sense of object
> > oriented programming).
>
> Be my guest, if you can read UML... page 18, figure 1.1 of old model
>
> http://jgrimbert.free.fr/crayon.pdf
>
> It's a bit far from the actual grammar, and nearer the actual objects
> created during the parsing (of the povray version of that time: 2005).
> (and it does not show the location of internal transformations, and some
> features might be missing)
>
> The document is out-dated & in French, but that's another story.
>
> Notice that all the possible shapes are just one single box of that figure.

Thank you for your response.

I'll take a look at it.

Regards,

Denis


Post a reply to this message

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