Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^2: Perl Cannot Be Parsed: A Formal Proof

by Anonymous Monk
on Aug 25, 2009 at 04:28 UTC ( #790977=note: print w/ replies, xml ) Need Help??

in reply to Re: Perl Cannot Be Parsed: A Formal Proof
in thread Perl Cannot Be Parsed: A Formal Proof

Correctly parsing a Haskell file requires parsing its dependencies, but it doesn't require running any Haskell code, since infix declarations are quite static.

What it does mean is that to parse Haskell, you need to figure out the imports and infix declarations before actually parsing expressions. That's not very hard to do. You could, for example, initially parse expressions just into either lists of identifiers or rose trees regardless of precedence. Once you have the AST for a source file, it's easy to see the declarations that you need, and then use the information to fix up the expressions based on precedence.

Comment on Re^2: Perl Cannot Be Parsed: A Formal Proof

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://790977]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2015-11-28 09:23 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (740 votes), past polls