protected String getJsonPathExpression(RuleSetParser.Jsonpath_exprContext jsonpath_expr) { return jsonpath_expr.GetText(); }
protected String getValueExpression(RuleSetParser.Value_exprContext value_expr) { if (value_expr.jsonpath_expr() != null) { return getJsonPathExpression(value_expr.jsonpath_expr()); } return value_expr.GetText(); }
protected List<String> getArray(RuleSetParser.String_arrayContext string_array) { String arrayString = string_array.GetText() .Replace("(", "") .Replace(")", ""); return Regex.Split(arrayString, "\\s*,\\s*").ToList(); }
protected ArithmeticExpression getArithmeticExpression(RuleSetParser.Numeric_exprContext numeric_exprContext) { if (looseArithmeticExpressions.Count > 0) { return looseArithmeticExpressions.Pop(); } throw new ArgumentException("Could not determine ArithmeticExpression from numeric_exprContext: " + numeric_exprContext.GetText()); }
protected ArithmeticExpression getArithmeticExpression(RuleSetParser.Right_arithmetic_exprContext right_arithmetic_exprContext) { if (rightArithmeticExpressions.Count == 1) { return rightArithmeticExpressions.Pop(); } throw new ArgumentException("Could not determine ArithmeticExpression from arithmetic_exprContext: " + right_arithmetic_exprContext.GetText()); }
public override void ExitNumericConstant(RuleSetParser.NumericConstantContext ctx) { this.arithmeticExpressions.Push(new NumericConstant(float.Parse(ctx.GetText()))); }
public override void ExitJsonPathExpression(RuleSetParser.JsonPathExpressionContext ctx) { this.arithmeticExpressions.Push(new NumericField(jsonPathParser, ctx.GetText())); }