Skip to content

guillermo-moran/Simpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Simpl

Simple Programming Language written in Obj-C for my Programming Languages class

Comments

Comments in .simpl files are prefixed by "#!"

Functions

func :

  • Declares a new function
  • Takes unlimited arguments: functionName arguments
  • Example usage: "func functionName add 2 1"

newline :

  • Prints a new line
  • Takes no arguments
  • Example usage: "newline"

input :

  • Takes in user input
  • Takes 1 argument: prompt
  • Example Usage: input please enter your name:
  • Saves input in variable "In"

whatis :

  • Prints the value of a given variable
  • Takes 1 argument: variable name
  • Example Usage: whatis X

loop :

  • Repeats the next command the given number of times (> 0)
  • Takes 1 argument: int
  • Example usage: loop 5

var :

  • Variables defined by strings starting with capital letters
  • Sets the value of a new variable
  • Takes 2 arguments: variable name, value
  • Example usage: var X 2

pause :

  • Pauses the program for a given amount of seconds
  • Takes 1 argument: int
  • Example usage: pause 3

add :

  • Adds all given numbers and returns a value
  • Takes unlimited arguments
  • Example usage: add 1 2 3 4
  • Stores result in "Sum" variable

subtract :

  • Subtracts all given numbers and returns a value
  • Takes unlimited arguments
  • Example usage: subtract 4 3 2 1
  • Stores result in "Difference" variable

help :

  • Prints a help page
  • Takes no arguments
  • Example usage: help

print :

  • Prints a line of text
  • Takes unlimited arguments
  • Example usage: print hello world

file :

  • Reads a file from the system
  • Takes 1 arguments
  • Example usage: file /path/to/file.simpl

exit :

  • Exits the program
  • Takes no arguments
  • Example usage: exit

About

Language written in Obj-C for a class project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published