4 ms·
The method is based on the idea that the product of the semantic pass of a compiler is a symbol table. Then, to make imports work: 1. add some syntax to import
by WalterBright 5y ago
The method is based on the idea that the product of the semantic pass of a compiler is a symbol table. Then, to make imports work:
1. add some syntax to import a module
2. create another instance of the compiler to compile that module and return the symbol table
3. have the importer, when it doesn't find a symbol in the symbol table, to search the symbol tables of the imports