- Course: Programming Languages
- Project: Term Project
- Implementation Language: Java
This project is a mini programming language inspired by Turkish syntax and keywords. The goal is to design and implement the core front-end components of a compiler (Lexical Analyzer and Recursive-Descent Parser).
- Lexical Analyzer (Lexer) with UTF-8 Turkish character support
- Recursive Descent Parser
- Symbol / Lookup Table
- Syntax Error Detection
- Test Case Execution with Sample Source Files
- Variable Declarations:
tamsy(int),ondalıksy(double),karakter(char),metin(String) - Assignment Statements: Standard
=operator - Arithmetic Expressions:
+,-,*,/ - Relational Operators:
<and>(same as Java) - Equality Operator:
?=(replaces==) - Logical Operators:
ve(replaces&&),veya(replaces||) - Conditional Statements:
ise(if) /değilse(else) - Loop Structures:
döngü(while),tekrarla(for) - Block Scopes:
başlaandbitir(replaces{and}) - Statement Terminators:
.(replaces;) - Built-in Commands:
yazdır(replacesprintln)
src/
├── Main.java
├── Lexer.java
├── Parser.java
├── Token.java
├── TokenType.java
└── SymbolTable.java
tests/
├── ArithmeticExample.txt
├── ConditionalExample.txt
├── LoopExample.txt
└── VariableDeclarationExample.txt
Sample source codes are located in the tests/ folder.
javac src/*.java
java -cp src Maintamsy x = 5 + 3 .
ise (x > 5) başla
yazdır(x) .
bitir+-----------------------+
| Main.java |
| Program Entry |
+-----------+-----------+
|
v
+-----------------------+
| Lexer.java |
| Source Scanner |
+-----------+-----------+
|
v
+-----------------------+
| Token.java |
| Token Objects |
+-----------+-----------+
|
v
+-----------------------+
| Parser.java |
| Syntax Analyzer |
+-----+-----------+-----+
| |
v v
+-----------+ +---------------+
|TokenType | |SymbolTable |
|Enum | |Variable Store |
+-----------+ +---------------+Main.java → Starts program execution and loads input files.
Lexer.java → Converts source code into tokens and handles Turkish characters.
Token.java → Stores token type and value.
TokenType.java → Defines all token categories using enum.
Parser.java → Validates syntax using Recursive Descent Parsing.
SymbolTable.java → Stores declared identifiers and metadata.Nazmi Emir Özer
Yiğithan Erken
Mejder Avcı