PL

PL - Prithak's Language was made by Prithak Adhikari and the concept was developed by Saugat Adhikari. This took us two months for completing and there still are many things that we want to implement! The first month was done with some planning and designing while the other month was used for the coding! The work has really paid off!

If you are interested in the code of the language, then here it is:

PL.QB

CLS
PRINT "Welcome to PLanguage Compiler! Enter your file name to see the results."
PRINT "Extra commands:"
PRINT "/cls - clear the screen"
PRINT "/edit - edit a file using notepad"
PRINT "/exit - to exit this program"
PRINT STRING$(80, "-")

menu:
INPUT ">>", file$
IF INSTR(file$, "/edit") THEN
    SHELL "notepad " + RIGHT$(file$, LEN(file$) - 6)
ELSEIF file$ = "/exit" THEN
    END
ELSEIF file$ = "/cls" THEN
    CLS
    GOTO menu
END IF
OPEN file$ FOR INPUT AS #1
OPEN "p1.bas" FOR OUTPUT AS #2
DO WHILE NOT EOF(1)
    LINE INPUT #1, l$
    l$ = replace$(l$, "[", "(")
    l$ = replace$(l$, "]", ")")
    x = x + 1
    IF INSTR(l$, "println") THEN
        PRINT #2, "PRINT " + RIGHT$(l$, LEN(l$) - 7)
    ELSEIF INSTR(l$, "input") THEN
        l$ = replace$(l$, "(", "")
        l$ = replace$(l$, ")", "")
        PRINT #2, l$
    ELSEIF INSTR(l$, "}") THEN
        IF e$ = "for" THEN
            PRINT #2, "NEXT"
        ELSEIF e$ = "if" THEN
            PRINT #2, "END IF"
        ELSEIF e$ = "funct" THEN
            PRINT #2, "END FUNCTION"
        ELSEIF e$ = "while" THEN
            PRINT #2, "WEND"
        END IF
        e$ = ""
    ELSEIF INSTR(l$, "for") THEN
        l$ = replace$(l$, "{", "")
        PRINT #2, l$
        e$ = "for"
    ELSEIF INSTR(l$, "elif") THEN
        l$ = replace$(l$, "{", "")
        PRINT #2, "ELSEIF " + RIGHT$(l$, LEN(l$) - 4) + " THEN"
    ELSEIF INSTR(l$, "else") THEN
        l$ = replace$(l$, "{", "")
        PRINT #2, l$

    ELSEIF INSTR(l$, "if") THEN
        l$ = replace$(l$, "{", "") + " THEN"
        PRINT #2, l$
        e$ = "if"
    ELSEIF INSTR(l$, "funct") THEN
        l$ = replace$(l$, "{", "")
        PRINT #2, "FUNCTION " + RIGHT$(l$, LEN(l$) - 5)
        e$ = "funct"
    ELSEIF INSTR(l$, "clear()") THEN
        PRINT #2, "CLS"
    ELSEIF INSTR(l$, "terminate()") THEN
        PRINT #2, "END"
    ELSEIF INSTR(l$, "wait") THEN
        PRINT #2, "SLEEP"
    ELSEIF INSTR(l$, "delay") THEN
        PRINT #2, "_DELAY " + RIGHT$(l$, LEN(l$) - 5)
    ELSEIF INSTR(l$, "terminate.instant()") THEN
        PRINT #2, "SYSTEM"
    ELSEIF INSTR(l$, "color") THEN
        l$ = replace$(l$, "(", "")
        l$ = replace$(l$, ")", "")
        PRINT #2, l$
    ELSEIF INSTR(l$, "while") THEN
        l$ = replace$(l$, "{", "")
        PRINT #2, l$
        e$ = "while"
    ELSEIF INSTR(l$, "createVector") THEN
        PRINT #2, "TYPE " + RIGHT$(l$, LEN(l$) - 12)
        PRINT #2, "X AS INTEGER"
        PRINT #2, "Y AS INTEGER"
        PRINT #2, "END TYPE"
    ELSEIF INSTR(l$, "setScreen") THEN
        PRINT #2, "SCREEN _NEWIMAGE" + RIGHT$(l$, LEN(l$) - 9)
    ELSEIF INSTR(l$, "declare") THEN
        l$ = replace$(l$, "[", "(")
        l$ = replace$(l$, "]", ")")
        PRINT #2, "DIM " + RIGHT$(l$, LEN(l$) - 7)
    ELSE
        IF INSTR(l$, "=") OR INSTR(l$, "}") OR LEN(l$) = 0 THEN
            l$ = replace$(l$, "[", "(")
            l$ = replace$(l$, "]", ")")
            PRINT #2, l$
        ELSE
            PRINT "ERROR ON LINE"; x
            PRINT l$
            PRINT "Please try revising the code..."
            END
        END IF
    END IF
LOOP
PRINT #2, "'$include: 'functions.txt'"
CLOSE #2
CLOSE #1
OPEN "p1.bas" FOR INPUT AS #1
DO WHILE NOT EOF(1)
    LINE INPUT #1, l$
    PRINT l$
LOOP
CLOSE #1
PRINT "Compiling Your File..."
SHELL _HIDE "qb64 -x p1.bas"
SHELL "p1.exe"
GOTO menu
FUNCTION replace$ (a$, from$, to$)
    FOR i = 1 TO LEN(a$)
        c$ = MID$(a$, i, 1)
        IF c$ = from$ THEN
            replace$ = replace$ + to$
        ELSE
            replace$ = replace$ + c$
        END IF
    NEXT i
END FUNCTION

PL.QB64

Coming Soon!