示例#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;
			}