public AnalyzeResult O(string stream, int startPosition) { AnalyzeResult result = new AnalyzeResult(); AnalyzeResult additionalResult = new AnalyzeResult(); if (stream[startPosition] == '+' || stream[startPosition] == '-' || stream[startPosition] == '*' || stream[startPosition] == '/') { result.Result = true; result.Token = new Token(TokenType.Operator, stream[startPosition].ToString(), startPosition); return(result); } else { result.Result = false; return(result); } }
public AnalyzeResult N(string stream, int startPosition) { AnalyzeResult result = new AnalyzeResult(); AnalyzeResult additionalResult = new AnalyzeResult(); if (stream[startPosition] == '(' || stream[startPosition] == ')') { result.Result = true; result.Token = new Token(TokenType.Nawias, stream[startPosition].ToString(), startPosition); return(result); } else { result.Result = false; return(result); } }
public AnalyzeResult S(string stream, int startPosition) { AnalyzeResult result = new AnalyzeResult(); if ((result = B(stream, startPosition)).Result) { return(result); } if ((result = O(stream, startPosition)).Result) { return(result); } if ((result = N(stream, startPosition)).Result) { return(result); } if ((result = L(stream, startPosition)).Result) { return(result); } return(result); }