Skip to content
 
 

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turkish-Inspired Programming Language

Java Status Parser Course

Course Information

  • Course: Programming Languages
  • Project: Term Project
  • Implementation Language: Java

Overview

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).

Implemented Components

  • 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

Language Features

  • 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şla and bitir (replaces { and })
  • Statement Terminators: . (replaces ;)
  • Built-in Commands: yazdır (replaces println)

Project Structure

src/
 ├── Main.java
 ├── Lexer.java
 ├── Parser.java
 ├── Token.java
 ├── TokenType.java
 └── SymbolTable.java

tests/
 ├── ArithmeticExample.txt
 ├── ConditionalExample.txt
 ├── LoopExample.txt
 └── VariableDeclarationExample.txt

Sample Programs

Sample source codes are located in the tests/ folder.

How to Run

javac src/*.java
java -cp src Main

Example Syntax

tamsy x = 5 + 3 .

ise (x > 5) başla
    yazdır(x) .
bitir

UML Architecture Diagram

+-----------------------+
|       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 |
+-----------+ +---------------+

Component Responsibilities

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.

Authors

Nazmi Emir Özer 
Yiğithan Erken
Mejder Avcı

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages