import { NavBar, PageHeader } from "@/components/nav"; import { InfoBox } from "@/components/infoBox"; import { CodeBlock } from "@/components/code"; export default function Page() { return ( <>

Learning ygen


Welcome to the ygen-book! Here you will learn how to build a simple compiler with ygen. I won't cover how to implement the parser, lexer, semnatic analayis here but you can refere to our examples.

Our ast (Abstract Syntax Tree)


Every language has a ast which represents the expressions and statements. For our language we will have following statements:

, body: Vec, }, RetStmt{ to_return: Expr, }, ConstStmt{ name: String, extern: bool, import: bool, data: Vec, }, }`}/>
); }