Skip to content

The project aiming to generate a parser for a custom designed programming language in the extent of CENG 4001 Automata Theory and Formal Languages course.

Notifications You must be signed in to change notification settings

SevcanDogramaci/fun-language-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fun Language Parser

This project is implemented in the extent of CENG 4001 Automata Theory and Formal Language as the term project.

This project consists of 2 parts:

  1. Part: We designed our own programming language consisting of the features:
    • Declaration of variables
    • Initialization of variables
    • Condition statement
    • Loop statement
    • Function statement
  2. Part: We implemented a parser for your programming language using Lex and Yacc.
    • Lexical Analysis using Lex
    • Syntactic Analysis (Parsing) using Yacc

About Parser

Our parser

  • parses an input code and generates a parse tree
  • catches the whole syntax errors
    • if any syntax error exists, states an error message with the related line

File structure

FunLanguageDesign.md -> Fun language design description

fun.l -> Lexical analyzer code

fun.y -> Parser code -> It needs refactoring

tests.txt -> Example test cases with fun language syntax

Requirements

  • Flex -> to run lexical analyzer
  • Bison -> to run parser
  • gcc -> to convert parser to executable

How to run

flex fun.l
bison -d fun.y
gcc -o fun.exe fun.tab.c
fun.exe

About

The project aiming to generate a parser for a custom designed programming language in the extent of CENG 4001 Automata Theory and Formal Languages course.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published