List of automatic syntax analyzer generation tools

Source: Internet
Author: User
Tags silverlight

 

I recently planned to redo a previously unfortunate job. One of the small tasks was to write a simple SQL syntax analyzer.

My undergraduate course "compilation principles" rarely leaves some images in my mind. In the original course, I wrote a compiler called dicuf (which seems to sound like this). Under the spur of an evil Ta, we used Lex and YACC to successfully escape from the terror. Now we have to pick up compilation again, which is still somewhat challenging.

It is a good thing. On the Internet, I went around and learned about some of the grammar analyzer's automatic generation tools. It is summarized as follows for reference.

  • Lex/YACC

It was born in UNIX and is the most classic lexical/syntax analyzer. Currently, it also supports the generation (installation environment) on Windows. However, the language of the generated syntax analyzer is only C language.

  • Flex/Bison

Similar to the former, Bison and YACC have high compatibility. The generation languages are C, C ++, and Java.

  • Coco/R

An earlier syntax analyzer generation tool. The syntax analyzer has many languages, including C #, Java, C ++, F #, VB. NET, and Oberon.

  • Anlr

As part of a translation program, you can use simple operators and actions to parameterize Your syntax, so that you can tell anlr how to create an abstract syntax tree (AST) and how to generate output. Anlr knows how to generate recognition programs. The language used to generate the syntax analyzer includes Java, C ++, and C #. syntax.

  • Gold

It is a complex analyzer with the most Supported languages. The generation languages include Assembly-intel X86, ansi c, C #, D, Delphi, Java, Pascal, Python, Visual Basic, and Visual Basic. net, Visual C ++, all.. NET language and all ActiveX languages. It is hard to imagine that this is a free software.

  • Grammatica

This is a C # and Java syntax Parser Generator (parser generator or compiler called compiler complier ). Compared with other similar tools such as YACC and anlr, it provides better improvements. This is because grammatica:
1. created better comments and readable source code.
2. Automatic Error Recovery and detailed error information are available.
3. Supports syntax/Lexical testing and debugging.

  • Javacc

It is one of the most popular syntax analysis generators developed in Java. It also provides tools such as jtree to help us build a syntax tree. It also has an Eclipse plug-in used to assist javacc application development. The syntax analyzer language generated is Java.

There are also many syntax analyzer generation tools, such as jflex, sablec, beaver, jtopas, runcc, cup, sjpt, and chapeon. But I did not have the energy to introduce them one by one. I did not expect this tool to be so numerous.
  

Finally, I chose grammatica because I need a C # syntax analyzer and the requirements are simple enough :)
I used an example of grammatica to generate a C # syntax analyzer and port it to the Silverlight Project (as required by another project), which is currently running well. Because. NET is very similar to Silverlight. net, this porting job is easier than imagined. However, I do not agree to put the syntax analyzer on the web, which will significantly increase the client. One way to consider is to encapsulate the syntax analyzer used to verify the function into a web service and put it on the server.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.