Poram++ DSL Compiler

A domain-specific language (DSL) compiler built in C using Lex and Yacc (Flex/Bison) for defining structured form UIs and generating static HTML. Poram++ is CLI-first, fast, and built to run offline. The language is designed to be human-readable yet flexible enough to handle real-world validation, styling, and metadata needs.

Backstory

This started as a university assignment for a Programming Paradigms course — we had to build a DSL that could describe structured data. I chose to build a form description language that could generate HTML. The prototype was basic: hardcoded rules, minimal styling, and raw output.
After the semester ended, I revisited the project during vacation and asked myself:
"Why not finish this properly?"
So I cleaned it up, added proper syntax, validation logic, themes, and CLI flags. I even wrote full documentation and started using it to prototype parts of my own portfolio site. Thus, Poram++ was born.
(Fun fact: it used to be called FormLang++ — but someone told me the word "poram" sounded weird, so naturally I renamed it that.)

Features

  • Built entirely in C with Flex/Bison
  • CLI tool that reads .poram files and outputs HTML
  • DSL includes support for:
    • Nested form sections
    • Input types (text, password, number, etc.)
    • Required fields
    • Inline validation logic (validate { ... })
  • Fully offline and dependency-free
  • Clean memory management, cross-platform friendly
  • Configurable via CLI:
    • Theme: light / dark
    • Shape: rounded / square
    • Style: minimal / fancy

CLI Usage

Build:

make

Run:

./poram -o output/form.html -t dark -s rounded -m fancy < examples/registration.poram
  • If -o is not specified, output will be printed to stdout.

Flags

-o Output HTML file path -o form.html
-t Theme: dark or light -t light
-s Shape: rounded or square -s square
-m Style: minimal or fancy -m fancy

Project Structure

poram-pp/
├── src/            # C source files (parser, lexer, model, main)
├── examples/       # DSL form samples
├── output/         # Output HTML (gitignored)
├── Makefile        # Build instructions
├── GRAMMAR.md      # DSL syntax reference
├── LICENSE         # MIT License
└── README.md

Example DSL

form Registration {
  section Account {
    field username: text required;
    field password: password required;
  }

  validate {
    if password == "1234" {
      error "Password too weak.";
    }
  }
}

GUI Preview (Optional)

Want to test the language visually? Try the lightweight Tauri-based GUI built on top of this compiler:
Screenshot

License

MIT — use it freely, build on top of it, and feel free to submit improvements!