openroberta-lab icon indicating copy to clipboard operation
openroberta-lab copied to clipboard

ev3 code generation too weak - general problem with workers/visitors

Open rbudde opened this issue 5 years ago • 1 comments

the following ev3 program crashes:

ev3-advanced-lists-too-complex.txt

reason:

  • the type derived in the code generator is captured and not int as 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#visitListSetIndex e.g. it becomes obvious, that the worker AbstractLanguageGeneratorWorker expects 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)

rbudde avatar Apr 22 '20 13:04 rbudde

related to #306

rbudde avatar Apr 22 '20 13:04 rbudde