Skip to content

Latest commit

 

History

History

asg3

LALR(1) Parser using bison

Overview

Builds off of the previous assignment. A parser is added to the compiler project which parses the grammar of the custom language used in the class. The parser generates an abstract syntax tree which stores the tokens of the input file in a tree format and includes the following grammar definitions:

  • Structures
  • Identifiers
  • Types
  • Expressions
  • Operators (Unary, Binary, Variadic, Allocators, Parentheses)
  • Statement Keywords (while, if-else, return, blocks, semicolons, expressions, variable declarations)
  • Function Definitions

The abstract syntax tree is printed in readable format to an output file.

Credits

Institution: University of California, Santa Cruz
Course: Fundamentals of Compiler Design I
Professor: Wesley, Mackey
Student(s): Wai Chun Leung, Shineng Tang