Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Scripting Language (SSL)

One of the project I.ve wanted to undertake for a while now is writing a simple programing language.

Requirements

  • Variables/Literals let a = 1
  • Integers, Booloean, Strings
  • Block Based
  • if/else: if else
  • comparison operators: == != > >= < <=
  • boolean operators: || && !
  • mathematical operators: + - / * ** %
  • print: print

Example

let foo = "foo"

let bar = if foo == "foo" {
  true
} else {
  false
}

print bar

Abstract Syntax Tree

body [
  assignment: {
    variable: "foo",
    value: literal { "foo" },
  },
  assignment {
    variable: "bar",
    value: if_statement {
      condition: bin_op {
        op: "equals",
        a: variable { "foo" },
        b: literal { "foo" },
      },
      branch: [
        literal { true },
      ],
      else: [
        literal { false },
      ],
    },
  },
  print {
    args: variable { "var" },
  },
]

About

My own custom language

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages