Skip to content

BalaM314/soodocode

Repository files navigation

Soodocode

Soodocode: a runtime for Cambridge CS (9618) pseudocode syntax, written in Typescript.

Image of sample program

Website

Click here to view the site

CLI

Installation: npm i -g soodocode-cli

Usage: soodocode file.sc

More demos

Features

Statements

  • DECLARE, DEFINE, CONSTANT, Assignment, OUTPUT, INPUT, RETURN, CALL, TYPE
  • IF, ELSE, FOR, FOR STEP, WHILE, REPEAT
  • CASE OF statements
  • Case branch with range
  • FUNCTION, PROCEDURE
  • CLASS, CLASS INHERITS, Class property, Class procedure, Class function

Operators

  • or and equal_to not_equal_to less_than less_than_equal greater_than greater_than_equal not
  • add subtract negate multiply divide integer_divide mod
  • string_concatenate
  • pointer_reference pointer_dereference access

Builtin functions

  • LEFT, RIGHT, MID/SUBSTRING, TO_UPPER, TO_LOWER, UCASE, LCASE
  • NUM_TO_STR, STR_TO_NUM, IS_NUM, ASC, CHR, INT
  • DAY, MONTH, YEAR, DAYINDEX, SETDATE, TODAY/NOW
  • LENGTH() on arrays and strings
  • RAND

Arrays

  • n-dimensional arrays
  • Arrays with size determined by runtime-evaluated expressions
  • Arrays with generic size
    • in function arguments
    • in function return types
    • in class fields
    • behind pointers

Types

  • Enums
  • Records
  • Pointers
    • Infinite pointer types
  • Recursive types
    • Sets
  • Set operations
  • Integer range type (1..10, 200..250)
  • Sound type system
    • Type checking is partly done at compile time (class inheritance, type size check) and partly at runtime (everything else).

Classes

  • Classes
  • Public/private class members
  • Inheritance
  • SUPER in classes

Files

  • OPENFILE READFILE WRITEFILE CLOSEFILE statements
  • READ WRITE APPEND file modes
  • SEEK GETRECORD PUTRECORD statements, RANDOM file mode
  • File GUI
  • EOF() function

Misc

  • Passing by value/reference for all variable types
  • Shortened forms (for variable declaration and function arguments)
  • Robust, hundreds of error messages
  • Typo checking
  • Error ranges (underline the exact cause of the error, highlight the area around it)
  • Configurable
  • Allows any words as identifiers (except pseudocode keywords), including for, __proto__, and hasOwnProperty

User interface

  • Minimalistic
  • Create, view, edit, delete, upload, and download files
  • All features accessible with only the keyboard

More information

For a full list of features, see features.md

For some discussion of advanced language features, see notes.md

About

Cambridge CS Pseudocode runtime and checker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published