openroberta-lab
openroberta-lab copied to clipboard
ev3 code generation too weak - general problem with workers/visitors
the following ev3 program crashes:
ev3-advanced-lists-too-complex.txt
reason:
-
the type derived in the code generator is
capturedand notintas expected. -
this shows that the expression is too complex for out code generator and
-
that type inferencing is needed for complex expressions
-
btw: the generated code cannot be compiled due to an type error
-
if this is compensated in
Ev3Visitor#visitListSetIndexe.g. it becomes obvious, that the workerAbstractLanguageGeneratorWorkerexpects error-free results and sets the result to success in any case. -
making this worker error-aware crashes arduino tests, that rely on that wrong behavior.
todo:
- the way worker and visitors interact has to be refactored soon.
- error handling has to be easy and consistent.
- a type inferencer has to store the inferred type into each phrase, so that this can be used in code generation (the first two topics are much more urgent)
related to #306