Skip to content

New programming language based on python, C++, C# using Goldparser 5.2v and Calitha engine

Notifications You must be signed in to change notification settings

SalahEldinFikri/MaTriX-Programming-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

MaTrix-Programming-language

New programming language based on python, C++, C# using Goldparser 5.2v and Calitha engine.

image

This appears to be a context-free grammar for a programming language called "MaTriX". The grammar is defined using BNF (Backus-Naur Form) notation, where the production rules are defined using a combination of terminal symbols (such as identifiers, integers, and floats) and non-terminal symbols (such as program, assignment, declaration, and so on).

The grammar starts with the (program) non-terminal, which is the starting symbol of the language. The non-terminal defines the structure of a program in the MaTriX language, and it consists of a series of statements enclosed in curly braces. The statements themselves are defined by several other non-terminals, such as (assignment, declaration, for, while, switch, and if).

The non-terminal defines how variables are assigned values in the MaTriX language. The (declaration) non-terminal defines how variables are declared and initialized with integer or float values. The (for, while, switch, and if) non-terminals define the various control structures available in the language, such as loops, conditionals, and switch statements.

The grammar also defines a set of arithmetic and assignment operators that can be used to manipulate variables and perform calculations. These include the standard addition, subtraction, multiplication, and division operators, as well as compound assignment operators such as +=, -=, *=, and /=.

This grammar defines a programming language syntax that includes the following components:

- Terminals: identifiers, integers, and floating-point numbers.

- Non-terminals: program, constant, assignment, declaration, for loop, while loop, switch statement, if-else statement, expressions, statement list, and arithmetic operations.

- The program starts with the keyword "Start" and ends with "End" surrounded by braces.

- The constant non-terminal can have an assignment or declaration followed by a statement list, a for loop, a while loop, a switch statement, or an if-else statement.

- The assignment non-terminal assigns a value to an identifier.

- The declaration non-terminal initializes an identifier with an integer or a floating-point number.

- The for loop has three parts: initialization, condition, and increment/decrement.

- The while loop executes a statement list while a condition is true.

- The switch statement executes a statement list based on the value of an identifier.

- The if-else statement executes a statement list if a condition is true and executes an alternative statement list if it's false.

- The expression non-terminal compares an identifier with an integer, true or false, or uses logical negation.

- The statement list can have a constant, an arithmetic operation, or be empty.

- The arithmetic operations can be addition, subtraction, division, or multiplication, with the possibility of an identifier being assigned a value based on the operation.

Small Compiler:

image image

About

New programming language based on python, C++, C# using Goldparser 5.2v and Calitha engine

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages