Index: src/main.cc
===================================================================
--- src/main.cc	(revision 145f1fc837f3fe2237a52a1c4d10dfa54a209da5)
+++ src/main.cc	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
@@ -10,6 +10,6 @@
 // Created On       : Fri May 15 23:12:02 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Mon Jul 06 15:01:26 2015
-// Update Count     : 79
+// Last Modified On : Wed Jul 15 16:45:24 2015
+// Update Count     : 145
 //
 
@@ -54,5 +54,6 @@
 	if ( errorp ) std::cerr << x << std::endl;
 
-void parse( FILE * input, LinkageSpec::Type t, bool shouldExit = false );
+static void parse( FILE * input, LinkageSpec::Type t, bool shouldExit = false );
+static void dump( std::list< Declaration * > & translationUnit );
 
 bool
@@ -64,5 +65,5 @@
 	libcfap = false,
 	nopreludep = false,
-	protop = false,
+	noprotop = false,
 	parsep = false,
 	resolvep = false,									// used in AlternativeFinder
@@ -81,7 +82,7 @@
 	{ "grammar", no_argument, 0, Grammar },
 	{ "libcfa", no_argument, 0, LibCFA },
-	{ "nopreamble", no_argument, 0, Nopreamble },
+	{ "no-preamble", no_argument, 0, Nopreamble },
 	{ "parse", no_argument, 0, Parse },
-	{ "prototypes", no_argument, 0, Prototypes },
+	{ "no-prototypes", no_argument, 0, Prototypes },
 	{ "resolver", no_argument, 0, Resolver },
 	{ "symbol", no_argument, 0, Symbol },
@@ -131,5 +132,5 @@
 		  case Prototypes:
 		  case 'p':										// generate prototypes for preamble functions
-			protop = true;
+			noprotop = true;
 			break;
 		  case Parse:
@@ -221,5 +222,5 @@
 		Parser::get_parser().freeTree();
 		if ( astp ) {
-			printAll( translationUnit, std::cout );
+			dump( translationUnit );
 			return 0;
 		} // if
@@ -242,5 +243,5 @@
 
 		if ( validp ) {
-			printAll( translationUnit, std::cout );
+			dump( translationUnit );
 			return 0;
 		} // if
@@ -252,5 +253,4 @@
 
 		if ( libcfap ) {
-			protop = true;
 			// generate the bodies of cfa library functions
 			LibCfa::makeLibCfa( translationUnit );
@@ -258,5 +258,5 @@
 
 		if ( bresolvep ) {
-			printAll( translationUnit, std::cout );
+			dump( translationUnit );
 			return 0;
 		} // if
@@ -265,5 +265,5 @@
 		ResolvExpr::resolve( translationUnit );
 		if ( exprp ) {
-			printAll( translationUnit, std::cout );
+			dump( translationUnit );
 		}
 
@@ -279,9 +279,9 @@
 		// print tree right before code generation
 		if ( codegenp ) {
-			printAll( translationUnit, std::cout );
-			return 0;
-		} // if
-
-		CodeGen::generate( translationUnit, *output, true ); //protop );
+			dump( translationUnit );
+			return 0;
+		} // if
+
+		CodeGen::generate( translationUnit, *output, ! noprotop );
 
 		if ( output != &std::cout ) {
@@ -290,5 +290,5 @@
 	} catch ( SemanticError &e ) {
 		if ( errorp ) {
-			printAll( translationUnit, std::cerr );
+			dump( translationUnit );
 		}
 		e.print( std::cerr );
@@ -315,5 +315,5 @@
 } // main
 
-void parse( FILE * input, LinkageSpec::Type linkage, bool shouldExit ) {
+static void parse( FILE * input, LinkageSpec::Type linkage, bool shouldExit ) {
 	Parser::get_parser().set_linkage( linkage );
 	Parser::get_parser().parse( input );
@@ -325,4 +325,21 @@
 }
 
+static bool notPrelude( Declaration * decl ) {
+	return ! LinkageSpec::isBuiltin( decl->get_linkage() );
+}
+
+static void dump( std::list< Declaration * > & translationUnit ) {
+	std::list< Declaration * > decls;
+	if ( noprotop ) {
+		filter( translationUnit.begin(), translationUnit.end(), 
+				std::back_inserter( decls ), notPrelude );
+	} else {
+		decls = translationUnit;
+	}
+
+	printAll( decls, std::cout );
+}
+
+
 // Local Variables: //
 // tab-width: 4 //
