There are several ways to have typed information to AST 1:

Here is various pages describing AST representation in production systems:

The following articles also provide good information on AST representation

Footnotes

  1. How to store types after Semantic Analysis (note)