/// <summary> /// Loads a CSV state table from a stream. /// </summary> /// <param name="srInputReader">The stream to read the state table from.</param> /// <returns>Returns an FSA containing states built from the given stream.</returns> public static FSA FromStream(StreamReader srInputReader) { FSA fsaFinal = new FSA(); string[] saStates = srInputReader.ReadLine().Split(FSAState.c_acSplitters); while (!srInputReader.EndOfStream) { fsaFinal.m_lfsAllStates.Add(FSAState.FromString(srInputReader.ReadLine(), saStates)); } srInputReader.Close(); return(fsaFinal); }
//private constructor private JsonTokenizer() { m_fsaAutomaton = FSA.FromStream(ResourceManager.GetManager().GetResourceStream("LexerTable.csv")); }
/// <summary> /// Loads a CSV state table from a stream. /// </summary> /// <param name="srInputReader">The stream to read the state table from.</param> /// <returns>Returns an FSA containing states built from the given stream.</returns> public static FSA FromStream(StreamReader srInputReader) { FSA fsaFinal = new FSA(); string[] saStates = srInputReader.ReadLine().Split(FSAState.c_acSplitters); while (!srInputReader.EndOfStream) fsaFinal.m_lfsAllStates.Add(FSAState.FromString(srInputReader.ReadLine(), saStates)); srInputReader.Close(); return fsaFinal; }