Skip to content

skinwalker3654/interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Script Language (CSL)

A minimal, readable scripting language designed for simplicity and educational use.

Overview

This language is built to feel like readable pseudocode while still being structured and deterministic.
It supports variables, printing, delays, loops, and conditionals with a very simple syntax.

Features

  • Variables with set
  • Console output with print and println
  • Sleep/delay with wait
  • For-loops with manual increment
  • execute programs with execute
  • file reading read_file
  • I/O functions read and the previous one print and println
  • Conditional statements (if / endif)
  • Loop statements (for / endfor)

Syntax

Variables

set number = 10;
set name = "michael";

# this line of code gets the content of the file and puts it into the variable
set content = read_file "file_name";

take user input

# user input is by default a string
set user_input = read "Message: ";

Variable assigments

varname = "new message";
varname = 23;

varname++;
varname--;

varname -= 20;
varname -= other_varname;

varname += 20;
varname += other_varname;

varname *= 20;
varname *= other_varname;

varname /= 20;
varname /= other_varname;

Printing

print "Hello ";
println "World";
println number;

Execute

execute "program";
execute name;

Delay

wait 2;
wait number;

Folder Creation & deletion

mkdir "folder name";
mkdir variable_name;

remove "folder_name/file_name";
remove variable_name;

Clear terminal

clear;

Loops

set i = 1;
for i to 10:
    println i;
    i++;
endfor

Conditionals

if number > 2:
    print number;
    println " is bigger than 2";
endif

Example Program

set number = 10;
set name = "michael";

print "Name: ";
println namel

print "Number: ";
println number;

println "Waiting 2 seconds...";
wait 2;

wait "Waiting number seconds...";
wait number;

# we also have comments, and this is a for loop
set i = 1;
for i to 10:
    println i;
    i++;
endfor

if number > 2:
    print number;
    println " is bigger than 2";
endif

println "Creating the folders...";
wait 2;

mkdir "FOLDER FOR PHOTOS";
mkdir name;

number++;
name = "john";

println number;
println name;

wait 2;
clear;
wait 2;

number += 2;
println number;

remove "michael";
if number > 2:
    println "number is bigger than 2";
    set content = read_file "script";
    print content;

    # takes user input
    set user_input = read "Write something: ";
    println user_input;

    number /= 2;
    println number;

    execute "vim";
    endprogram;
endif

println "program has not ended";

Build And Run

make  # compile the program
./run <filename> # execute scripts

For greeklish version you do

make greeklish
./marion <filename>

clean executables

make clean

Design Goals

  • Human-readable syntax
  • Beginner-friendly
  • Easy to parse and interpret
  • Minimal keywords and rules

Roadmap

Planned features:

  • Functions
  • While loops
  • Arrays / lists
  • User input
  • Math library
  • more shell operations

interpiter

About

This is a simple language that runs on an interpeter writen in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors