10000 GitHub - Cri5tiann/TokenCraft: Project related to subject "Programming Language Translation" studied in Croatia. The unit tests provides a presentation of the working code that imitates the a lexer and a parser for a fictive "PLT" language
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Project related to subject "Programming Language Translation" studied in Croatia. The unit tests provides a presentation of the working code that imitates the a lexer and a parser for a fictive "PLT" language

License

Notifications You must be signed in to change notification settings

Cri5tiann/TokenCraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is TokenCraft?

TokenCraft is a programming language tool that helps you write and understand code better. It takes your code written in PLT (Programming Language TokenCraft) and turns it into a clear, visual representation that shows how your program is structured.

Quick Start

Installation

# Clone the repository
git clone https://github.com/Cri5tiann/TokenCraft.git

# Navigate to project directory
cd java

# Build the project
run the Main class and see what a great small project I built))

Writing PLT Programs

Basic Syntax

Every program needs:

  • function main() declaration
  • Semicolons (;) after statements
  • Curly braces ({}) for blocks

Control Structures

If-Else Statement
if (x > 0) {
    output_int(x);
} else {
    output_int(0);
}
For Loop
for (i = 0; i < 10; i++) {
    output_int(i);
}

Operators

| Category | Operators |

| | Math | + , - , * , / , % | | Comparison | < , <= , > , >= , == | | Logic | && (and), || (or) | | Assignment | = | | Increment/Decrement | ++ , -- |

Examples

Calculator Program
function main() {
    x = input_int();
    y = input_int();
    
    output_int(x + y);  // Addition
    output_int(x * y);  // Multiplication
}
Number Checker
function main() {
    num = input_int();
    
    if (num > 0) {
        output_int(1);
    } else {
        if (num < 0) {
            output_int(-1);
        } else {
            output_int(0);
        }
    }
}

Common Questions

How do I input multiple numbers?

Use input_int() multiple times:

x = input_int();
y = input_int();
Why doesn't my program work?

Check for:

  • Missing semicolons (;)
  • Missing curly braces ({})
  • Mismatched parentheses

[Documentation][docs]

Made with student passion by Cristian

About

Project related to subject "Programming Language Translation" studied in Croatia. The unit tests provides a presentation of the working code that imitates the a lexer and a parser for a fictive "PLT" language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0