/BASIC

BASIC Compiler Implemented on C++

Primary LanguageC++

BASIC Compiler

Motivation For This Project

Enhance my understanding of Compliers.

Completed Tasks

  1. Added a basic lexer.

TODO List:

  1. Implement lexical analysis phase to break down the source code into tokens.
  2. Develop a parser to build an abstract syntax tree (AST) from the token stream.
  3. Implement semantic analysis to perform type checking and ensure program correctness.
  4. Develop an intermediate code generation phase to convert the AST into an intermediate representation (IR).
  5. Implement optimization techniques to optimize the generated intermediate code.
  6. Develop a code generation phase to convert the optimized intermediate code into target machine code.
  7. Implement a symbol table to store and manage variable and function information.
  8. Develop error handling mechanisms to provide meaningful error messages to the user.
  9. Implement support for various data types, including integers, floating-point numbers, strings, arrays, and user-defined types.
  10. Develop a standard library for common BASIC functions and routines.

Feature List:

  1. Support for basic arithmetic and logical operations (e.g., addition, subtraction, multiplication, division, AND, OR).
  2. Control flow statements such as IF-THEN-ELSE, FOR-NEXT, WHILE-WEND, DO-LOOP, and GOTO.
  3. Subroutines and functions to allow code modularity and reusability.
  4. Input and output operations to interact with the user and the environment.
  5. Support for arrays and multidimensional arrays.
  6. String manipulation functions and operations.
  7. Error handling mechanisms, including runtime error detection and reporting.
  8. Support for user-defined types and structures.
  9. Integrated debugging features, such as breakpoints and step-by-step execution.
  10. Compatibility with the original BASIC language syntax and keywords.
  11. Optimization techniques to improve the performance of generated code.