Skip to content

jaddison06/ocrpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ocrpi

OCR Pseudocode Interpreter

OCRPI is an interpreter for the OCR pseudocode syntax described on page 31 of the A Level Specification. It aims to be fully compliant with this description to act as a tool for learners to interactively test their knowledge of the syntax. The design focuses on friendly, helpful error messages, allowing learners to improve their understanding. Speed of execution is not initially a priority but later versions will improve on this, potentialy turning it into something closer to a compiler.


As the pseudocode description isn't a de-facto language spec, I've made some assumptions:

  • Variable names can contain any alphanumeric characters and underscores, but may not start with a number
  • String literals are denoted with double quotes ONLY and are never multi-line
  • Variables (when I get there) and parameters are dynamically typed, although this will eventually be a configurable option
  • Operator precedence is that of a standard C-like language, described in grammar.bnf
  • Added the self keyword for classes to refer to instances of themselves

Running

Requires Python 3.10, make, gcc. python3 build/generate-makefile.py from the root directory to generate a Makefile, then make run.

About

OCR Pseudocode Interpreter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published