Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a valid alternative to ANTLR written in C#? [closed]

Tags:

c#

antlr

ANTLR is a great piece of software, but, in my opinion, is a little bit uncomfortable for a C# programmer (the C# porting is out of date, the parser antlr-3.1.3.jar required java, etc) I'm looking for a "more C# native" language tool in order to parse a simple json-like grammar, any suggestion?

like image 243
o3o Avatar asked Mar 09 '11 07:03

o3o


People also ask

Is ANTLR used in industry?

ANTLR is a powerful parser generator that you can use to read, process, execute, or translate structured text or binary files. It's widely used in academia and industry to build all sorts of languages, tools, and frameworks.

Is ANTLR context-free?

In fact, there are context-free grammars that you can "specify" with ANTLR that it cannot process correctly, which is true of most parser generators. (For ANTLR, this includes grammars with indirect left recursion, ambiguity, arbitrary lookahead, etc.)

Is ANTLR a framework?

Remarks# ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees.


2 Answers

I've used the GOLD Parser Generator, a freeware tool that you can use to specify BNF grammars, and then generate a parser in almost any target language including C#. You can also modify the way the parser generator generates C# code by altering a text template.

http://www.devincook.com/goldparser/

like image 105
Roy Dictus Avatar answered Oct 03 '22 19:10

Roy Dictus


peg-sharp (C# packrat parser) is a simple but valid alternative.

like image 34
o3o Avatar answered Oct 02 '22 19:10

o3o