Skip to content

Easy Syntax Guide.

Mohamed Dief edited this page Feb 8, 2021 · 1 revision

How To Write Your Own Easy Code?

  • I'm Not Really Sure If Easy Code Is Easy. But You Can Decide. Easy Code Is Based On Python So Every Easy Code You're Writing Is Getting Genrated Into a Python Code. You Can See examples Folder Or Follow The Documentation Below.

Variable Assignment And Usage:

  • Let's Start With The Most Basic Thing Here. In Easy You Can Store Local Variables Using DEFINE Key, When The Parser Adds That Variable Into The Dicc. You Will Be Able To Call It From Anywhere Outside Of This Of Code Using ADD Key. See The Example Below For More Information
DEFINE githubHandler=<'"DEMON1A"'>

STORE handler
ADD githubHandler;NEWLINE
CALL print,handler
  • After Translating The Code With EasyShell, The Output Code Will Be Something Like This:
handler = "DEMON1A"
print(handler)
  • I Usually Use This Method To Add a Pure Python Code Into My Easy Code To Work With It Until I Implement a Key For The Thing I Need In Python

  • You Can Define Multi Variables On a Line Using , Between Everyone. For Example: STORE test,something,hi. You Can Use This For Functions That Returns More Than One Variable

  • In Case, You Want To Define Python Variable You Can Use VAR Key. It's Used To Define Python Variables On The Code. The Last Argument Is Always The Value Of The First Ones That's The Variables Names. Here's Some Code Example:

VAR test,"fine"
CALL print,test
  • Translate The Code With EasyShell And You Will Get That Code:
test = "fine"
print(test)
  • For Multiple Variables Assigment You Can Use Multiple Arguments. If You Used VAR test,variable,"hello" Then The Python Code Will Be test, variable = "hello"

Defining a Function:

  • You Can Define Your Own Function With FUNCTION Key On The Code. That Will Create a Python Function For You But You Will Need To Use . at The End Of Every Syntax You Code. The Dot at The End Of The Code Adds a TAB Into The Next Line Of Code. So When You Define a Function You Should Use . At The End Of It. See The Example Below

FUNCTION Main.
CALL print,"Hello^World!"

NEWLINE
CALL Main
  • After Translating The Code It Will Be Something Like This:
def Main():
    print("Hello World!")

Main()

Import Python Modules.

  • No Python Code Can Work Without Imports. To Import a Python Library You Need To Use IMPORT Key. For Example, If You Used IMPORT os,time After Tranlating The Code It Will Be import os,time LOL.

Call a Function And Store Python Variables

  • To Call a Function In Easy, You Should Use CALL Key. That Allows You To Call a Python Function With Arguments By Sperating The Values With ,. For Example: CALL print,"Hello^World!"

  • To Store Python Variables You Can Use STORE Key. That Will Set The Variable Name. And The Next Line Of Code Will Be It's Value.

TAB and NEWLINE:

  • It's Just a Basic Keys On Easy To Add NewLines And Tabs On The Code. So When You Want To Add a NewLine On Your Code You Just Need To Add NEWLINE And When You're Coding On a Function And You Hate Using Dots. Then Use TAB Key. I Know It's Not Pretty To Have NEWLINE and TAB On a Single Line. So I Allowed Using ; On The Code. So You Can Just Do Whatever Code You Want Then Add ;TAB Or ;NEWLINE To Add a NewLine/Tab at The End

If Condition With Else:

  • In Easy, If Condition Only Takes 3 Arugments. The First Condtion And The State And The Second Condition. So If You Added More Than Three Arguments You Will Get an Error. Here's an IF Condition Example:
IF "hello",==,"hello".
    CALL print,"The Program Says Hello"
ELSE print("The Program Didn't Say Hello"),print("The Program Isn't Mean.")