public String GetOutput(){
		mCurrentState = mInitialState;
		mLastProcessedPos = -1;
		mCurrentLine = 1; // We start with first line of code.
		Initialize();

		// Now the input and analysis.
		mInput = ReadStringFromInput();
		while(mLastProcessedPos < mInput.length() - 1){
			mReaderPos = mLastProcessedPos + 1;
			for(int i = 0; i < mLexRules.size(); ++i) mLexRules.get(i).mENFA.Reset_eNFA(); // Resets the eNFAs for new lexic unit analysis.
			int bestRuleToApplySoFar = Integer.MAX_VALUE;
			Boolean canApplyRule;
			int tempReaderPos = mReaderPos;
			do{ // loops for each character from mReaderPos to the end.
				int bestRuleToApply = Integer.MAX_VALUE;
				canApplyRule = false;
				Boolean breakLoop = true;
				for(int i = 0; i < mLexRules.size(); ++i){
					if (mLexRules.get(i).mLexicalState == mCurrentState && !mLexRules.get(i).mENFA.DoesNotAccept_eNFA()){
						mLexRules.get(i).mENFA.InputChar_eNFA(mInput.charAt(tempReaderPos));
						breakLoop = false;
						if (mLexRules.get(i).mENFA.IsInAcceptableState_eNFA()){
							canApplyRule = true;
							if (i < bestRuleToApply) bestRuleToApply = i;
						}
					}
				}
				if (canApplyRule){
					bestRuleToApplySoFar = bestRuleToApply;
					mReaderPos = tempReaderPos;
				}
				++tempReaderPos;
				if (breakLoop) break; // every automata has rejected our input
			}while(tempReaderPos < mInput.length());

			if (bestRuleToApplySoFar != Integer.MAX_VALUE)ApplyRule(bestRuleToApplySoFar);
			else {
				mLastProcessedPos += 1; // error recovery
				System.err.println("Leksicka pogreska na liniji: " + mCurrentLine);
			}
		}

		// We are done, just output that...
		String outString = "";
		for (int i = 0; i < mOutput.size(); ++i) {
			String str = mOutput.get(i).mUniformToken + " " + mOutput.get(i).mLine + " " + mOutput.get(i).mLexicUint;
			//System.out.println(str);
			outString += str + "\n";
		}
		
		return outString;
	}