POV-Ray : Newsgroups : povray.pov4.discussion.general : Random POV-Ray 4 SDL proposal, #2 : Random POV-Ray 4 SDL proposal, #2 Server Time
12 Jun 2024 12:14:13 EDT (-0400)
  Random POV-Ray 4 SDL proposal, #2  
From: clipka
Date: 13 Dec 2015 16:54:23
Message: <566de90f$1@news.povray.org>
Here's another one.

This time I start out entirely differently: This language isn't based on
description of hierarchical data, salted with control statements.

This time statements are the one and only thing: A scene file is a list
of statements.

For the sake of preventing ambiguities, and for the sake of consistency,
all statements are terminated by a semicolon unless noted otherwise.

For the sake of continuity, I'll use "#" as first characters of my
control statements again, and for the sake of simplicity I'll stick to
the few ones defined in the last proposal:

  #elif (CONDITION)

  #loop (IDENTIFIER)

  #break (IDENTIFIER) ;

  #continue (IDENTIFIER) ;

A statement may be a block:


A statement block is the only statement /not/ terminated by a semicolon.

A statement may be an assignment:


An expression may be a scene element, such as a geometric primitive, a
texture or the like. Such an expression is comprised of a /type/
identifier and a statement block.

  sphere { ... }
  texture { ... }

A statement may also be a sole expression; in this case, the result is
"dropped into" the block it resides in, as a /child/ of the block:

  foo = box { ... }
    sphere { ... }
    sphere { ... }
    box { ... }
    foo ;

Note how, in contrast to the current SDL, the object expression isn't
wrapped into "object { ... }".

Besides child elements, scene elements also have properties. The
following statement sets a property of the current block:


All object properties are set via identifier, rather than anonymlously
by position; for instance, instead of

  sphere { CENTER, RADIUS }

it will be:

  sphere {
    center: EXPRESSION ;
    radius: EXPRESSION ;

Well, that's about as far as I've thougt this through for now.

Post a reply to this message

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