Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #1566 > unrolled thread
| Started by | Alexander Morou <alexander.morou@gmail.com> |
|---|---|
| First post | 2015-06-24 01:24 -0500 |
| Last post | 2015-06-24 01:24 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.compilers
OILexer: How Important is Readability? Alexander Morou <alexander.morou@gmail.com> - 2015-06-24 01:24 -0500
| From | Alexander Morou <alexander.morou@gmail.com> |
|---|---|
| Date | 2015-06-24 01:24 -0500 |
| Subject | OILexer: How Important is Readability? |
| Message-ID | <15-06-010@comp.compilers> |
I've been posting about this project for quite some time, and I finally reached the LL(1) stage in OILexer. Using the ambiguity free json language, building a contextual parse tree and a subsequent AST from the annotations in the grammar, it appears to operate at a level of up to 2-6 times faster than ANTLR4 on spin-up, to two thirds the speed of ANTLR4 once ANTLR4 has parsed a file once (I think they call it 'spinning up'.) ANTLR4 was used as a reference because it's the closest thing that I can think of to this project, with the exception that ANTLR4's code is nigh unreadable and no longer generates an AST as of version 4. Mind you these metrics are 'without error handling' so if it's a properly formed input string, it parses correctly, I haven't tested invalid input because I haven't added error handling code. That brings me to my question today: how important is readability in a generated parser? Here is a link to the current generated json parser, you'll note the lack of error handling, but this is currently because my focus is finishing LL predictions: http://abstraction-project.com/text/Oilexer/Json/JsonParser.html For future's sake, the outline of the valid syntax at the states within the parser can be found here (to be used during error reporting): http://abstraction-project.com/text/Oilexer/Json/JsonParser-1.html The individual properties it returns can be clicked to go to their definition. The grammar file relevant to this can be found here: http://abstraction-project.com/text/Oilexer/Json/json.oilexer.html Since I started this project I wanted to try to create code that was as easy to read as possible (since I started this as a parsing newbie). There are some performance concerns that I will address once predictions are finished, but as of right now they're secondary to readability. I don't want to optimize too early because I feel getting it functional should be first. -Allen Clark Copeland, Jr.
Back to top | Article view | comp.compilers
csiph-web