Axiom.RenderSystems.OpenGL.ATI.Compiler2Pass.InitSymbolTypeLib C# (CSharp) Method

InitSymbolTypeLib() protected method

Initialize the type library with matching symbol text found in symbol text library. Find a default text for all Symbol Types in library. Scan through all the rules and initialize TypeLib with index to text and index to rules for non-terminal tokens. Must be called by subclass after libraries and rule database setup.
protected InitSymbolTypeLib ( ) : void
return void
		protected void InitSymbolTypeLib()
		{
			Symbol tokenID;
			// find a default text for all Symbol Types in library

			// scan through all the rules and initialize TypeLib with index to text and index to rules for non-terminal tokens
			for ( int i = 0; i < rulePathLibCount; i++ )
			{
				tokenID = rootRulePath[ i ].tokenID;

				Debug.Assert( symbolTypeLib[ (int)tokenID ].ID == tokenID );

				switch ( rootRulePath[ i ].operation )
				{
					case OperationType.Rule:
						// if operation is a rule then update typelib
						symbolTypeLib[ (int)tokenID ].ruleID = i;
						break;

					case OperationType.And:
					case OperationType.Or:
					case OperationType.Optional:
						if ( rootRulePath[ i ].symbol != null )
						{
							symbolTypeLib[ (int)tokenID ].defTextID = i;
						}
						break;
				} // switch
			} // for
		}