|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
Parsing HaskellHi all,
I was hoping to use Language.Haskell.Parser to parse fragments of Haskell code. However, it appears that one can only use this module to parse complete Haskell programs. Is there anyway around this, or must I write a Haskell parser from scratch? Eric M. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@... http://www.haskell.org/mailman/listinfo/haskell-cafe |
|
|
Re: Parsing HaskellYou need a bottom-up parser to do fragment parsing. I'm not sure one exists for Haskell. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net | 877-376-2724 x 101 On Nov 6, 2009, at 7:49 AM, Eric Macaulay wrote: > Hi all, > > I was hoping to use Language.Haskell.Parser to parse fragments of > Haskell code. However, it appears that one can only use this module > to parse complete Haskell programs. Is there anyway around this, or > must I write a Haskell parser from scratch? > > Eric M. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@... > http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@... http://www.haskell.org/mailman/listinfo/haskell-cafe |
|
|
Re: Parsing HaskellOn 06/11/2009 15:17, John A. De Goes wrote:
> > You need a bottom-up parser to do fragment parsing. I'm not sure one > exists for Haskell. In Happy you can define multiple entry points to a grammar, which is how GHCi parses statements using the same parser that is used to parse complete modules. You'd have to modify the parser in haskell-src(-exts) to do add the entry points, though. Cheers, Simon _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@... http://www.haskell.org/mailman/listinfo/haskell-cafe |
|
|
Re: Re: Parsing Haskell> You'd have to modify the parser in haskell-src(-exts) to do add the entry
> points, though. Actually haskell-src-exts already defines entry points for Module, Stmt, Exp, Pat and Type (as well as [Module] in 1.3.x). Not sure if this message reaches the original poster though. Cheers, /Niklas _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@... http://www.haskell.org/mailman/listinfo/haskell-cafe |
|
|
Re: Parsing HaskellThe UHC compiler contains a combinator based Haskell parser from which
you can borrow fragments, Doaitse Swierstra On 6 nov 2009, at 15:49, Eric Macaulay wrote: > Hi all, > > I was hoping to use Language.Haskell.Parser to parse fragments of > Haskell code. However, it appears that one can only use this module > to parse complete Haskell programs. Is there anyway around this, or > must I write a Haskell parser from scratch? > > Eric M. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@... > http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@... http://www.haskell.org/mailman/listinfo/haskell-cafe |
|
|
Re: Parsing HaskellThanks, I'll check it out.
At 22:03 06/11/2009, S. Doaitse Swierstra wrote: >The UHC compiler contains a combinator based Haskell parser from which >you can borrow fragments, > > Doaitse Swierstra > > >On 6 nov 2009, at 15:49, Eric Macaulay wrote: > >>Hi all, >> >>I was hoping to use Language.Haskell.Parser to parse fragments of >>Haskell code. However, it appears that one can only use this module >>to parse complete Haskell programs. Is there anyway around this, or >>must I write a Haskell parser from scratch? >> >>Eric M. >> >>_______________________________________________ >>Haskell-Cafe mailing list >>Haskell-Cafe@... >>http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@... http://www.haskell.org/mailman/listinfo/haskell-cafe |
|
|
|
|
|
Re: Parsing Haskell> The UHC compiler contains a combinator based Haskell parser from
> which you can borrow fragments, ... and the nhc98/yhc compiler likewise has a combinator parser for full Haskell'98 (the combinators are in applicative style). Regards, Malcolm _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@... http://www.haskell.org/mailman/listinfo/haskell-cafe |
| Free embeddable forum powered by Nabble | Forum Help |