Closed lefessan closed 1 year ago
Splitting done :
commons
for general data structures that have uses across the boardsurface
for source language ASTinternal
for intermediary representationgrammar
for source code parsingcompiler
for the compilation pipelineinterpreter
exec
for the CLI executableRemoving explicit errors from the libraries should be a separate issue.
I would advise to split the code in 4 parts:
utils
(already exists)parser
: a library with the AST, a textual parser and a textual printerinterpreter
: a library to execute the AST over dataniagara
: a command-line application to test the compiler/interpreter on source filesImportant parts:
parser
norinterpreter
should contain code that displays textual messages. For example, they could define aerror
type the list all possible errors, instead of raisingfailwith
or similar textual operations. They should also never callexit
, but raise an exception instead.