internal virtual void pushStream(LineNumberReader r) { m_readerStack.Push(r); }
} //$NON-NLS-1$ public virtual void execute() { /* dump console message */ displayStartMessage(); /* now fire our keyboard input thread */ System.Threading.Thread t = new System.Threading.Thread(Run); t.Name = "Keyboard input"; //$NON-NLS-1$ t.Start(); /* keep processing streams until we have no more to do */ while (haveStreams()) { try { m_in = popStream(); process(); } catch (EndOfStreamException) { ; /* quite allright */ } catch (IOException io) { System.Collections.IDictionary args = new System.Collections.Hashtable(); args["exceptionMessage"] = io; //$NON-NLS-1$ err(LocalizationManager.getLocalizedTextString("errorWhileProcessingFile", args)); //$NON-NLS-1$ } } /* we done kill everything */ exitSession(); // clear this thing, which also halts our other thread. m_keyboardStream = null; }
internal virtual void doSource() { String name = ""; //$NON-NLS-1$ try { name = nextToken(); StreamReader f = new StreamReader(name, System.Text.Encoding.Default); // push our current source onto the stack and open the new one pushStream(m_in); m_in = new LineNumberReader(f); } catch (System.NullReferenceException) { err(LocalizationManager.getLocalizedTextString("sourceCommandRequiresPath")); //$NON-NLS-1$ } catch (System.ArgumentOutOfRangeException) { err(LocalizationManager.getLocalizedTextString("sourceCommandRequiresPath")); //$NON-NLS-1$ } catch (FileNotFoundException) { System.Collections.IDictionary args = new System.Collections.Hashtable(); args["filename"] = name; //$NON-NLS-1$ err(LocalizationManager.getLocalizedTextString("fileNotFound", args)); //$NON-NLS-1$ } }