[Haskell-cafe] No newlines in the whitespace for Parsec lexeme
parsers
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Wed Mar 26 07:47:51 EDT 2008
On Mar 26, 2008, at 7:42 , Bulat Ziganshin wrote:
> Wednesday, March 26, 2008, 2:32:53 PM, you wrote:
>> I'm looking to parse a Fortran dialect using Parsec, and was
>
> afair, some months ago BASIC parsing was discussed here.
>
> the first solution one can imagine is to add preprocessing stage
> replacing line ends with ';'-alike
FWIW I just ignored the lexeme parser and did my own on top of the
basic Parsec primitives.
You may need to do that anyway if you want to support older variants
of Fortran, which don't actually have keywords and ignore spaces
outside of string constants (Hollerith constants) --- Parsec's lexeme
stuff doesn't even pretend to support this.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
More information about the Haskell-Cafe
mailing list