Package nexj.core.scripting

Examples of nexj.core.scripting.Parser


      {
         sCommand = null;
      }

      Reader reader = (sCommand != null) ? new StringReader(sCommand) : m_reader;
      Parser parser = getParser();
      String sStartupMessage;

      setReader(reader);

      try
      {
         sStartupMessage = startup();
      }
      catch (nexj.core.tools.GenericREPL.LoginException t)
      {
         Throwable cause = t.getCause();

         setExitCode(EXIT_LOGIN);

         if (!m_bQuiet)
         {
            m_writer.write("; Login error: " + cause.getMessage());
            m_writer.write(SysUtil.LINE_SEP);
            m_writer.flush();
         }

         s_logger.info("Login error", cause);

         return;
      }

      if (sCommand == null && !m_bQuiet)
      {
         m_writer.write("; NexJ Scheme");
         m_writer.write(SysUtil.LINE_SEP);

         if (sStartupMessage != null)
         {
            m_writer.write("; " + sStartupMessage);
            m_writer.write(SysUtil.LINE_SEP);
         }

         m_writer.flush();
      }

      for (;;)
      {
         if (sCommand == null && !m_bQuiet)
         {
            m_writer.write(SysUtil.LINE_SEP);
            m_writer.write("> ");
            m_writer.flush();
         }

         try
         {
            Object expr = parser.parse(reader, null);

            if (expr == Parser.EOF)
            {
               break;
            }
View Full Code Here

TOP

Related Classes of nexj.core.scripting.Parser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.