Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grammar Writing Tools [closed]

I am trying to write a grammar in EBNF (barring a really good reason, it has to be EBNF) and am looking for a couple of utilities for it - if there's a GUI interface that can make one, that would be great, but the thing I'm looking for most is something that can check the grammar, for instance to see if it is LALR(n), and if so, what the value of n is. Do such utilities exist? Are there any other useful grammar-writing tools I should know about (I'm not looking for parser generators).

like image 472
coppro Avatar asked Nov 05 '08 03:11

coppro


People also ask

What is the most popular grammar checker?

Grammarly We've put Grammarly as the best grammar checker for many reasons. First of all, it is the most widely used grammar checker on the internet with 20 million people using the online grammar checker. This spot is also achieved thanks to its compatibility with all popular internet browsers and Microsoft Office.

Is there a site that can check my grammar?

Grammarly has a tool for just about every kind of writing you do. The online grammar checker is perfect for users who need a quick check for their text.

Which app is best to check grammar mistakes?

Grammarly. Grammarly is probably the most well-known grammar checker app – and with good reason. With both an online and desktop-integrated option, you can choose a way to use Grammarly that suits you best.


1 Answers

Use TinyPG! Its an amazing all-in-one compiler compiler with a lightweight GUI, where you build your parser with RegEx, EBNF, and write C#/VB code to do something with the parse tree!

Here's a short and informative summary that I did earlier, which also links you to the downloads.


My understandings of TinyPG:

TinyPG allows you to write & develop:

  • Define Terminals using Regular Expressions.
  • Define Non-terminals and parser rules in Extended BNF meta-syntax.
  • Write Compiler code in C# or VB, within TinyPG.

It has an in-built IDE, Windows Only (created in C#.NET, open source).

It allows you to try out & preview Regular Expressions using the inbuilt RegEx tool. RegEx syntax is supported in .NET which means that even your outputted parser code uses .NET's Regular Expressions.

You write EBNF to describe the language of your choice (Here are some freely available BNF Grammers that describe modern programming languages (C, Java, JavaScript, C#, VB.NET, SQL-89)

Using TinyPG, your RegEx along with your EBNF outputs a parse-tree (see this diagram).

Now what do you do with the parse-tree? You write C#/VB code (within TinyPG, per BNF grammer rule) for your Compiler/Interpreter/Translator. (inside TinyPG, open the "simple expression2.tpg" file within the provided Samples to see a demo of a calculator 'compiler')

TinyPG allows you to Compile and Test your tokenizer+parser+complier, within the TinyPG IDE, and it finally outputs the parser source code in C#.NET or VB.NET (your choice), with ready-to-use classes.

An excellent All-in-one Compiler Compiler for the masses. Enjoy!

PS: Correct me if I'm wrong on any of this.

like image 75
Robin Rodricks Avatar answered Sep 21 '22 06:09

Robin Rodricks