RobotStudio: Teaching Language Engineering and Compilers Using Robots



Introduction

RobotStudio is an NSF CCLI program funded project to develop a modular IDE-based approach for teaching language engineering and compilers using embedded personal robots as system targets. The teaching approach has been used at the University of Massachusetts Lowell to teach undergraduate compiler construction course and the language processing module in an undergraduate programming course. This site includes the Chirp language specification, reference compiler implementation for embedded robot targets, teaching materials and resources developed from the RobotStudio project.

The RobotStudio Approach to Language Engineering and Compilers

RobotStudio is a modular IDE platform leveraging Eclipse RCP and targets the Chirp language and personal robot devices. It runs as a stand-alone Eclipse RCP application and provides an IDE (Integrated Development Environment) to develop robot design and programming projects. The Chirp language is a small C-like imperative language to program embedded robot controllers. Chirp has simplified data types and control constructs to support typical data representations and control logic of the embedded robot devices and encapsulates specialized hardware I/O operations, such as sensor and motor control, through intrinsic system functions which will be compiled directly to target instruction sequence. Currently, the Chirp language includes support for the Fred Martin's HandyCricket controller and the BasicStamp controller for the Parallax Scribbler robot. Support for the LEGO Mindstorms NXT robot is under development.

Using Chirp, embedded robots and RobotStudio compiler and IDE, we have designed compiler and language engineering curriculum contents for use in two types of undergraduate language processing and compiler courses:

  1. as language engineering module hosted in undergraduate programming course to teach basics of language translation basics and compiler generation tools;
  2. full-length compiler construction course including topics of lexing, parsing, semantics analysis, intermediate representation, code generation and compiler optimization.

Chirp Language Specification

To program embedded robot controllers, we designed the Chirp language. Chirp has a simplified language feature set targeting microcontrollers used in embedded robot devices. It includes common constructs of data types and control flow, the target specific sensor and motor control operations are represented using intrinsic System functions. For each target platform, the System function set will define the supported System function interfaces available for that platform and the compiler will translate them directly into instruction sequence that implements the System interface abstraction.

The following are the Chirp specifications for using the Cricket and Scribbler robots.

Code Generation for Robot Controllers

Chirp compiler translates the Chirp source program into intermediate representation (IR) form. The reference compilers and students projects have used both the high-level abstract syntax trees and low-level 3-address linear IR form. The code generator converts the IR form to generate target code. The following pages describe the code generation for the Cricket target and Scribbler robot and the ChirpIL low-level IR for use in the compiler construction class.

Features of RobotStudio

Like other modern IDE, RobotStudio integrates a comprehensive programming environment for personal robot (such as Cricket robots) based projects. It provides the following:

The following is a screen shot of RobotStudio IDE.

rs_screen_shot

Archives of Teaching Materials

  1. Spring 2008 91.204 OO Programming class at UMass Lowell
  2. Fall 2008 91.406/534 Compiler Construction class at UMass Lowell
  3. Spring 2009 91.204 OO Programming class at UMass Lowell

Student Evaluation Instruments

The following are the survey instruments used in the course evaluation.

Software Download

References

The following are related papers to the projects:

Acknowledgements

The materials developed here are supported by the NSF CCLI Award #0737054, and by the University of Massachusetts Lowell.


Li Xu, CS, UMASS Lowell