GPPG is a parser generator that produces parsers written in the C# V2 or higher. The input language is YACC-like, and the parsers are LALR(1), with the usual automatic disambiguations. Designed to work with GPLEX.
Questions tagged [gppg]
8 questions
16
votes
3 answers
Making YACC output an AST (token tree)
Is it possible to make YACC (or I'm my case MPPG) output an Abstract Syntax Tree (AST).
All the stuff I'm reading suggests its simple to make YACC do this, but I'm struggling to see how you know when to move up a node in the tree as your building…

Sprotty
- 5,676
- 3
- 33
- 52
10
votes
6 answers
Shift reduce conflict
I'm having a problem understanding the shift/reduce confict for a grammar that I know has no ambiguity. The case is one of the if else type but it's not the 'dangling else' problem since I have mandatory END clauses delimiting code blocks.
Here is…

Caerbanog
- 1,295
- 1
- 12
- 18
7
votes
5 answers
Parser Generator: How to use GPLEX and GPPG together?
After looking through posts for good C# parser generators, I stumbled across GPLEX and GPPG. I'd like to use GPLEX to generate tokens for GPPG to parse and create a tree (similar to the lex/yacc relationship). However, I can't seem to find an…

Andrew Smith
- 197
- 1
- 2
- 11
5
votes
2 answers
gppg/gplex equivalent in D?
When I was working in C#, I found the gppg and gplex parser/lexer generators to be perfect for my needs. I'm wondering if there's something similar for the D programming language (i.e. a utility that, given a grammar in BNF or EBNF, outputs D code…

Mark LeMoine
- 4,478
- 3
- 31
- 52
2
votes
3 answers
Using C# and gppg, how would I construct an abstract syntax tree?
Is there a way to do this almost out-of-the-box?
I could go and write a big method that would use the collected tokens to figure out which leaves should be put in which branches and in the end populate a TreeNode object, but since gppg already…
Rupert
1
vote
1 answer
GPPG-Grammar - A rule will never used
i've got a problem with my some of my rules of my grammar.
The grammar is like the following:
defLINES : carrRet
| defLine carrRet
| defLines defLine carrRet
;
defLine : error carrRet …

Alex
- 369
- 4
- 16
0
votes
2 answers
Help with Shift/Reduce conflict - Trying to model (X A)* (X B)*
Im trying to model the EBNF expression
("declare" "namespace" ";")* ("declare" "variable" ";")*
I have built up the yacc (Im using MPPG) grammar, which seems to represent this, but it fails to match my test expression.
The test case i'm trying to…

Sprotty
- 5,676
- 3
- 33
- 52
0
votes
1 answer
GPPG (bison) - How to implement an "expression expression" concept
We're using GPPG (essentially bison for C#) to generate a parser for a programming language. Everything is going great except for one really nasty bit. The language we are parsing has a sort of "implicit comparison" rule, where "expression…

LorenVS
- 12,597
- 10
- 47
- 54