Code Monkey home page Code Monkey logo

parser's Introduction

parser

A simple bare bones language that piggy backs off of C++. It loads & runs .pars files.

Parser v1 Documentation:

Commands:

PRINT - Prints numbers, strings, and variables.

INPUT - Recieves input from user and sets variable according to input.

EXIT - Ends program correctly.

INT - Creates an integer variable.

SET - Sets variable value.

ADD - Adds an amount to a variable.

IF - If conditional statment.

Commands examples:

PRINT:

print("Hello!");

Prints out Hello! to the screen.

print(12);

Prints out 12 to the screen.

print("nl");

Prints a new line on the screen.

INPUT:

int(num);
input(num);

Creates a variable with the name "num" with a value of 0, receives input from user, and changes "num" to that input.

INT:

int(numero);

Creates a variable with the name "numero" with a default value of 0.

int(num,25);

Creates a variable with the name "num" with a value of 25.

int(num1,5);
int(num2,num1);

Creates a variable with the name "num1" with a value of 5. Then creates another variable called "num2" and makes it the same amount as "num1".

SET:

int(num,5);
set(num,20);

Creates a variable with the name "num" witha value of 5, then sets the value to 20.

int(num1,5);
int(num2);
set(num2,num1);

Creates two variables "num1" and "num2", then sets "num2" to same value as "num1".

ADD:

int(num,10);
add(num,5);

Creates a variable named "num" with a value of 10. Then adds 5 to it, thus making it 15.

int(soda,2);
add(soda,-2);

Creates a variable named "soda" with a value of 2. Then subtracts 2 to it, thus making it 0.

int(grapes,3);
int(apples,5);
add(grapes,apples);

Creates two variables named "grapes" and "apples" and then adds "apples" to "grapes", thus making "grapes" 7.

IF:

if(1 == 1) : print("Yes.");

If statment where if 1 equals 1, it prints "Yes.".

int(num,12);
if(num == 13) : prints("Num is 13");

If statment where is the variable "num" equals 13, it prints "Num is 13". This will not print, because "num" is not 13, its 12.

int(num);
input(num);
if(num > 5) :
print("Bigger than five!");
print("Thats so cool!");
:

if(num < 5) :
print("Smaller than five.");
print("Psch whatever.");
:

Two if statments with more than one line inside, thats when you use the colon to open and close the if statment.

EXIT:

print("Hello world!");
exit;

Prints "Hello world!" to the screen and then exits the program.

Example program:

print("Hello! How old are you?");

print(":nl");

int(age);

input(age);

if (age < 5 ) : print("Your really young!");

if (age > 5 ) : print("Goodbye grandpa!");

exit;

Example program output:

Hello! How old are you?
>12
Goodbye grandpa!

parser's People

Contributors

joelrl avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.