Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1023 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 1023 Bytes

Compiler Phases Implementation: Lexical and Syntax Analysis

Welcome to Group 6 repository for the CPT316 assignment on implementing the lexical and syntax analysis phases of a compiler.

Instructions to Run

  1. Clone the repository: git clone https://github.com/ahdeanlau/CPT316_Assignment_1.
  2. Navigate to the source directory: cd CPT316_Assignment_1.
  3. Run the program: python parse_code.py

Displaying the AST

  1. Open the generated syntax_tree.dot file.
  2. Copy the contents of the file.
  3. Paste the contents into the Graphviz Online Editor.

Objective

This project aims to:

  1. Provide hands-on experience in implementing the lexical and syntax analysis phases of a compiler.
  2. Understand the role of these phases in parsing source code and generating an abstract syntax tree (AST).
  3. Enhance our problem-solving and coding skills in building a functional compiler component.
  4. Document our implementation to make it clear and comprehensible for others.