Giter Site home page Giter Site logo

compiler's Introduction

Project of the Compilers and Languages Module

Simple Programming Language using Lexx and Yacc

Contributers

Abdallah Sobehy ([Abdallah-Sobehy] (https://github.com/Abdallah-Sobehy))

Mostafa Fateen ([MFateen] (https://github.com/MFateen))

Ramy Alfred ([ramyalfred] (https://github.com/ramyalfred))

Yousra Samir

Running Steps

  • flex lex.l
  • yacc -d yacc.y
  • gcc lex.yy.c y.tab.c -o compiler

The Project comprises the following

  • Design a suitable programming language; you may use a mini version of an existing one
    • Variables declaration
    • Constants declaration.
    • Mathematical and logical expressions.
    • Assignment statement.
    • If-then-else statement, while loops, repeat-until loops, for loops, switch statement.
    • Block structure (nested scopes where variables may be declared at the beginning of blocks).
    • [optional] Functions
  • Design a suitable and extensible format for the symbol table.
  • Implement the lexical analyzer using Lex.
  • Design suitable action rules to produce the output quadruples and implement your parser using YACC.
  • Implement a proper syntax error handler.
  • Build a simple semantic analyzer
    • Variable declaration conflicts. i.e. multiple declaration off the same variable.
    • Improper usage of variables with regard to their type.
    • [optional] Addition of type conversion quadruples to coupe with operators semantic requirements, i.e. converting integer to real, etc.
    • Variables used before being initialized and unused variables.
  • Implement a simple GUI.

Phases Delivery schedule: https://docs.google.com/document/d/1yKnRmjnohVbQjooCrwVUGWwnZnTipGHUCsdW_T_MNoM/edit

compiler's People

Contributors

abdallah-sobehy avatar mfateen avatar ramyalfred avatar

Stargazers

Mohamed Salama avatar Hala  avatar Noran Hany avatar Aditya Verma avatar Ritik Hariani avatar neo yang avatar Hamid Nasr avatar

Watchers

 avatar  avatar

compiler's Issues

token.y:449:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode

token.y: In function 'print_symbol_table':
token.y:262:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0 ; i < 26 ; i ++){
^
token.y:262:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
token.y: In function 'close_brace':
token.y:449:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < 26; i++) {

How to resolve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.