alex Questions
2
Solved
I'm making a parser for a DSL in Haskell using Alex + Happy.
My DSL uses dice rolls as part of the possible expressions.
Sometimes I have an expression that I want to parse that looks like:
[some c...
1
I can not figure out the correct RegEx to use for parsing a text file and identifying paragraphs.
What I currently have:
[\n\n]+
Sample Text:
Das Pensionat Klinger war bereits etwas zusamm...
1
Solved
I'm writing a toy language in haskell. I'm using Alex to generate a scanner. Every time I build my project with cabal, I get the following warnings:
dist/build/optimiser/optimiser-tmp/Lexer.hs:465...
1
Solved
The source tree for happy contains AttrGrammarParser.ly and Parser.ly and the source tree for alex contains Scan.x. Yet, as far as I can tell in order to compile happy, we need to transform the .ly...
Neper asked 4/2, 2015 at 2:55
1
I'm learning to use Alex and Happy to write a small compiler. I want to maintain line and column information for my AST nodes so that I can provide meaningful error messages to the user. To illustr...
Decompound asked 15/12, 2013 at 1:39
1
Solved
When creating either a Lexer.x or a Parser.y parser using the Alex lexer generator or the Happy parser generator, compiling those into Haskell files, and compiling those into object files, by defau...
Kopp asked 5/8, 2013 at 13:57
1
Solved
In my current project I have a file Tokens.x that needs to be compiled to Tokens.hs by Alex. In my .cabal file I have listed Tokens in the other-modules section and cabal build happily creates the ...
1
Solved
I'm trying to learn using Alex + Happy to build parser, in particular I'm interested in learning to use the monad wrapper of Alex. I have already looked at the documentation of Alex and Happy but I...
2
Solved
I'm writing a compiler for a class I'm taking. The class isn't specifically Haskell but I'm using Haskell to write my compiler and interpreter. I have a cabal package setup to hopefully make it eas...
1
Solved
I'm working on a small Haskell project that needs to be able to lex a very small subset of strictly formed English in to tokens for semantic parsing. It's a very naïve natural language interface to...
Strength asked 7/2, 2013 at 21:1
1
Solved
I'm trying to understand Alex and lexers in general but I'm having trouble to run my lexer.
I wrote lexers in "basic" and "posn" wrappers but I couldn't in "monad" wrapper. I think I have to use m...
2
Solved
Mixing the lexer and parsing phases in one phase sometimes makes Parsec parsers less readable but also slows them down. One solution is to use Alex as a tokenizer and then Parsec as a parser of the...
1
© 2022 - 2024 — McMap. All rights reserved.