public bool Parse(string text, int currentPosition, object state, IToken currentToken, out int newPosition, out IToken newToken, out IForwardMovingTokenizer newParser) { //if we can't find a . then we kack var idx = text.IndexOf(".", currentPosition); if (idx == -1) { newPosition = -1; newToken = null; newParser = null; return(false); } else { var substring = text.Substring(currentPosition, idx - currentPosition); newPosition = idx + 1; newToken = NaturalToken.New(substring);//build up the token newParser = new ToOpenParenthesisParser(); return(true); } }
public bool Parse(string text, int currentPosition, object state, IToken currentToken, out int newPosition, out IToken newToken, out IForwardMovingTokenizer newParser) { //if we can't find a . then we kack var idx = text.IndexOf(".", currentPosition); if (idx == -1) { newPosition = -1; newToken = null; newParser = null; return false; } else { var substring = text.Substring(currentPosition, idx - currentPosition); newPosition = idx + 1; newToken = NaturalToken.New(substring);//build up the token newParser = new ToOpenParenthesisParser(); return true; } }