UTDLang Compiler

A Java compiler front-end with a generated lexer and parser, an AST, scoped symbol tables and semantic type checking.

Role
Solo
Stack
  • Java
  • JFlex
  • CUP
  • Compilers
Links

Code for UTDLang Compiler

Terminal showing a UTDLang program with a float and bool ternary, and the type checker reporting incompatible branches
The type checker rejecting incompatible ternary branches
Terminal demo: the compiler rejecting two invalid programs and accepting a 70-line valid one

Problem

A parser can recognize a program without knowing whether it makes sense. This project connects parsing to scoped name resolution and semantic checks.

What I built

Lexer and parser specifications in JFlex and CUP build an abstract syntax tree.

Symbol tables, type information and a semantic-analysis pass check programs after parsing.

A Makefile regenerates the front-end and runs test drivers against sample programs and expected outputs.

Results

  • The repository includes lexer, scanner and type-checking drivers, plus test inputs and expected semantic-analysis outputs.