/*
 * Title: COP3404Project3Code
 * Author: Matthew Boyette
 * Date: 3/27/2015
 * 
 * This program serves as the entry-point for Projects 3 & 4.
 * See SICXE_AssemblerProgram.java for the implementation.
 */

import api.util.sicxe.SICXE_AssemblerProgram;
import api.util.stdlib.StdOut;

public class COP3404Project3Code
{
	public static final void main(final String[] args)
	{
		SICXE_AssemblerProgram[] programs = new SICXE_AssemblerProgram[args.length];
		
		// Read in files as command-line arguments.
		if (args.length > 0)
		{
			for (int i = 0; i < args.length; i++)
			{
				programs[i] = new SICXE_AssemblerProgram(args[i]);
			}
		}
		else
		{
			StdOut.print("Usage:\n\n\tCOP3404Project3Code [File1] [File2] [File#] ...\n\n" +
				"Example:\n\n\tCOP3404Project3Code input test.txt source.asm\n\n");
		}
	}
}
@@ -248,16 +248,46 @@
 rogram;%0A
+import api.util.stdlib.StdIn;%0A
 import a
@@ -465,16 +465,28 @@
 Program%5B
+Math.max(1, 
 args.len
@@ -488,16 +488,17 @@
 s.length
+)
 %5D;%0A%09%09%0A%09%09
@@ -512,17 +512,28 @@
  in file
-s
+ names given
  as comm
@@ -695,172 +695,294 @@
 %7D%0A%09%09
-else%0A%09%09%7B%0A%09%09%09StdOut.print(%22Usage:%5Cn%5Cn%5CtCOP3404Project3Code %5BFile1%5D %5BFile2%5D %5BFile#%5D ...%5Cn%5Cn%22 +%0A%09%09%09%09%22Example:%5Cn%5Cn%5CtCOP3404Project3Code input test.txt source.asm%5Cn%5Cn%22);
+// Prompt the user for a file name if not given one.%0A%09%09else%0A%09%09%7B%0A%09%09%09StdOut.print(%22Enter source file name: %22);%0A%09%09%09String fileName = StdIn.readString();%0A%09%09%09%0A%09%09%09if (fileName != null)%0A%09%09%09%7B%0A%09%09%09%09if (!fileName.isEmpty())%0A%09%09%09%09%7B%0A%09%09%09%09%09programs%5B0%5D = new SICXE_AssemblerProgram(fileName);%0A%09%09%09%09%7D%0A%09%09%09%7D
 %0A%09%09%7D

Allow Program To Prompt For File If Not Given One