예제 #1
0
 public FwXmlOutput(XmlWriter writer, bool fDotrace, PatrParser patr, string patrlexPath)
     : base(writer)
 {
     m_fDotrace    = fDotrace;
     m_patr        = patr;
     m_patrlexPath = patrlexPath;
 }
예제 #2
0
 public FwXmlOutput(XmlWriter writer, bool fDotrace, PatrParser patr, string patrlexPath, FdoCache cache)
     : base(writer)
 {
     m_fDotrace    = fDotrace;
     m_patr        = patr;
     m_patrlexPath = patrlexPath;
     m_cache       = cache;
 }
예제 #3
0
 public void LoadLexiconFile()
 {
     using (var parser = new PatrParser())
     {
         parser.CommentChar = '|';
         parser.CodePage    = Encoding.UTF8.CodePage;
         Assert.NotNull(parser);
         parser.LoadLexiconFile(LexiconFileName, 1);
     }
 }
예제 #4
0
 internal override void InitParser()
 {
     CheckDisposed();
     m_patr               = new PatrParser();
     m_patr.CommentChar   = '|';
     m_patr.CodePage      = Encoding.UTF8.CodePage;
     m_loader             = new XmlLoader();
     m_loader.XmlResolver = new XmlFwResolver();
     m_loader.QuitOnError = false;
 }
예제 #5
0
 protected override void Dispose(bool disposing)
 {
     if (disposing && !IsDisposed)
     {
         if (m_patr != null)
         {
             m_patr.Dispose();
             m_patr = null;
         }
     }
     base.Dispose(disposing);
 }
예제 #6
0
 public HCParserWorker(FdoCache cache, Action <TaskReport> taskUpdateHandler, IdleQueue idleQueue)
     : base(cache, taskUpdateHandler, idleQueue,
            cache.ServiceLocator.GetInstance <ICmAgentRepository>().GetObject(CmAgentTags.kguidAgentHermitCrabParser))
 {
     m_outputDirectory = Path.GetTempPath();
     m_patr            = new PatrParser
     {
         CommentChar = '|',
         CodePage    = Encoding.UTF8.CodePage
     };
     m_loader = new XmlLoader
     {
         XmlResolver = new XmlFwResolver(),
         QuitOnError = false
     };
 }
예제 #7
0
        protected PatrParser CreateAndSetupTestParser()
        {
            PatrParser parser = null;

            try
            {
                parser = new PatrParser {
                    CommentChar = '|', CodePage = Encoding.UTF8.CodePage
                };
                Assert.NotNull(parser);
                parser.LoadGrammarFile(GrammarFileName);
                parser.LoadLexiconFile(LexiconFileName, 1);

                return(parser);
            }
            catch (Exception)
            {
                if (parser != null)
                {
                    parser.Dispose();
                }
                throw;
            }
        }
예제 #8
0
		internal override void InitParser()
		{
			CheckDisposed();
			m_patr = new PatrParser();
			m_patr.CommentChar = '|';
			m_patr.CodePage = Encoding.UTF8.CodePage;
			m_loader = new XmlLoader();
			m_loader.XmlResolver = new XmlFwResolver();
			m_loader.QuitOnError = false;
		}
예제 #9
0
			public FwXmlOutput(XmlWriter writer, bool fDotrace, PatrParser patr, string patrlexPath)
				: base(writer)
			{
				m_fDotrace = fDotrace;
				m_patr = patr;
				m_patrlexPath = patrlexPath;
			}