(Course project for SE2322-Advanced Data Structure)
You can write some "Ancient Language--Basic" code to feed the "Interpreter", which possibly give you a right answer :)
The feature of the Interpreter are:
- Error Syntax Highlight
- Single Step debug
- Support two types (int and string, wow!)
- AST Printer
- A Trivial Type Check (there are only two type :)
- TODO...
Error Highlight
Single Step Debug
You should use QT to open the project. I will update it when I am idle...
mainwindow.cpp
The UI and slot functions for executing the codetokenizer.cpp
A simple lexical analyzerparse.cpp
A simpl top-down parser, which can do trivial type-checking and variable defined checking.exp.cpp
TheExpression
Class represing the arithmetic expressionstatement.cpp
The Basic language statement, such asLET
,IF
,GOTO
statementsExecThread.h
Use multithread programming. It generate a new thread to execute the code, avoiding blocking the UIprogram.cpp
Store the program(code), and provide the interface for UI to execute the codeevalstate.h
The runtime environment classtest/*
Some classified test filesmainwindow.ui
The QT generated file, displaying the UI