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:
-
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.
-
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.
-
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.
To run the solutions, navigate to the desired folder and follow compilation instructions.