You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it comes to bootstrap the new compiler, I do not want to manually translate new compiler source from old L language syntax to new language - there could be tens of thousands of lines.
To avoid doing this, I can use the new compiler to translate new language syntax to old.
New syntax source -> [New compiler] -> Old syntax -> [Old compiler] -> Executable
Provided the new compiler is written in a subset of the new language where the new syntax maps directly onto the old syntax with the same semantics, this can be accomplished with a pretty printer.
Required:
Parser able to recognise a sufficiently large subset of the language to implement the new compiler in
Pretty printer able to accurately output the parse tree in equivalent old syntax
Pretty printer emits #file and #line directives so error reporting is accurate
Alter format of error output from old compiler in line with new, so same VS Code problem match regex will work across both sources of errors
Some kind of compiler driver to run the old compiler on the generated output, and merge error reports in with errors from new parser - shell scripts are probably sufficient
Nice to have:
Some mechanism to avoid changing timestamps on generated files if they're not changed - maybe via hashing of content.
Once this mechanism is in place, hand translate the new compiler to the new syntax, and all new development can be done in the new syntax.
The text was updated successfully, but these errors were encountered:
When it comes to bootstrap the new compiler, I do not want to manually translate new compiler source from old L language syntax to new language - there could be tens of thousands of lines.
To avoid doing this, I can use the new compiler to translate new language syntax to old.
New syntax source -> [New compiler] -> Old syntax -> [Old compiler] -> Executable
Provided the new compiler is written in a subset of the new language where the new syntax maps directly onto the old syntax with the same semantics, this can be accomplished with a pretty printer.
Required:
Nice to have:
Once this mechanism is in place, hand translate the new compiler to the new syntax, and all new development can be done in the new syntax.
The text was updated successfully, but these errors were encountered: