Re: Re: FXPath - A comment on EXSL
Hi Jeni, > I thought that single token lookahead had something to do with only > needing to look ahead a single token to be able to work out what a > token means. Perhaps my naivety is showing through, but in your > example: > > > or and and or and or or and or > > then you *know* that the first 'or' must be an element name because if > it were an operator name then it would have something in front of it, > so you *know* that the first 'and' has to be an operator name, so you > *know* that the second 'and' has to be an element name and so on. So > you can tokenise it all successfully before working out what kind of > expression has priority. Ok, I just wanted to give an example of how precedence rules works. The lookahead issue was examplified in an earlier post: true () When the parser sees the 'true' token it cannot yet know if this is a node test for the element 'true' or if it will be the 'true' function call. It must look one token ahed, '(' in this case, to make that decision. > > With: > > if and then * else - 2 > When the parser sees 'if', it must look one token ahead. If that token doesn't continue this subexpression and the end of the expression isn't reached, then we know for sure that this is the first keyword in a conditional expression. Cheers, </David> David Rosenborg Pantor Engineering AB XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format