parser-generator

Parsing a custom string-generating-pattern syntax

Background: I'm developing a custom regex-like syntax for URL filenames. It will work like this: User writes a pattern, something like "[a-z][0-9]{0,2}", and passes it as input It is parsed by the program and translated into the set of permutations it represents i.e. 'a', 'a0', 'a00' ... 'z99' These patterns will vary in complexity, ...

Language Parser in Silverilght

I need to write parser for some specific language (subset of SQL). As I know, the easiest way to do this is to define grammar in BNF and use yacc-like tool (I have positive experience with GPPG). But when I started, I've realized that these tools produce parser with dependency on some core parser assemblies (e.g. ShiftReduceParser.dll fo...

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) notation: syntax : toplevels rules ; toplevels : toplevel | toplevel toplevels ;...

Any BNF IDE with test features

I'm working on a new language and while writting the grammar I'd like to be able to test the grammar for completeness, conflicts and similar. I'm not really concern about the underlaying parser generator (but one for .NET would be preferrable) So feature list in short would be: text editor build functionality syntax/sematics error rep...

Lex and Yacc in PHP

Is there an implementation of Lex and Yacc in PHP? If not, can anyone suggest a lexical analyser and parser generator (ie, anything like Lex and Yacc) that will create PHP code. I'm not too worried about the performance of the resulting parser. I am sick of using regex to parse things that really shouldn't be parsed with regex... ...

GLR parsing algorithm resources

Hi, I am writing a GLR parser generator and would like some advice on resources relating to this algorithm both on the internet and of the dead-tree variety (books for those unfamiliar with the geek-speak). I know Bison can generate GLR parsers, and given it's under the GPL I can examine its code, however it'd be nice to have a full des...

Scannerless Parser Generators

Prologue: Although the set of languages recognized by parsers (context-free grammars) is strictly larger than the one of scanners (regular grammars), most parser generators need a scanner. (Please don't try to explain the reasons behind it, I know them quite well). I've seen parsers, that do not require a scanner like Elkhound (optio...

Parser Generator for changing file.

Hi, are there any Parser Generator which generated parsers are capable of the following: Parse a file and if you change line n then it only reparses the line or the lines which changed because of this. So that the parser don't need to reparse the full file. Greets, Mathias ...

Open source machine readable grammar for HTTP/1.1?

Is there an open source machine-readable grammar for HTTP/1.1 requests and responses? Specifically, i'm looking for a grammar that is accepted by one of the popular parser generators (e.g., ANTLR, CUP, BNFC, ...). ...

Source of parsers for programming languages?

I'm dusting off an old project of mine which calculates a number of simple metrics about large software projects. One of the metrics is the length of files/classes/methods. Currently my code "guesses" where class/method boundaries are based on a very crude algorithm (traverse the file, maintaining a "current depth" and adjusting it whe...

Parser generator for inline documentation

To have a general-purpose documentation system that can extract inline documentation of multiple languages, a parser for each language is needed. A parser generator (which actually doesn't have to be that complete or efficient) is thus needed. http://antlr.org/ is a nice parser generator that already has a number of grammars for popular...

JavaCC for .NET?

Hi Guys, I've been spending some time doing JavaCC parser generation for assignments at University and was wondering if there is a similar simple parser generator framework for .NET available? I know there is ANTLR, but I found it a bit too big for my taste and really started to like the simplicity that JavaCC brings.. greetings Danie...

Any BPEL parser and XML generator together?

hi all, I want to generate/write and then parse (write & read) the bpel process (xml). Is there any way api to this, something like wsdl4j... ? thx adnan ...

AST with fixed nodes instead of error nodes in antlr

I have an antlr generated Java parser that uses the C target and it works quite well. The problem is I also want it to parse erroneous code and produce a meaningful AST. If I feed it a minimal Java class with one import after which a semicolon is missing it produces two "Tree Error Node" objects where the "import" token and the tokens fo...

Recognizing terminals in a CFG production previously not defined as tokens.

I'm making a generator of LL(1) parsers, my input is a CoCo/R language specification. I've already got a Scanner generator for that input. Suppose I've got the following specification: COMPILER 1 CHARACTERS digit="0123456789". TOKENS number = digit{digit}. decnumber = digit{digit}"."digit{digit}. PRODUCTIONS Expression = Term{"+"...

Which is the best counterpart to ANTLR to create parsers in ruby?

Hi there, I've used antlr and javacc/freecc for a while. Now I need to write a bunch of parsers using antlr grammars but such parsers need to be written in ruby lang. I googled but nothing found. Is there any ruby parser generator that takes antlr grammars and create a parser? If there are many, which is the best one in your opinion? T...

How do we keep multiple semantic values during parsing with Happy/Haskell

Hi, I'm trying to build a simple lexer/parser with Alex/Happy in Haskell, and I would like to keep some localisation information from the text file into my final AST. I managed to build a lexer using Alex that build a list of Tokens with localisation: data Token = Token AlexPosn Foo Bar lexer :: String -> [Token] in my Happy file, w...

LALR Parser Generator Implementation Problem

Hi everyone! I'm currently trying to implement a LALR parser generator as described in "compilers principles techniques and tools" (also called "dragon book"). A lot already works. The parser generator is currently able to generate the full goto-graph. Example Grammar: S' --> S S --> C C ...

Parsing latex-like language in Java

I'm trying to write a parser in Java for a simple language similar to Latex, i.e. it contains lots of unstructured text with a couple of \commands[with]{some}{parameters} in between. Escape sequences like \\ also have to be taken into account. I've tried to generate a parser for that with JavaCC, but it looks as if compiler-compilers li...

how to parse javascript file?

Hi All , I need to parse JavaScript content , I am reading this content from a file now I need to identify the events associated with the JavaScript objects. Can someone tell me possible approach to achieve that. Thanks in Advance. Vinay ...