(refer to the expected AST node layouts in the comments of types.js)
types.js
Here is also a simple C# version.