/CS155-Projects

This repository contains my solutions to the machine problems for CS155. These problems focus on lexical analysis and parsing, utilizing tools like Flex and Bison.

Primary LanguageLex

CS155 Machine Problems Solutions

This repository contains my solutions to the machine problems for CS155, focusing on lexical analysis and parsing using Flex and Bison. The repository is organized into three main folders, each addressing different aspects of the course's machine problems:

Folder Structure

  1. Lexer and Parser - Simple Arithmetic

    • Description: This folder contains solutions for lexical analysis and parsing of simple arithmetic expressions. The lexer tokenizes input expressions, while the parser constructs a syntax tree to evaluate them.
  2. Lexer for EASY-C Grammar

    • Description: This folder focuses on lexical analysis for a simplified version of the C programming language, named EASY-C. The lexer identifies tokens such as keywords, identifiers, operators, and literals in EASY-C source code.
  3. Three-Address Code Generator

    • Description: This folder includes a lexer and parser that generate three-address code (TAC) for simple arithmetic expressions. The TAC is an intermediate representation used in compilers to facilitate optimization and code generation.

Getting Started

To run the solutions, navigate to the desired folder and follow compilation instructions.