public ReturnContext @return() { ReturnContext _localctx = new ReturnContext(Context, State); EnterRule(_localctx, 16, RULE_return); try { EnterOuterAlt(_localctx, 1); { State = 72; Match(T__11); State = 73; Match(NUMBER); State = 74; Match(T__8); } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public void BeforeReturn(ReturnContext context) { if (traceEnabled) { traceBuffer.AppendLine(context.ToString()); } }
private static void CheckReturn(ReturnContext r, string returnType, Action <CompileException, Context> onError, SymbolTable table) { var expressionType = GetExpressionType(r.Children.First.Value, onError, table); if (expressionType != returnType) { onError(new CompileException($"Return expression does not match return type"), r); } }
public dynamic GetValue(ReturnContext context, object data) { Model.Supplier supplier = data as Model.Supplier; if (supplier == null) { return new Result(ResultStatus.Error, "餐厅不存在"); } return new Result(ResultStatus.Ok); }
/// <summary> /// build the XPTNode of a return statement /// </summary> /// <param name="ctx"></param> /// <returns></returns> public bool BuildXPTNode(ReturnContext ctx) { if (ctx.selectExpression() != null) { ctx.XPTreeNode = new Return(@return: (IExpression)ctx.selectExpression().XPTreeNode, engine: this.Engine); return(true); } return(false); }
public dynamic GetValue(ReturnContext context, object data) { PageList<Model.Supplier> page = data as PageList<Model.Supplier>; return new ResultWithData<PageList<DetailSupplierModel>>(ResultStatus.Ok, new PageList<DetailSupplierModel>() { TotalRows = page.TotalRows, Collections = page.Collections.Select(m => m.ToDetailSupplierModel()).ToList() }); }
public bool IsMapped(ReturnContext context) { int v = StringHelper.ToInt32(context.Version, 0); if (context.SystemId.ToUpper() == "APP" && v >= this.Order) { return(true); } return(false); }
public dynamic GetValue(ReturnContext context, object data) { Model.Supplier supplier = data as Model.Supplier; if (supplier == null) { return new ResultWithData<DetailSupplierModel>(ResultStatus.Error, null, "餐厅不存在"); } return new ResultWithData<DetailSupplierModel>(ResultStatus.Ok, supplier.ToDetailSupplierModel()); }
public override dynamic GetValue(ReturnContext context, object data) { var supplier = data as M.Supplier; if (supplier.GetBrokenRules().Count > 0) { var borkenRule = supplier.GetBrokenRules()[0]; return(this.ResultValue(Int32.Parse(borkenRule.Name), false, borkenRule.Description)); } return(this.ResultValue(data: true)); }
public dynamic GetValue(ReturnContext context, object data) { Model.Supplier supplier = data as Model.Supplier; if (supplier == null) { return new Result(ResultStatus.Error, "餐厅不存在"); } if (supplier.GetBrokenRules().Count > 0) { return new Result(ResultStatus.Error, supplier.GetBrokenRules()[0].Description); } return new Result(ResultStatus.Ok); }
public override dynamic GetValue(ReturnContext context, object data) { DomainModel.Category foodCategory = data as DomainModel.Category; if (foodCategory.GetBrokenRules().Count > 0) { var brokenRule = foodCategory.GetBrokenRules()[0]; return(this.ResultValue <CategoryModel>(Int32.Parse(brokenRule.Name), null, brokenRule.Description)); } return(this.ResultValue(data: new CategoryModel() { CategoryName = foodCategory.CategoryName, Id = foodCategory.Id, Sort = foodCategory.Sort, FoodCount = foodCategory.FoodCount })); }
public dynamic GetValue(ReturnContext context, object data) { PageList<Model.Supplier> page = data as PageList<Model.Supplier>; return new ResultWithData<PageList<dynamic>>(ResultStatus.Ok, new PageList<dynamic>() { TotalRows = page.TotalRows, Collections = page.Collections.Select(m => new { Id = m.Id, Name = m.Name, Tel = m.Tel, Address = m.Address, DeliveryStatus = m.CurrentDeliveryStatus, BusinessStatus = m.CurrentBusinessStatus }).ToList<dynamic>() }); }
public override dynamic GetValue(ReturnContext context, object data) { PageList <DomainModel.Category> tempList = data as PageList <DomainModel.Category>; int totalRows = tempList.TotalRows; IList <DomainModel.Category> list = tempList.Collections; List <CategoryModel> result = new List <CategoryModel>(); foreach (var item in list) { var temp = new CategoryModel() { CategoryName = item.CategoryName, Id = item.Id, Sort = item.Sort, FoodCount = item.FoodCount }; result.Add(temp); } return(this.ResultValue(data: new PageList <CategoryModel> { Collections = result, TotalRows = totalRows })); }
public bool IsMapped(ReturnContext context) { return context.SystemId == "app"; }
internal override void SaveToReturnContext(ReturnContext returnContext) { returnContext.SerializeType = SerializeTypes.json; }
public abstract dynamic GetValue(ReturnContext context, object data);
public dynamic GetValue(ReturnContext context, object data) { IEnumerable<Model.Delivery> deliverys = data as IEnumerable<Model.Delivery>; return new ResultWithData<IEnumerable<DeliveryModel>>(ResultStatus.Ok, deliverys.Select(m => m.ToDeliveryModel())); }
private LarkResult(HttpResponseMessage httpResponseMessage, ReturnContext returnContext) { this.httpResponseMessage = httpResponseMessage; this.returnContext = returnContext; }
internal static LarkResult GetResult(HttpResponseMessage httpResponseMessage, ReturnContext returnContext) { return(new LarkResult(httpResponseMessage, returnContext)); }
public bool IsMapped(ReturnContext context) { return context.SystemId == "pc" || string.IsNullOrEmpty(context.SystemId); }
/// <summary> /// build the XPTNode of a return statement /// </summary> /// <param name="ctx"></param> /// <returns></returns> public bool BuildXPTNode(ReturnContext ctx) { if (ctx.selectExpression() != null) { ctx.XPTreeNode = new Return(@return: (IExpression) ctx.selectExpression().XPTreeNode, engine: this.Engine); return true; } return false; }
public bool IsMapped(ReturnContext context) { return true; }
internal virtual void SaveToReturnContext(ReturnContext returnContext) { }
public override dynamic GetValue(ReturnContext context, object data) { string str = data.ToString(); return(this.ResultValue(data: str)); }
public QueryAstBuilder() { _selectContext = new SelectContext(this); _returnContext = new ReturnContext(this); }