Skip to content

A compiler for "Extetricks", a domain-specific language for Tetris-like games, using Flex and Bison. Implemented lexical analysis, parsing, and abstract syntax tree generation.

Notifications You must be signed in to change notification settings

Nandish02/Tetris-Compiler-Construction

Repository files navigation

Readme for CS F363: Compiler Construction

This repository contains the code for the course CS F363: Compiler Construction at BITS Pilani. The code is written in Python and the course is taught by Dr Ramprasad Joshi.

Contents

  1. Extetricks: A domain-specific language for configuring and scripting a Tetris-like game.
  2. gameEngine: A simple game engine that can be used to create text-based games. (provided by the instructor)
  3. parser: A parser developed during the course, Uses Bison to define the grammar rules of Extetricks and generates a parser to create an abstract syntax tree.
  4. scanner: A scanner developed during the course, Uses Flex to define the lexical analysis rules and generates a scanner that breaks down the input Extetricks code into tokens.
  5. Makefile: A makefile to build the project, test it on sample inputs.
  6. README.md: This file.

Usage

  1. Clone the repository.
  2. Run make clean to remove any previous builds.
  3. Run make build to build the project.
  4. Run make test to test the project on sample inputs.
  5. Run make run to run the project.

Images

1stpage 2ndpage

3rdpage

Features of the tetris game implemented

  • New Game: Start a fresh game session.

  • Pause: Temporarily halt the current game.

  • Save State: Save the current game state to continue later.

  • Exit/Quit: Close the game application.

  • About: View information about the game and its development.

  • Score Display: The player's score is displayed as "Number of lines cleared = [Score]."

  • Game Over: The game ends when no more moves are possible, and a "Game Over" message is displayed.

Acknowledgements

The code for the game engine is provided by the instructor. The code for the parser and scanner is developed in discussion with the following students:

  1. Shreyas V (2020B2A71350G)
  2. Shah Rahil Kirankumar (2020B2A71677G)
  3. Pranav Srikanth (2020B5A71865G)
  4. Nandish Chokshi (2020B1A72031G)
  5. Anish Sreenivas (2020B3A71464G)

About

A compiler for "Extetricks", a domain-specific language for Tetris-like games, using Flex and Bison. Implemented lexical analysis, parsing, and abstract syntax tree generation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published