I am working on a new computer language, and have written a first cut recursive descent transpiler (converting from the new language into AS3 and JavaScript), but need someone to redo the compiler using top down operator precedence (as presented in thelectures by Douglas Crockford), using the Pratt method, which is a fusion of left-right precedence parsing and top down recursive descent. It would be a lot faster than the backtracking that is currently in my compiler. If you know what this all means,
Currently using the ADW modula-2 compiler on Windows, but have a very nice cross-platform low level library that has a version for the P1 compiler.
Will pay commensurate with skill and quality of output.
i have an EBNF grammar for the language; it is an indented language like Python. It isn't that hard to parse, about the same size grammar as
Swift. After watching the Crockford video on youtube about the simplicity and speed of the Pratt methodology, it is clear that the compiler will be much faster with less backtracking if it uses that approach. A real
sticking point in my first cut compiler which was purely recursive descent
is that error recovery is very hard to do in recursive descent, and a huge amount of extra code exists to exit out of deeply nested function calls.
This was always a weak spot in the Wirth code examples which i learned
from.
A real
sticking point in my first cut compiler which was purely recursive descent is that error recovery is very hard to do in recursive descent, and a huge amount of extra code exists to exit out of deeply nested function calls. This was always a weak spot in the Wirth code examples which i learned
from.
I am working on a new computer language, and have written a first cut recursive descent transpiler (converting from the new language into AS3 and JavaScript), but need someone to redo the compiler using top down operator precedence (as presented in thelectures by Douglas Crockford), using the Pratt method, which is a fusion of left-right precedence parsing and top down recursive descent. It would be a lot faster than the backtracking that is currently in my compiler. If you know what this all means,
i have an EBNF grammar for the language;
it is clear that the compiler will be much faster with less backtracking if it uses that approach.
A real sticking point in my first cut compiler which was purely recursive descent is that error recovery is very hard to do in recursive descent,
and a huge amount of extra code exists to exit out of deeply nested function calls.
This was always a weak spot in the Wirth code examples which i learned from.
This was always a weak spot in the Wirth code examples which i learned from.
Wirth never taught error recovery. His examples were meant to
illustrate the general process of recursive descent, not its error
recovery. You may want to read other authors who actually cover error recovery. For example Dick Grune.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 468 |
Nodes: | 16 (2 / 14) |
Uptime: | 20:36:44 |
Calls: | 9,440 |
Calls today: | 3 |
Files: | 13,594 |
Messages: | 6,109,945 |