Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FusionLang

Overview

FusionLang is a new programming language designed for flexibility and ease of use, incorporating innovative syntax inspired by everyday language. This project aims to provide developers with a unique programming experience.

Features

  • Simple and intuitive syntax
  • Support for various programming constructs
  • Future enhancements planned for comprehensive functionality

Grammar

Fusion Lang's grammar is defined using ANTLR, supporting key constructs:

  • Statements: Includes print statements, variable declarations, function definitions, conditionals, loops, and exit statements.

  • Keywords:

    • bolo: For printing output. // IMPLEMENTED
    • naam: To declare variables. // IMPLEMENTED
    • khatam: To exit functions or statements. // IMPLEMENTED
    • agar, nahi_toh, warna: For conditional statements.
    • firse: For for loops.
    • bulao: For defining functions.
    • Arithmetic operations: For performing + - * /

Here's the README file in Markdown format, styled for GitHub so you can copy it directly:

FusionLang Documentation

Table of Contents

Comments

Comments in the code are used for adding explanatory notes or temporarily disabling code. There are two types of comments:

  • Single-Line Comments: Denoted by //. Anything following // on the same line is a comment and will not be executed.

    // This is a single-line comment
    
  • Multiline Comments: Wrapped between /* and */. Text within this range is treated as a comment and ignored by the compiler.

    /* This is a 
       multiline 
       comment */
    

Variable Declaration

Variables are declared using the keyword naam followed by the variable name, an equals sign =, and the value. Statements end with a semicolon ;. For string declaration place it between "STRING".

naam x = 1340;
naam y = 2000;
naam z = "Hello World";

Output Statement

The bolo command is used to print messages to the screen. Text to be printed is placed within quotation marks and parentheses. To include variable values within the output, use {variable_name} within the text.

bolo("Hello World");
bolo("The value of x is {x}"); 

Program Termination

End the program with the khatam command and an exit code.

khatam 0;

Copy this text into your GitHub README file to document your programming language syntax!

Getting Started

To get started with FusionLang, follow these steps:

Prerequisites

Make sure you have the following installed on your system:

  • CMake
  • NASM

Installing CMake

On Ubuntu

You can install CMake using the following command:

sudo apt update
sudo apt install cmake

On Windows

  1. Download the CMake installer from the CMake official website.
  2. Run the installer and follow the instructions.

On macOS

You can install CMake using Homebrew:

brew install cmake

Installing NASM

On Ubuntu

You can install NASM using the following command:

sudo apt update
sudo apt install nasm

On Windows

  1. Download the NASM installer from the NASM official website.
  2. Run the installer and follow the instructions.

On macOS

You can install NASM using Homebrew:

brew install nasm

Building the Project

  1. Clone the repository:

    git clone https://github.com/bignya23/FusionLang.git
  2. Navigate into the project directory:

    cd FusionLang
  3. Create a build directory:

    mkdir build
    cd build
  4. Run CMake to generate the project files:

    cmake ..
  5. Build the project:

    cmake --build .

Running FusionLang

To run your FusionLang files, use the following command in the terminal:

./Fusionlang <filename.fl>

Replace <filename.fl> with the name of your FusionLang file.

Example

If you have a file named example.fl, you would run:

./Fusionlang example.fl

Summary

  • The installation instructions for both CMake and NASM include commands for Ubuntu and methods for Windows and macOS, making it accessible for users on different platforms.
  • The README now provides clear steps for users to set up their environment before building and running the project.

Feel free to make any adjustments or ask for more details!

About

A toy programming language compiler in C++

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages