I'm currently using happy to parse a language, but I don't think the parser is relevant, except to say it's an LALR parser. Here's a small excerpt from the grammar:
ArithExpr -> ArithExpr + ArithExpr
ArithExpr -> ( ArithExpr )
ArithExpr ->…
I'm running up against a bug in the latest version of Happy (1.19.5). How do I tell stack to go look for an even newer version of Happy (1.19.6) found only at the git repo? Right now, I'm letting stack manage everything; the only reference to Happy…
In a functional language compiler written using the happy parser, which is a quite similar with yacc/bison, I implemented lists and with lists some core functions map, concat and filter, using the following rules:
Exp:
...
| concat '(' Exp ',' Exp…
I have this grammar section in a happy parser, given on the Happy official site, but I need some deeper explanation of the meaning of the rules in brackets. Here is the token definition
%token
let { TokenLet }
in …
Writing a Oberon-like language parser, I'm having troubles compiling the parser after I've updated it to be able to define more procedures on the same level, and not only nested one inside the other.
This is my lexer:
{
module Lexer…
I'm implementing a parser for a language similar to Oberon.
I've successfully written the lexer using Alex since I can see that the list of tokens returned by the lexer is correct.
When I give the tokens list to the parser, it stops at the first…
I have been struggling to remove all s/r conflicts from my parser today. I managed to remove all of them but a single one.
The syntax of my language should be haskell-like. And instead of a main, I have a top level expression which is the…
I'm trying to make a parser using Alex with Happy. I'm following the instructions from this post, but having trouble. I'm trying to track down the source of the following type error:
templates/wrappers.hs:234:9:
Couldn't match type ‘Token’ with…
I would like to parse files with several sequences of data (same number of column, same content, ...) with Haskell.
My data sequences will be delimited by keywords before and after.
BEGIN
1 882
2 809
3 435
4 197
5 229
6 …
I have been dealing with this problem for a couple days and I'm out of ideas, hopefully you can help me:
My token list is the following:
%Token
var {TokenVariableDeclaration}
varId {TokenVar $$} -- Strings like "x", "n" or "m"
int …
Hi I've just updated cabal to the latest version by the command
cabal update
and
cabal install cabal-install
Then it returns
Installed cabal-install-1.22.2.0
Updating documentation index /MyPath
I want to use alex and happy. Sorry I'm very new…
I am trying to create a lexxer and parser for a language and I'm having difficulty understanding the exact syntax when it comes to some more "robust" abstract syntax tree definitions.
The issue in question is :
fun_declaration : FUN ID param_list…
I'm running into a compatibility problem trying to cabal install agda using GHC 7.8.3 and Cabal 1.16.0.2, on Ubuntu 14.04.
The problem appears to be with haskell-src-exts-1.15.0.1, which Agda requires. Compiling that library runs into the following…
I am trying to generate a GLR parser from happy, but I am getting errors once the files are generated.
Here is an example, ABC.y , so it's clear what I am trying:
{
module Main where
}
%name ps1 s1
%tokentype { ABC }
%error { parseError }
%token
a…