rrrrlang
v1.0.0
Published
Rlang
Maintainers
Readme
RRRR Language Interpreter (TypeScript)
This project is a TypeScript/Node.js implementation of the RRRR language interpreter.
It supports basic variables, conditional statements, input/output, and includes a feature where integer input of 1 outputs YES, otherwise NO.
Features
- Variable declaration and input
RR RRRRR myVar RRRR RRRRDeclares a variable
myVarof integer typeInput of 1 prints
YES, otherwise printsNOVariable output
RRR RR myVar- String output
RRR RR "Hello World"- IF conditions
RRRRR RRRR RRRR "myVar" "1"
RRR RR "It's one!"
RRRRR RRRRRR- Decimal Type support using
DecimalWrapper
Installation
Use git
- Install Node.js (v18+ recommended)
- Clone the repository
- Install dependencies
Use npm
- Install Node.js (v18+ recommended)
- On your terminal, write
npm install rrrrlang
- On your terminal, write
Usage
- Create a
.RRRRfile, for exampletest.RRRR
- Create a
RR RRRRR myVar RRRR RRRR
RRR RR myVar- Run the interpreter:
npx ts-node Utils/Runner.ts test.RRRRFile Structure
Rlang/
├── Utils/
│ ├── parseLine.ts
│ ├── Runner.ts
│ └── DecimalWrapper.ts
├── Types/
│ ├── variables.ts
│ └── maps.ts
├── Tests/
│ └── test.RRRR
└── README.mdNotes
- The interpreter supports integer, string, and decimal types.
- IF conditions can compare variables or literals using
==,!=,<,>,<=,>=. - All inputs are read from the console in Node.js.
