private static Expression ParseComparisonExpression(Scanner scanner) { Expression left = ParseBitshiftExpression(scanner); while (true) { if (scanner.TryGetDelimiter("<")) { Expression right = ParseBitshiftExpression(scanner); left = new LessExpression(left, right); } else if (scanner.TryGetDelimiter("<=")) { Expression right = ParseBitshiftExpression(scanner); left = new LessOrEqualExpression(left, right); } else if (scanner.TryGetDelimiter(">")) { Expression right = ParseBitshiftExpression(scanner); left = new GreaterExpression(left, right); } else if (scanner.TryGetDelimiter(">=")) { Expression right = ParseBitshiftExpression(scanner); left = new GreaterOrEqualExpression(left, right); } else { return(left); } } }
private static Expression ParseComparisonExpression(Scanner scanner) { Expression left = ParseBitshiftExpression(scanner); while (true) { if (scanner.TryGetDelimiter("<")) { Expression right = ParseBitshiftExpression(scanner); left = new LessExpression(left,right); } else if (scanner.TryGetDelimiter("<=")) { Expression right = ParseBitshiftExpression(scanner); left = new LessOrEqualExpression(left,right); } else if (scanner.TryGetDelimiter(">")) { Expression right = ParseBitshiftExpression(scanner); left = new GreaterExpression(left,right); } else if (scanner.TryGetDelimiter(">=")) { Expression right = ParseBitshiftExpression(scanner); left = new GreaterOrEqualExpression(left,right); } else { return left; } } }