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

DoPass1() protected method

perform pass 1 of compile process
Scans source for symbols that can be tokenized and then performs general semantic and context verification on each symbol before it is tokenized. A tokenized instruction list is built to be used by Pass 2.
protected DoPass1 ( ) : bool
return bool
		protected bool DoPass1()
		{
			// scan through Source string and build a token list using TokenInstructions
			// this is a simple brute force lexical scanner/analyzer that also parses the formed
			// token for proper semantics and context in one pass
			currentLine = 1;
			charPos = 0;

			// reset position in Constants container
			constants.Clear();
			endOfSource = source.Length;

			// start with a clean slate
			tokenInstructions.Clear();

			// tokenize and check semantics untill an error occurs or end of source is reached
			// assume RootRulePath has pointer to rules so start at index + 1 for first rule path
			// first rule token would be a rule definition so skip over it
			bool passed = ProcessRulePath( 0 );

			// if a symbol in source still exists then the end of source was not reached and there was a problem some where
			if ( PositionToNextSymbol() )
			{
				passed = false;
			}

			return passed;
		}