Which code-sharing and language-extension parsers would you recommend?

I am looking for a contextless parser generator with grammar / code separation and the ability to add support for new target languages. For example, if I want a parser in Pascal, I can write my own Pascal code generator without overriding it all.

I understand that most open source parser generators can be theoretically expanded, but I would prefer something that was planned and documented.

In truth, I need a parser to at least support Python-style indentation, perhaps with some extra work. No parser type requirement is generated, but I would prefer something fast.

What are the most famous / supported options?

The popular parser generator seems to mainly use a mixed grammar / code approach that I really don't like. The comparison list on Wikipedia lists a few, but I am new to this and cannot say what to try.

Why I don't like mixing grammar / code: because this approach seems messy. Grammar is grammar, implementation details are implementation details. These are different things written in different languages, it is intuitive to keep them in different places.

What if I want to reuse parts of the grammar in another project with different implementation details? What if I want to compile the parser in another language? All this requires saving the grammar separately.

+3
2

- . (LL (1), LL (k), LL (*), LALR (1), LR (k),...). , , ( , ,...). , (), GLR ( ) PEG ( , , , , ).

, , , .

, , , - . "" , "" .

- ( ) , . , " ", , , . , , . , , , , .

- . . , , ( , 20 ) - , DMS Software Reengineering Toolkit. [DMS - ; GLR; , Python].

, , ; , . : ? , CST.

DMS , . , , ( , , ...), . DMS " " :

  • ( , ). , ( ), (- ). .

  • DMS , , .

  • DMS ( ) . , , . , , (, ) . ( ) , . , (, ) , , , , .

( ), , . DMS ( ) C, ++, Java, #, IBM Enterprise COBOL, Python, F77/F90/F95 6/F90 C ), , PHP4/5 .

+3

-, , Python. , . , Fortran77, ...

-, , , ""? , lex , , ? , .

-, , , . , ( ) ?

, , , . Boost Spirit, ++. , . , , "", , -, .

, , OpenToken, , Ada. Ada error-novel, ++ , OpenToken . Ada...

, ( ) , , lambdas . , , . , . , .

+1

All Articles