Development of SDR-BASIC: A Translator for the SDR2 Data Recorder

Development of SDR-BASIC: A Translator for the SDR2 Data Recorder

Document information

Author

Simon Dear

instructor P. J. Ashton, Supervisor
School

University of Canterbury

Major Computer Science
Document type Honours Project
Year of publication 1987
Place Canterbury
Language English
Number of pages 57
Format
Size 2.20 MB
  • SDR-BASIC
  • Translator Design
  • Intermediate Language

Summary

I. Introduction

The Development of SDR-BASIC project aims to create a translator for the SDR2 Data Recorder, enabling users to write programs in a BASIC-like language. This initiative addresses the need for surveyors to utilize a familiar programming environment while interacting with the SDR2. The project outlines five primary goals: understanding the SDR2's features, specifying the BASIC-like language, designing the intermediate language, developing the translator, and creating the interpreter. Each goal is crucial for ensuring that the final product meets user requirements and hardware limitations. The SDR2, with its 32k bytes of RAM, stores observations as heap records, which vary in length. This architecture necessitates a language that can efficiently manage memory and provide access to input/output facilities. The project emphasizes the importance of a user-friendly interface, as the SDR2 is not inherently programmable by users. The implementation of SDR-BASIC is a significant step towards enhancing the usability of the SDR2, making it a valuable tool for surveyors.

II. Design of SDR BASIC

The design of SDR-BASIC focuses on providing a useful subset of common BASIC features while reflecting its compiled nature. The language is tailored to meet the needs of surveyors, who are more likely to be familiar with BASIC than other programming languages. Research into existing BASIC dialects reveals a variety of features that can be incorporated into SDR-BASIC. The project aims to retain essential control structures, variable types, and built-in mathematical functions, ensuring that the language is accessible to users. The choice to base SDR-BASIC on Microsoft BASIC allows for a familiar programming experience. Furthermore, the design must accommodate the limitations of the SDR2 hardware, ensuring efficient memory usage and access to internal data structures. The project also addresses the need for error handling and type checking within the translator, which are critical for maintaining the integrity of the programs developed. Overall, the design of SDR-BASIC represents a thoughtful approach to creating a powerful yet user-friendly programming environment.

III. Implementation Challenges

The implementation of the SDR-BASIC Translator presents several challenges that must be addressed to ensure successful operation. Key issues include the design of the symbol table, scanner, and parser, which are essential components of the translation process. The symbol table must efficiently manage variable names and their associated data types, while the scanner is responsible for reading the source code and identifying tokens. The parser plays a critical role in analyzing the structure of the code, ensuring that it adheres to the syntax rules of SDR-BASIC. The project also highlights the importance of error handling and type checking, which are vital for providing feedback to users during program development. The ability to generate intermediate code that accurately reflects the original BASIC-like program is crucial for the functionality of the SDR2. Additionally, the project explores the complexities of porting the Macintosh version of the translator to an IBM PC, emphasizing the need for adaptability in software development. These challenges underscore the technical rigor required in the development of SDR-BASIC.

IV. Future Enhancements

The results section of the project outlines potential enhancements for SDR-BASIC and the translator. Future developments may include adding more BASIC features to broaden the language's capabilities, improving the interface with the SDR2, and refining the translator and interpreter. Enhancements could also focus on optimizing the development environment, making it more intuitive for users. The project recognizes that ongoing improvements are essential for maintaining relevance in a rapidly evolving technological landscape. By addressing user feedback and adapting to new requirements, SDR-BASIC can continue to serve as a valuable tool for surveyors. The commitment to enhancing the language and its associated tools reflects a proactive approach to software development, ensuring that users can effectively leverage the capabilities of the SDR2. This forward-thinking mindset is crucial for the long-term success of the project.

Document reference

  • Microsoft BASIC
  • ADL
  • IBM PC
  • ANSI standard for BASIC
  • PDP-11