Git Product home page Git Product logo

lalrparsergenerator's Introduction

LALRParserGenerator, written by LiBo(me), is a parser generator for a compiler frontend whose grammar is LALR pattern.

It is like yacc/bison and lemon, and including the most features of theirs.

Unlike lemon, In LALRParserGenerator, tokens and non terminal symbols use same type YYSTYPE.

It is a big problem to use the same type for all token type, so LALRParserGenerator changes the situation.

Similar with yacc/bison, but LALRParserGenerator adds some extensions which are like lemon.

In yacc/bison, $N is so evil that the most developers can commit some mistakes because they count the index wrongly.

LALRParserGenerator can use the name of a symbol or its alias to refer the symbol's value.

Lemon doesn't allow a developer to define a start symbol which can occur at the right side. LALRParserGenerator has no such restriction.

LALRParserGenerator provides two kinds of using mode: reentrant mode and non-reentrant mode.

One of reentrant mode is like lemon, but tokens and non terminal symbols use same type YYSTYPE.

Another reentrant mode is like yacc/bison, but you must provide a adaptable function to adapt any lexical scanner of reentrant flex mode or your customized reentrant lexical scanner.

LALRParserGenerator doesn't restrict any lexical scanner's mode that you use as long as you provide a adaptable function whose prototype is written at c code template file or a generated c code.

All examples are provided, which can run corrently.

The usage is like yacc, see these examples to understand everything.

Running method: LALRParserGenerator [-vld] [-b prefix] [-L path] [-y prefix] [-Y prefix] yacc_file_name

-v: Output the trace file
-d: Output the header file
-b: Specify the prefix of output filename
-Y: Specify "Y" prefix used by YYSTYPE and etc.
-y: Specify "y" prefix used by yyunion and etc.
-L: Specify code template files' searching path
-l: Not create #line instructions.

lalrparsergenerator's People

Contributors

libo3019 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.