- Parse the input, building an abstract syntax tree of the declarations.
- Build a type graph and interconnect the type nodes so that types can be resolved.
- Resolve all type references (using fixups or in a separate pass if forward references allowed.)
- Invoke one or more backends if the resulting tree is valid.
Tuesday, February 14, 2006
I've recently been working on an custom IDL compiler that can target Python and C++. Think COM, only portable between platforms and targeted towards a select few languages. A lot of patterns immediately appear in both the frontend and backends of the compiler that's just boilerplate work. Consider the classic implementation of an IDL parser (or any programming language parser, for that matter):