parser-generator

How do I build a LR state machine parser?

I'm wanting to play around with creating an LR parser generators. Does anyone know of a good (free) resource describing how to create a state machine table from a grammar? ...

What parser generator do you recommend

I'm currently shopping for a FOSS parser generator for a project of mine. It has to support either C or C++. I've looked at bison/flex and at boost::spirit. I went from writing my own to spirit to bison to spirit to bison to spirit, each time hit by some feature I found unpleasant. The thing I hate most about bison/flex is that they a...

What are the disadvantages of the Spirit parser-generator framework from boost.org?

In several questions I've seen recommendations for the Spirit parser-generator framework from boost.org, but then in the comments there is grumbling from people using Spirit who are not happy. Will those people please stand forth and explain to the rest of us what are the drawbacks or downsides to using Spirit? ...

How to use parsers like lex or yacc in c++

Hi, I want to parse the strings, so that to check whether they have specified syntax or not. Ex: Str = Z344-R565l t Here my requirement is after z there should be a number and after that a "-" and after that R should be there followed by a number, followed by "l", followed by a space and then finally "t". If any thing other than this ...

How can I parse code to build a compiler in Java?

Hey, I need to write a compiler. It's homework at the univ. The teacher told us that we can use any API we want to do the parsing of the code, as long as it is a good one. That way we can focus more on the JVM we will generate. So yes, I'll write a compiler in Java to generate Java. Do you know any good API for this? Should I use reg...

Parser, Generator for Java with the following requirements...

I am looking for a parser generator for Java that does the following: My language project is pretty simple and only contains a small set of tokens. Output in pure READABLE Java code so that I can modify it (this why I wouldn't use ANTLR) Mature library, that will run and work with at least Java 1.4 I have looked at the following and t...

What is the most widely used parser generator for C#?

I'm looking for anyone with some experience using a parser generator that is either design for or has C# available as a target language. What seems to be the standard? Some of the options I have found: ANTLR - Seems widely used, yet people often complain it is "over complicated" or "strange". Coco/R - Another common one I have run i...

Help me find an appropriate ruby/python parser generator

The first parser generator I've worked with was Parse::RecDescent, and the guides/tutorials available for it were great, but the most useful feature it has was it's debugging tools, specifically the tracing capabilities ( activated by setting $RD_TRACE to 1 ). I am looking for a parser generator that can help you debug it's rules. The t...

How can I build a Truth Table Generator?

I'm looking to write a Truth Table Generator as a personal project. There are several web-based online ones here and here. (Example screenshot of an existing Truth Table Generator) I have the following questions: How should I go about parsing expressions like: ((P => Q) & (Q => R)) => (P => R) Should I use a parser generator like A...

When to use parser-generator, when is regex is enough?

I have not gotten into the field of formal languages in computer science yet, so maybe my question is silly. I am writing a simple NMEA parser in C++, and I have to choose: My first idea was to build a simple finite state machine manually, but then I thought that maybe I could do it with less work, even more efficiently. I used regula...

What is a good C# compiler-compiler/parser generator?

I'm looking for a parser generator that given an EBNF for a LL(k) language will give me a C# parser and generate classes the types defined in the EBNF. ...

Parser generator for Delphi?

Can anyone recommend a parser generator that will produce win32 Delphi code? What I'm trying to do is create a simple Domain-Specific Language. ...

Online resources for writing a parser-generator

I want to write a parser-generator for educational purposes, and was wondering if there are some nice online resources or tutorials that explain how to write one. Something on the lines of "Let's Build a Compiler" by Jack Crenshaw. I want to write the parser generator for LR(1) grammar. I have a decent understanding of the theory behin...

How do I parse indents and dedents with pyparsing?

Here is a subset of the Python grammar: single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE stmt: simple_stmt | compound_stmt simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE small_stmt: pass_stmt pass_stmt: 'pass' compound_stmt: if_stmt if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] suite: s...

Multiple flex/bison parsers

Hello, which is the best way to handle multiple flex/bison parsers inside a project? I wrote a parser and now I need a second one in the same project. So far in the third section of parser1.y I inserted the main(..) method and called yyparse from there. What I want to obtain is having two different parsers (parser1.y and parser2.y) and ...

JavaCC Problem - Generated code doesn't find all parse errors

Just started with JavaCC. But I have a strange behaviour with it. I want to verify input int the form of tokens (letters and numbers) wich are concatenated with signs (+, -, /) and wich can contain parenthesis. I hope that was understandable :) In the main method is a string, which should produce an error, because it has one opening but...

Advice on Python Parser Generators

Hey guys, this is my first question here on Stack Overflow and I was wondering if I could ask the advice of people who know a bit more about Python and Parser Generators than I do. I've been given a task where I have to create a parser for a simple C-like language. I can use any programming language and tools I wish to create the parser...

ANTLR parser hanging at proxy.handshake call

I am attempting to get a basic ECMAScript parser working, and found a complete ANTLR grammar for ECMAScript 3, which appears to compile ok and produces the appropriate Lexer/Parser/Walker Java files. (Running inside ANTLR IDE plugin for Eclipse 3.5) However, when actually trying to use it with some simple test code (following guide on A...

parsing recursive structures in scala

I'm trying to contruct a parser in scala which can parse simple SQL-like strings. I've got the basics working and can parse something like: select id from users where name = "peter" and age = 30 order by lastname But now I wondered how to parse nested and classes, i.e. select name from users where name = "peter" and (age = 29 or age ...

Limitations of PEG grammar & parser generators?

I was enjoying using YARD a lot: http://www.ootl.org/yard/ http://code.google.com/p/yardparser/ http://www.codeproject.com/KB/recipes/yard-tokenizer.aspx I was able to construct fully functional calculator. I'm evaluating YARD to do PHP parser. Please kindly advise on limitations of PEG grammar & parser generators. Thank you very muc...