Skip to content

Most functional Version of the Robit Transpiler. Everything else can be seen as deprecated.

License

Notifications You must be signed in to change notification settings

2weiEmu/Robit-Transpiler-Local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robit Transpiler Local

Syntax (What is valid to write)

Keywords

(As a clarification an expression is anything that evaluates to a number -> meaning it can also be a constant.)

TYPE = INTEGER, CHAR, REAL, STRING, BOOLEAN

STRING = something written as "Text here"

CHAR = something written as 't'

Valid arithmetic operators: +, -, *, /, mod, div

Valid Logic Operators: {B} AND {B}, {B} OR {B}, NOT {B}

  • OUTPUT {EXPRESSION(s) / STRING(s)}*

    *these should be comma-separated

  • {VARIABLE / ARRAY_INDEX} <- {EXPRESSION / STRING}

  • DECLARE {VARIABLE} : ARRAY [EXPRESSION : EXPRESSION] OF {TYPE}

  • INPUT {VARIABLE / ARRAY_INDEX}

  • IF {CONDITION (BOOLEAN)}
        THEN
            {STATEMENTS}
        ELSE
            {STATEMENTS}
    ENDIF
    
    • Note that the ELSE statement is optional.
    • IF statements can also be nested.
  • CASE OF {VARIABLE / ARRAY_INDEX}
        {EXPRESSION} : {STATEMENT (singular)}
        {EXPRESSION} : {STATEMENT (singular)}
        ...
        OTHERWISE   : {STATEMENT (singular)}
    ENDCASE
    
    • Note that the OTHERWISE clause is optional.
  • FOR {VARIABLE / ARRAY_INDEX} <- {EXPRESSION} TO {EXPRESSION}
        {STATEMENTS}
    NEXT
    
  • FOR {VARIABLE / ARRAY_INDEX} <- {EXPRESSION} TO {EXPRESSION} STEP {EXPRESSION}
        {STATEMENTS}
    NEXT
    
  • REPEAT
        {STATEMENTS}
    UNTIL {CONDITION (BOOLEAN)}
    
  • WHILE {CONDITION (BOOLEAN)} DO
        {STATEMENTS}
    ENDWHILE
    

A condition can be constructed using the comparison and boolean operators AND, OR, NOT, >, <,<=,>=,==, variables and expressions. Use brackets to make more explicit.

What is this?

How to use

The Works

About

Most functional Version of the Robit Transpiler. Everything else can be seen as deprecated.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published