Пример #1
0
Файл: Nmp.cs Проект: jmclain/Nmp
		/////////////////////////////////////////////////////////////////////////////

		public NMP( INmpHost host )
		{
			// ******
			if( null == host ) {
				throw new ArgumentNullException( "host" );
			}

			// ******
			AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler( ResolveEventHandler );
		
			// ******
			//
			// need to make current BEFORE INotification has been created; need to
			// set it up so we can use INotification at this point - maybe new it and
			// set bind it later, or - do we need to bind it ??
			//
			threadContext = ThreadContext.CreateThreadStorage();

			//
			// make sure we're the current context
			//
			using( new NmpMakeCurrent(this) ) {
				gc = new GrandCentral( this, host );
				SetDefaults();
				NmpScannerInitialize( gc.Get<IMacroProcessorBase>(), null );
			}

			// ******
			//
			// see ThreadContext.CreateThreadStorage() above
			//
			ThreadContext.Notifications = Get<INotifications>();
		}
Пример #2
0
		public DefaultRecognizer( GrandCentral gc )
			:	base(gc)
		{
		}
Пример #3
0
		public ParseReader( GrandCentral gc, NmpStack<string> dirStack, string text, string sourceFile, string context )
			: this( gc, dirStack, new ParseStringReader(text, sourceFile), context )
		{
		}
Пример #4
0
		///////////////////////////////////////////////////////////////////////////
		
		//public void	SetSearchPath( string path )
		//{
		//	// ******
		//	//
		//	// clear current path set, split path at ';' and put
		//	// the non emtpy results into SearchPath
		//	//
		//	NmpStringList searchPaths = ThreadContext.SearchPaths;
		//	searchPaths.Clear();

		//	string [] a = path.Split( new char[] {';'} );
		//	
		//	foreach( string s in a ) {
		//		if( s.Length > 0 ) {
		//			searchPaths.Add( s );
		//		}
		//	}
		//}
		
		
		///////////////////////////////////////////////////////////////////////////
		
		public MasterParseReader( GrandCentral gc, NmpStack<string> dirStack, IBaseReader reader )
			:	base( gc, dirStack, reader, "Root source" )
		{
			this.BaseFileName = current.SourceName;
		}
Пример #5
0
		public ParseReader( GrandCentral gc, NmpStack<string> dirStack, IBaseReader reader, string context )
		{
			this.gc = gc;
			this.dirStack = dirStack;
			Initialize( reader, string.IsNullOrEmpty(context) ? "no context" : context );
		}
Пример #6
0
		public ParseReader( GrandCentral gc, NmpStack<string> dirStack, string text )
		{
			this.gc = gc;
			this.dirStack = dirStack;
			Initialize( new ParseStringReader( text ), "no context" );
		}
Пример #7
0
		public ParseReader( GrandCentral gc, NmpStack<string> dirStack )
		{
			this.gc = gc;
			this.dirStack = dirStack;
			Initialize( new ParseStringReader( string.Empty ), "empty reader" );
		}
Пример #8
0
		public NonEscapingParseReader( GrandCentral gc, NmpStack<string> dirStack, string text )
			:	base(gc, dirStack, text)
		{
			CheckEscapesAndSpecialChars = false;
		}
Пример #9
0
		/////////////////////////////////////////////////////////////////////////////

		public BaseRecognizer( GrandCentral gc )
		{
			this.gc = gc;
		}