|
![](/i/fill.gif) |
Orchid XP v8 wrote:
>>> Haskell really is a PITA to parse. I mean, think about it:
>>> - Whitespace is significant. (No context-free parsing here!)
>>
>> I don't think "context-free" means what you think it means. Whitespace
>> being significant isn't "context".
>
> Indentation is significant. To parse the next line, you must know how
> far the current line was indented. Hence, "context".
I don't think "context-free" means what you think it means.
That's like saying Pascal isn't context-free because you need to know how
many "begin" statements you're nested within.
A grammar is context-free if none of the left side of the production have
terminal symbols in them. (That's the technical definition, which takes
several paragraphs to explain in prose.)
> No, they can be used *before* they're defined. And they can be defined
> in a completely seperate source file too. Which makes me wonder how it's
> possible to parse an individual file at all... you'd need to potentially
> parse every module it imports to work out the operator precedences!
Could be! :-) Sounds like a real bear to compile, but then, that's what
computers are for.
--
Darren New, San Diego CA, USA (PST)
"We'd like you to back-port all the changes in 2.0
back to version 1.0."
"We've done that already. We call it 2.0."
Post a reply to this message
|
![](/i/fill.gif) |