Ejemplo n.º 1
0
        // Public interface ////////////////////////////////////////////////////

        public UncheckedAssembly Generate(Declaration.File file)
        {
            // Rename the assembly
            var parseTreeNode = (Syntax.ParseTree.Declaration.File?)file.ParseTreeNode;
            var fileName      = parseTreeNode?.Name ?? "unnamed";

            Builder.Assembly.Name = fileName;
            file = new ElimDependencies(System).Elim(file);
            nameContext.NameAll(file);
            // Eliminate dependent procedures
            // For something to be compiled, it has to be type-checked
            TypeCheck(file);
            // If the type-checking succeeded, we can compile
            Visit(file);
            return(Builder.Assembly);
        }