Questions tagged [compiler-compiler]
17 questions
6
votes
5 answers
What is the fastest parser generator tool for C# output?
I am looking for a parser generator tool which gives C# output and fairly fast. My objective is to parse JSON like text and create CLR object out of it. I used GOLD Parser engine for this but it turned out to be slow for my need. Can anyone please…

Anindya Chatterjee
- 5,824
- 13
- 58
- 82
5
votes
1 answer
Is this grammar not LR(1)?
I'm working on parse generator for PHP. Currently I'm trying to implement canonical LR(1) parser, but it outputs reduce-reduce conflict on following grammar. Is this grammar not LR(1)? Or should I recheck my algorithms?
Grammar in Bison(-like)…

Jakub Kulhan
- 1,572
- 2
- 16
- 37
5
votes
1 answer
What is TinyPG and how does it work?
What is TinyPG and how does it work? I know its a "compiler-compiler" but how do I get started and create my own compiler in C#?

Robin Rodricks
- 110,798
- 141
- 398
- 607
4
votes
1 answer
Generate java classes from DSL grammar file
I'm looking for a way to generate a parser from a grammar file (BNF/BNF-like) that will populate an AST. However, I'm also looking to automatically generate the various AST classes in a way that is developer-readable.
Example:
For the following…

Ran Biron
- 6,317
- 5
- 37
- 67
4
votes
3 answers
grammar compiler compiler for Java
My company is trying to write some software for Android. We would like to work with Java, and there is a component of the company's software that is c++ and so needs to be ported (or at least porting needs to be tried before trying NDK stuff). This…

Nate Glenn
- 6,455
- 8
- 52
- 95
3
votes
1 answer
What parser generator software runs on C#, parses languages with left-recursion and can produce an abstract syntax tree?
I spent the morning figuring out the basics ANTLR to find out it's LL, only. I need to keep left recursion in my grammar so that the syntax tree has left-to-right associativity.
EDIT 2:
Recently I was in need of another parser-generator. While…

Jesus is Lord
- 14,971
- 11
- 66
- 97
2
votes
1 answer
Need help regarding one LALR(1) parsing
I am trying to parse a context-free language, called Context Free Art. I have created its parser in Javascript using a YACC-like JS LALR(1) parser generator JSCC.
Take the example of following CFA (Context Free Art) code. This code is a valid…

AppleGrew
- 9,302
- 24
- 80
- 124
2
votes
1 answer
Use existing languages in BNF with TinyPG?
How can I use these BNF grammars which are in GOLD meta-syntax (RegExp + BNF) with TinyPG? I'm new to BNF so approximately what sort of conversion will I have to do to convert BNF to EBNF?
I believe it should be pretty simple since TinyPG needs…

Robin Rodricks
- 110,798
- 141
- 398
- 607
1
vote
0 answers
Is there an algorithm for a compiler compiler that generates a recursive descent parser?
I have written an LR(1) compiler compiler and to me table generation is pretty straight forward. However today I found myself wondering if there is a general algorithm for generating a recursive decent parser. I know there are tools such as javacc…

Devin Wall
- 180
- 1
- 16
0
votes
0 answers
Parser generator (compiler-compiler) that supports variable keywords and operators for Java?
Are there any parser generators (compiler-compilers) that support varying keywords and operators?
My language has customisable keywords and operators (can have multiple symbols and have letters in them). I bypassed this issue before by mapping…

nickguletskii
- 292
- 4
- 9
0
votes
1 answer
JavaCC Syntax issue with understand ability
I am starting to learn Javacc and trying to figure out this problem but I can't seem to fully understand if I am doing this right or not.
So what I am doing is making a parser for a custom language and generating Java parser source code using…

MNM
- 2,673
- 6
- 38
- 73
0
votes
0 answers
How to minimize DFA having multiple accept nodes?
I have implemented a simple Scanner-Generator, which runs properly in all situations.
It's not a code issue, but a question about how to optimize DFA. Minimization for one Accept Node using the Hopcroft's algorithm and Accept Nodes for accepting the…

rollrat
- 151
- 13
0
votes
3 answers
Bison Shift/Reduce Conflict for a programming language grammar
I'm writing a programming language parser and I'm stuck in this Shift/Reduce Conflict.
Here's the conflict state in the parser.output file obtained via running bison with -v
State 1
24 ident: TIDENT .
26 call: TIDENT . TLPAREN args TRPAREN
…

PoLLeN
- 61
- 7
0
votes
2 answers
Is there any advanced compiler-compiler lexer/parser in C#?
I want to know Is there any compiler-compiler library that is written in C# or Not ?
I know Antlr & JavaCC but these library wrote in Java
Is there any library like antlr but in C# (or ported in C#) and open source or not ?
Can anybody introduce…

HamedFathi
- 3,667
- 5
- 32
- 72
0
votes
3 answers
How to create top-down "tree" construction using bison?
I've found this example, but it creates tree bottoms-up. Is it possible to create tree topdown using bison, flex?
Pseudocode:
block(parent):
{ current = new Block(); parent.addBlock(this); }
BLOCK_BEGIN_TOKEN block_content(current)…

kravemir
- 10,636
- 17
- 64
- 111