Donnie Programming Environment

Introduction

The Donnie Programming Environment is guided by a programming language called GoDonnie. This language was created with the purpose of being easy and less visual, motivating people with visual impairment to pursue a career in the area of programming and technology. The GoDonnie language commands a robot called Donnie, which can be programmed to describe the environment around him and thus help the person with visual impairment to better understand the place where they are.

GoDonnie Programming Language

GoDonnie is a programming language that commands a robot called Donnie. This robot works in its own environment. The GoDonnie User Manual can be found in the Donnie User Manual.

GoDonnie Interpreter

The GoDonnie.cpp is GoDonnie’s main file.
  1. It parses GoDonnie’s command line arguments. Type GoDonnie –h
  2. If GoDonnie is run in terminal mode, it gets the terminal’s commands using readline library
  3. If GoDonnie is run in batch mode, it reads the entire GoDonnie file
  4. Despite the mode (terminal or batch) to call the parser with the command ‘Compiler.parseGD’
The Compiler.cpp class implements the GoDonnie’s programming language parser
  1. The ‘parseGD’ method creates the lexer and parser tree for the incoming string in the GoDonnie programming language format
  2. This file includes the files “GoDonnieLexer.h” “GoDonnieParser.h”, which are automatically generated by Antlr, based on the file GoDonnie.g
  3. If the parsing is successful, then it runs its commands with the method ‘run’
  4. The ‘run’ method executes each command in the parse tree. This method is a big switch used to select the current token to be executed.
  5. For most of the GoDonnie’s instruction call command in the Donnie attribute of the ExprTreeEvaluator class. This attribute implements the DonnieClient class, with all command GoDonnie can execute. DonnieClient does the interface between the parser and Player.
The GoDonnie.g file implements the rules of the GoDonnie language
  1. The initial part of this file, before the rule ‘start_rule’ is just a resource made to change the ANTLR default error message such that these messages are more user-friendly
  2. After the rule ‘start_rule’, it is the language definition itself. All tokens and grammar are defined here.

The DonnieClient.cpp file implements the interface with Player middleware. It’s method implements all actions that Donnie can execute via Player. The list of commands include:

  1. moveForward, moveBackward, GetPos, Scan, GetRange, Speak, Color, Goto, among others

The Exception, Historic, and DonnieMemory are auxiliary files with secondary functions