# 🇪🇹 APL – አማርኛ Programming Language
A beginner-friendly programming language that uses **Amharic keywords** and translates source code into **Python**.
This project was developed for a **Programming Language Design** course under the theme:
> **Local Language Programming for Beginners**
The language is designed to make programming easier for Ethiopian beginners by replacing English programming keywords with understandable Amharic words.
---
# Features
## ✅ Variables
```am
ቁጥር x = 10
```
Generated Python:
```python
x = 10
```
---
## ✅ Variable Assignment
```am
x = x + 1
```
Generated Python:
```python
x = x + 1
```
---
## ✅ Arithmetic Expressions
Supported operators:
```text
+
-
*
/
```
Example:
```am
ቁጥር z = x + y
```
---
## ✅ Comparison Operators
Supported comparisons:
```text
==
```
Example:
```am
ከሆነ x > 5:
```
---
## ✅ Output (Print)
```am
ፃፍ("ሰላም")
```
Generated Python:
```python
print("ሰላም")
```
---
## ✅ If Statement
```am
ከሆነ x > 5:
ጀምር
ፃፍ("ትልቅ")
ጨርስ
```
Generated Python:
```python
if x > 5:
print("ትልቅ")
```
---
## ✅ If / Else Statement
```am
ከሆነ x > 5:
ጀምር
ፃፍ("ትልቅ")
ጨርስ
ካልሆነ:
ጀምር
ፃፍ("ትንሽ")
ጨርስ
```
Generated Python:
```python
if x > 5:
print("ትልቅ")
else:
print("ትንሽ")
```
---
## ✅ While Loop
```am
ቁጥር x = 1
ሲሆን x 5:
ጀምር
ፃፍ("OK")
ጨርስ
```
---
# Source File Extension
APL source files use the extension:
```text
.አም
```
Example:
```text
program.አም
```
Generated output:
```text
program.py
```
---
# Project Structure
```text
APL/
│
├── lexer.py
├── parser.py
├── nodes.py
├── codegen.py
├── translator.py
│
├── README.md
│
└── examples/
├── basic.አም
├── control.አም
├── function.አም
```
---
# Compiler Architecture
The translator consists of three major stages:
## 1. Lexer
The lexer:
- Reads source code
- Handles Unicode Amharic text
- Recognizes keywords
- Produces tokens
Example:
```am
ቁጥር x = 10
```
Tokens:
```python
[
('VAR','ቁጥር'),
('ID','x'),
('ASSIGN','='),
('NUMBER','10')
]
```
---
## 2. Pars …