OpenRoberta / openroberta-lab

The programming environment »Open Roberta Lab« by Fraunhofer IAIS enables children and adolescents to program robots. A variety of different programming blocks are provided to program motors and sensors of the robot. Open Roberta Lab uses an approach of graphical programming so that beginners can seamlessly start coding. As a cloud-based application, the platform can be used without prior installation of specific software but runs in any popular browser, independent of operating system and device.
Apache License 2.0
124 stars 118 forks source link

Add a EvalExpr block to NEPO. Implement a typecheck visitor. #1582

Open rbudde opened 7 months ago

rbudde commented 7 months ago

A long time ago the ANTLR4 grammar 'Exprly.g4' was defined as a first attemt to realize a textual form of NEPO (as a compagnion to the visual Blockly). This grammar concentrates on the expressions of NEPO.

This can be used in an EvalExpr block, which stores an user-defined textual form of an expression as '3 + 4*(x>5 ? 6 : 4)'. This string can be parsed and translated to an AST (class ExprlyVisitor.java). Then the AST must be typechecked (TypecheckCommonLanguageVisitor.java). After that simlation and code generation should work out-of-the-box.

The classes exist in a preliminary version and must be completed. Then the worker/visitor-architecture must be used to attach the components to all existing plugins. Typechecking should be applied to the complete NEPO program (independent of the visual or textual syntax)

The implementation must be tested (unit + system) rigorously.