Who is faster: PEG or GLR?

I am trying to create some kind of tool lintfor the C / AL programming language . So basically I need to do the syntax and lexical analysis on the source code. I planned to write a parser from scratch, but then I discovered that there are many tools that help generate these parsers automatically.

I need performance, since checking 20 megabytes of code in one piece is a normal scenario, and I need this tool to expand according to special rules. So I decided to go with JavaScript.

How I found two oscillators, I can use Jison and PEG.js .

Which ones give me more parsing performance? Maybe not compare libraries, but algorithms?

Which one is better for my needs (parsing a general-purpose programming language)?

UPDATE: I found similar Q & As:

+5
source share
3 answers

In general, you will get very good syntax performance from a parser with shift reduction, such as the one used by Jison. It may be a little old school, but it can work in very strict memory requirements and in linear time.

PEG , , , , . PEG , , LALR ( ).

+7

" ( 20 )... Javascript". .

, . , LALR (1) ( Bison ..) . ( , , LALR ; , ).

, LRStar. ( , ). LALR. : LALR . "" , C: C. JavaScript IMHO, , , , , .

GLR , LALR, . . (, 100x) LRStar. , , , , . 1 MSLOC, .

PEG - . , . , LALR, , . .

, , , . ; . . Life After Parsing .

+5

, Jison PEG.js. ?

JavaScript Parser Libraries, , PEG.js ( , Chrome/V8).

: http://sap.imtqy.com/chevrotain/performance/

, JSON .

+1

All Articles