Пример #1
0
 public lc(mc mc, work work, m_seg m_seg)
 {
     this.mc    = mc;
     this.work  = work;
     this.m_seg = m_seg;
     setJumpTable();
 }
Пример #2
0
        public MmlDatum[] Compile(Stream sourceMML, Func <string, Stream> appendFileReaderCallback)
        {
            using (StreamReader sr = new StreamReader(sourceMML, Encoding.GetEncoding("Shift_JIS")))
            {
                srcBuf = sr.ReadToEnd();
            }

            this.appendFileReaderCallback = appendFileReaderCallback;

            try
            {
                work = new work();
                mc mc = new mc(this, mcArgs, srcBuf, ffBuf, work, env);
                return(mc.compile_start());
            }
            catch (PmdDosExitException)
            {
                ;
            }
            catch (PmdErrorExitException peee)
            {
                work.compilerInfo.errorList.Add(new Tuple <int, int, string>(-1, -1, peee.Message));
                Log.WriteLine(LogLevel.ERROR, peee.Message);
            }
            catch (PmdException pe)
            {
                work.compilerInfo.errorList.Add(new Tuple <int, int, string>(-1, -1, pe.Message));
                Log.WriteLine(LogLevel.ERROR, pe.Message);
            }
            catch (Exception e)
            {
                work.compilerInfo.errorList.Add(new Tuple <int, int, string>(-1, -1, e.Message));
                Log.WriteLine(LogLevel.ERROR, string.Format(
                                  msg.get("E0000")
                                  , e.Message
                                  , e.StackTrace));
            }

            return(null);
        }