Welcome to YeleLang! This is a simple yet powerful programming language built on top of C++ that allows you to declare variables, perform arithmetic operations, and print results. The language was created as part of a learning project to explore language design, lexers, and parsers. This README provides an overview of the language, how to use it, and how to set up the development environment.
- Variable Declaration:
yele
keyword for declaring variables and assigning values. - Operations: Use
yekar
for performing operations like addition and subtraction. - Output: Use
printkr
to print the result of a calculation or a variable.
// Declare variables
yele x = 5
yele y = 10
// Perform arithmetic operations
yekar z = x + y
// Print the result
printkr z
15
- Lexer: The lexer scans through the input code, dividing it into tokens like keywords (
yele
,yekar
,printkr
), variable names, operators (+
,-
), and values. - Parser: The parser reads the tokens generated by the lexer, identifies the operations to be performed (e.g., assignment, arithmetic), and executes them.
- Execution: The parsed operations are executed in the C++ environment, with results being printed or stored in variables.
To try out YeleLang, you need a C++ compiler (like g++) and a development environment.
-
Clone the repository:
git clone https://github.com/sajalbatra/YeleLang.git
-
Navigate to the project directory:
cd YeleLang
-
Compile the code:
g++ -o yelelang main.cpp
-
Run the program:
./yelelang
You can modify the source code to write your own programs and experiment with the syntax.
Feel free to fork the repository, create issues, and submit pull requests if you’d like to improve or contribute to the language. Contributions are welcome!
For any questions or suggestions, feel free to reach out via email or GitHub issues.