Expression Parse_OpSubstring() { Expression expr = Parse_OpConcat(); for (;;) { TokenType op = m_Tokenizer.PeekNextToken().type; switch (op) { case TokenType.OpContains: m_Tokenizer.ConsumeNextToken(); expr = new OpContains(expr, Parse_OpConcat()); break; case TokenType.OpStartsWith: m_Tokenizer.ConsumeNextToken(); expr = new OpStartsWith(expr, Parse_OpConcat()); break; case TokenType.OpEndsWith: m_Tokenizer.ConsumeNextToken(); expr = new OpEndsWith(expr, Parse_OpConcat()); break; default: return(expr); } } }
Expression Parse_OpSubstring() { Expression expr = Parse_OpConcat(); for (;;) { TokenType op = m_Tokenizer.PeekNextToken().type; switch (op) { case TokenType.OpContains: m_Tokenizer.ConsumeNextToken(); expr = new OpContains(expr, Parse_OpConcat()); break; case TokenType.OpStartsWith: m_Tokenizer.ConsumeNextToken(); expr = new OpStartsWith(expr, Parse_OpConcat()); break; case TokenType.OpEndsWith: m_Tokenizer.ConsumeNextToken(); expr = new OpEndsWith(expr, Parse_OpConcat()); break; default: return expr; } } }