Md. Asif Uddin

    Projects15 of 15

    Compiler symbol table

    Scoped name lookup for a lex and yacc/bison front end

    A scoped symbol table for a compiler front end in lex and yacc/bison, where function parameters land inside their function's scope and every if and for block gets its own. Portable across macOS and Linux.

    What it does

    A scoped symbol table for a compiler front end, written with lex and yacc/bison.

    How it works

    • Lookup. A hash table that hashes the sum of a name’s characters modulo the bucket count.
    • Scopes. A scope stack, kept through parent pointers.
    • Where names land. A scope_started flag with mid-rule actions, so function parameters land inside the function’s scope, while if and for blocks get scopes of their own.

    Portable

    It builds and runs on both macOS and Linux.