Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An interpreter for IGCSE/A level pseudocode

License

NotificationsYou must be signed in to change notification settings

SingularityT3/PseudoEngine2

Repository files navigation

A pseudocode interpreter designed to be compatible with the Cambridge IGCSE and A levelpseudocode syntax

Demo

The REPL

The REPL stands forReadExecutePrintLoop and is an interface where pseudocode statements can be entered. The statement is immediately executed after it is entered and the result or potential errors are printed to the console to make it easy for debugging.

> 5 + 2 * 311> LEFT("ABCD", 2)"AB"> x <- 1 / 0Runtime Error in file <stdin>:Division by 0Traceback:Program, line 1, column 9

Usage

Launching the REPL

Lanuch the program directly by double clicking theexecutable
OR
Run it in the terminal with no arguements

Running files in the REPL

The REPL can be used to run files usingRUNFILE <file>.
For example, here is a simple hello world program stored in the filehello.pseudo

OUTPUT "Hello World!"


Run it withRUNFILE hello.pseudo
Example output:

> RUNFILE hello.pseudo==> Running file 'hello.pseudo'Hello World!==> Program exited successfully>

Tip:The program must be stored in thesame folder as the executableor the full path of the program has to be mentioned when usingRUNFILE

Running files from the terminal

Navigate to the executable and run it providing the path of the program file as an arguement similar toRUNFILE

Windows:

PseudoEngine2.exe <filepath>

Linux/Unix:

./PseudoEngine2 <filepath>

Make sure you replacePseudoEngine2 with the actual name of the executable or rename the executable

Examples

Seeexamples

Building

Make sure cmake and a c++ compiler is installed, then clone the repository and inside its folder run the following commands:

cmake -B build -DCMAKE_BUILD_TYPE=Releasecmake --build build --config Release

The executable will be generated inside the build folder


[8]ページ先頭

©2009-2025 Movatter.jp