Hello guys

Hello guys,
I'm proud to announce the alpha release of Parse::Easy. Parse::Easy is a lexer and parser generator for Pascal. Lexer supports regular-expression, Unicode, EBNF, sections, properties, ... And Parser generates either the popular LR1 or the modern GLR algorithm. hope you'll find it useful.

https://github.com/MahdiSafsafi/Parse-Easy
https://github.com/MahdiSafsafi/Parse-Easy

Comments

  1. Great work Mahdi Safsafi. So Parse::Easy is a tool for making Pascal compilers?

    ReplyDelete
  2. Edwin Yip It's a lexer and parser generator like yacc, bison, antlr, ...
    The demos, include a simple scripting language that evaluates expressions and prints them to the console. There is also a JSON parser. Both were built using Parse::Easy.

    Talking about compilers, I got a strong desire to implement my own programming language (the reason why this project was born). When I started working on this project, I wanted it to be able to generate LR(**) but It was very complicated so I just stick with LR(1) and GLR. Now I'm experimenting something and I believe that I may be able to generate LR(**) for the next version.

    ReplyDelete
  3. Mahdi Safsafi Is your utility able to check grammar for collisions (shift-reduce or reduce-reduce)? I see that your parser builder is written in Perl. Do you have plans in future to rewrite the program in Delphi?

    ReplyDelete
  4. T n T The tools generates a verbosity file which can be opened by notepad. You can than search for "conflict" and see what's going on(S/R or R/R). The verbosity is not yet completed and warnings are not recorded ... so for now, you should manually search for conflict word.
    About your second question : porting it to Delphi, well this not a priority for me right now as I'm only focusing on the parser algorithm. In fact, I stopped developing many features just to focus on LR(**). Also, what would be the advantage over Perl beyond the performance ?

    ReplyDelete
  5. It would be logical if the lexer and parser for Delphi were written in Delphi. But OK, you are free to choose the most suitable tool for a task.

    Have you considered using existing formats for writing grammars? For example, the .grm format of GOLD Parsing System. Or are you planning to add some special features for describing grammars?

    ReplyDelete
  6. Rewriting the tool using Delphi will be kind hard since Parse::Easy uses a lot of nullable-types, unicode-database, regular-expressions, and many others features that are not implemented by Delphi.
    About the format, yes for the first time, I was going to use yacc format. than I realized that grammar may become unreadable at some point specially with lexer. So I adopted the ANTLR concept and modified it to feat my needs (like lexer's sections).

    ReplyDelete

Post a Comment