Skip to content
Browse files

raptortech97's changes

  • Loading branch information...
1 parent 803318b commit e59363f5384fffa765632cb543035dacead51803 @Radvendii committed Mar 3, 2012
Showing with 32 additions and 0 deletions.
  1. +32 −0 Shell.java
View
32 Shell.java
@@ -0,0 +1,32 @@
+public class Shell
+{
+ private final String prompt = ">";
+
+ public static void main(String[] args)
+ {
+ StringHolder comms = new StringHolder(); // Initializes StringHolder
+ while(true)
+ {
+ String in = getStringFromShell(prompt);
+ comms.add(in);
+ RunCode run = new RunCode(comms.toFile());
+ System.out.println(comms.toFile());
+ run.comprun();
+ }
+ }
+
+ //get String or simply enter from shell
+ public static String getStringFromShell(String prompt)
+ {
+ try
+ {
+ System.out.print(prompt);
+ return new BufferedReader(new InputStreamReader(System.in)).readLine();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ return null ;
+ }
+}

0 comments on commit e59363f

Please sign in to comment.
Something went wrong with that request. Please try again.