POV-Ray : Newsgroups : povray.off-topic : Very long post : Re: Very long post Server Time
7 Sep 2024 07:21:34 EDT (-0400)
  Re: Very long post  
From: Invisible
Date: 1 Oct 2008 10:33:23
Message: <48e38a33$1@news.povray.org>
Darren New wrote:

> Actually, that's not *quite* right.
> 
> What Haskell is using is called a recursive-descent parser: the parser 
> basically uses the run-time stack in place of an explicit stack. It's 
> best for LALR(1) syntaxes, which means "Look Ahead Left to Right 1 
> token". I.e., a language you can parse by running strictly from left to 
> right, looking only one element ahead, so you don't need the "P_Try()" 
> function. Some languages (like Pascal) are explicitly designed this way 
> to make it easy to build a recursive descent parser.

OK, well since you seem to know something about this... using the 
formalisms developed here, how would you go about parsing a grammar that 
can consist of integers, variable names, and + - / * ( ), such that the 
operators have the correct precidence?

I thought I had this working, but it seems that bracketing the 
expressions in unusual but valid ways causes the parser to trip over in 
inexplicable ways. :-(


Post a reply to this message

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