POV-Ray : Newsgroups : povray.general : Different error messages for same POV-file Server Time
10 Aug 2024 07:17:07 EDT (-0400)
  Different error messages for same POV-file (Message 15 to 24 of 24)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Chris Huff
Subject: Re: Different error messages for same POV-file
Date: 16 Mar 2000 17:44:44
Message: <chrishuff_99-D4B263.17464216032000@news.povray.org>
In article <38D15EDC.6F76A0B0@pacbell.net>, lin### [at] povrayorg 
wrote:

> Chris Huff wrote:
> 
> > I really wish POV-Ray would accept, if not require, semicolons at the
> > end of declarations. It should be a simple modification to make, at
> > least for someone who understands the declaration code(I don't).
> 
> Why ?

So we don't have to remember which times a semicolon is required?
Currently, it is not consistant. You have to memorize the special 
cases:float, vector, color... It would be easier to just allow a 
semicolon at the end of every #declare and #local. If they were 
required, it might even simplify the parser and make things a little 
faster.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ken
Subject: Re: Different error messages for same POV-file
Date: 16 Mar 2000 18:10:24
Message: <38D169C7.81AB9F18@pacbell.net>
Chris Huff wrote:
> 
> In article <38D15EDC.6F76A0B0@pacbell.net>, lin### [at] povrayorg
> wrote:
> 
> > Chris Huff wrote:
> >
> > > I really wish POV-Ray would accept, if not require, semicolons at the
> > > end of declarations. It should be a simple modification to make, at
> > > least for someone who understands the declaration code(I don't).
> >
> > Why ?
> 
> So we don't have to remember which times a semicolon is required?
> Currently, it is not consistant. You have to memorize the special
> cases:float, vector, color... It would be easier to just allow a
> semicolon at the end of every #declare and #local. If they were
> required, it might even simplify the parser and make things a little
> faster.


#declare Bob =
object {
  #declare Axel = box{-.5,.5}
  #declare Col1 = rgb<1,1,1>;
  #declare Col2 = rgb<0,0,0>;
  #declare XXX = pigment{checker color Col1 color Col2}

  #declare a = 0;
    #while (a<1)
      object{Axel translate a pigment{XXX}}
    #declare a=a+1;
  #end
}
;

object{Bob}

Which semi-colon closes the Bob declaration in the example above ?

I know it is obvious to us but this is a simple example which might
confuse the hell out of the parser.

Or do you make yet another special rule so that semi-colons don't
apply to declared objects and CSG operations because they already
use curly braces to define their ending ?

Does this make sense #declare foo = object {bar};  ?

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Chris Huff
Subject: Re: Different error messages for same POV-file
Date: 16 Mar 2000 18:48:26
Message: <chrishuff_99-7F0265.18502216032000@news.povray.org>
In article <38D169C7.81AB9F18@pacbell.net>, lin### [at] povrayorg 
wrote:

> Chris Huff wrote:
> > 
> > In article <38D15EDC.6F76A0B0@pacbell.net>, lin### [at] povrayorg
> > wrote:
> > 
> > > Chris Huff wrote:
> > >
> > > > I really wish POV-Ray would accept, if not require, semicolons at 
> > > > the
> > > > end of declarations. It should be a simple modification to make, at
> > > > least for someone who understands the declaration code(I don't).
> > >
> > > Why ?
> > 
> > So we don't have to remember which times a semicolon is required?
> > Currently, it is not consistant. You have to memorize the special
> > cases:float, vector, color... It would be easier to just allow a
> > semicolon at the end of every #declare and #local. If they were
> > required, it might even simplify the parser and make things a little
> > faster.
> 
> 
> #declare Bob =
> object {
>   #declare Axel = box{-.5,.5}
>   #declare Col1 = rgb<1,1,1>;
>   #declare Col2 = rgb<0,0,0>;
>   #declare XXX = pigment{checker color Col1 color Col2}
> 
>   #declare a = 0;
>     #while (a<1)
>       object{Axel translate a pigment{XXX}}
>     #declare a=a+1;
>   #end
> }
> ;
> 
> object{Bob}
> 
> Which semi-colon closes the Bob declaration in the example above ?

The last one.


> I know it is obvious to us but this is a simple example which might
> confuse the hell out of the parser.

I doubt it, it shouldn't be hard to do. Actually, it most likely 
wouldn't require much extra work at all. And you missed two, one in the 
declaration of Axel and the other in XXX.

And just to nit-pick, your while loop is indented wrong, the #while 
should be on the same level as "#declare a = 0;", and "object{Axel..." 
should be on the same level as "#declare a=a+1;". And it would probably 
be a good idea to use capitals instead of lowercase, "A" insead of "a", 
to avoid conflicts with future reserved words/characters. And those 
#declares(other than the loop counter) really should be outside the 
object, no purpose is served in putting them there. And your #while() 
loop will only loop once, kind of useless that way. :-)


> Or do you make yet another special rule so that semi-colons don't
> apply to declared objects and CSG operations because they already
> use curly braces to define their ending ?
> 
> Does this make sense #declare foo = object {bar};  ?

The } defines the end of the object, not the declaration, so the 
semicolon should remain. Maybe also allow an "implied union" without a 
"union {}" wrapper(just specify multiple objects between the "=" and the 
";"), but I don't think that would be very useful and it would make 
things harder to read.
And yes, that code makes sense.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ken
Subject: Re: Different error messages for same POV-file
Date: 16 Mar 2000 22:02:19
Message: <38D1A00E.197487CE@pacbell.net>
I will indent my code anyway I see fit and I think you are over complicating
things.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Nieminen Juha
Subject: Re: Different error messages for same POV-file
Date: 17 Mar 2000 10:04:22
Message: <38d24976@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: I know it is obvious to us but this is a simple example which might
: confuse the hell out of the parser.

  Language parsers (C++, Java...) do it all the time (ie. several nested
blocks which end with ';') so it's not so difficult after all. For example:

class Test
{ int x;
};

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Juha
Subject: Re: Different error messages for same POV-file
Date: 17 Mar 2000 10:05:19
Message: <38d249ae@news.povray.org>
Chris Huff <chr### [at] yahoocom> wrote:
: And just to nit-pick, your while loop is indented wrong

  Don't tell him how to indent. He will not listen anyways :)

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Different error messages for same POV-file
Date: 17 Mar 2000 10:08:31
Message: <38D249E9.62CF25D3@pacbell.net>
Nieminen Juha wrote:
> 
> Chris Huff <chr### [at] yahoocom> wrote:
> : And just to nit-pick, your while loop is indented wrong
> 
>   Don't tell him how to indent. He will not listen anyways :)

You sure got that one right.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: PoD
Subject: Re: Different error messages for same POV-file
Date: 17 Mar 2000 15:24:50
Message: <38D29BC3.8ACD0FC9@merlin.net.au>
#declare Foo = Bar;

Now replace Foo with whatever variable you want and replace Bar with
whatever you want to initialise it with.
Doesn't that make more sense than having lots of rules about when to put
the semicolon?

PoD.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Different error messages for same POV-file
Date: 17 Mar 2000 22:42:00
Message: <38D2F9B2.2E69D588@hotmail.com>
Chris Huff wrote:
> 
> > error: undeclared identifier expected but float function 'clock_delta'
> > found instead.
> 
> It sounds like POV is using(internally, not in your scene) a variable
> that doesn't get initialized...this would qualify as a bug even if that
> isn't the cause.
> 

Do you think this may be the same bug that appears when running the
file I enclosed in my posting "POV-file that crashes POV-Ray" 
17. March ?

Regards

Tor Olav

-- 
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Different error messages for same POV-file
Date: 17 Mar 2000 22:52:48
Message: <38D2FC3B.2972B2A1@hotmail.com>
I have now found a way to do several nested 
calls of macros that passes arrays to each other 
(like in the last macro below), without 
getting error messages and without having to
make global declarations of local variables.

I will post my "solution" here if anyone is 
interested.

Regards

Tor Olav

-- 
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Tor Olav Kristensen wrote:
> 
> ...I want to be
> able to replace macros like e.g. this one:
> 
> #macro Minv(MM)
> 
>   #local NN = array[3]
>   #local PP = array[3]
>   #local QQ = array[3]
>   #local s = 1/Mdet(MM);
>   #local NN = Mcof(MM)
>   #local PP = Mtrans(NN)
>   #local QQ = Mscale(s, PP)
> 
>   QQ
> 
> #end
> 
> with macors like this one:
> 
> #macro Minv(MM)
> 
>   Mscale(1/Mdet(MM), Mtrans(Mcof(MM)))
> 
> #end
>


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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