public void visitSourceFile(SourceFile node) 
	throws ACCError
    {
	emitter.emitPreamble(node);
	emitter.emitSeparatorComment();
	emitter.emitComment("Assembly file generated by");
	emitter.emitComment("the AppleCore Compiler, v1.0");
	emitter.emitSeparatorComment();
	if (!node.includeMode) {
	    emitter.emitIncludeDirective("AVM.PROLOGUE.AVM");
	    FunctionDecl firstFunction = null;
	    for (Declaration decl : node.decls) {
		if (decl instanceof FunctionDecl) {
		    FunctionDecl functionDecl = (FunctionDecl) decl;
		    if (firstFunction == null && !functionDecl.isExternal) {
			firstFunction = (FunctionDecl) decl;
		    }
		}
	    }
	    if (firstFunction != null) {
		emitter.emitComment("do main function");
		emitter.emitAbsoluteInstruction("JSR",
						emitter.makeLabel(firstFunction.name));
		emitter.emitComment("exit to BASIC");
		emitter.emitAbsoluteInstruction("JMP","EXIT");
	    }
	    emitter.emitSeparatorComment();
	}
	emitter.emitComment("START OF FILE " + node.name);
	emitter.emitSeparatorComment();
	
	super.visitSourceFile(node);

	emitter.emitSeparatorComment();
	emitter.emitComment("END OF FILE " + node.name);
	emitter.emitSeparatorComment();
	if (!node.includeMode) {
	    emitter.emitEpilogue();
	}
    }