Example #1
0
        private void CreateLookupItems()
        {
            LookupItems.MakeFunctor("push", scope => PushCommand((CallScope)scope), SymbolKindEnum.PRECOMMAND);
            LookupItems.MakeFunctor("pop", scope => PopCommand((CallScope)scope), SymbolKindEnum.PRECOMMAND);

            LookupItems.MakeOptionFunctors(Options);
            LookupItems.MakeOptionHandlers(Options);
        }
Example #2
0
        private void CreateLookupItems()
        {
            // a
            LookupItems.MakeFunctor("a", scope => GetWrapper((CallScope)scope, a => GetAmount(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("amount", scope => GetWrapper((CallScope)scope, a => GetAmount(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("account", scope => GetAccount((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("account_base", scope => GetWrapper((CallScope)scope, a => Value.StringValue(a.Name)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("addr", scope => GetWrapper((CallScope)scope, a => Value.Get(a) /* [DM] Address is not allowed in .Net; return a whole entity */), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("any", scope => FnAny((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("all", scope => FnAll((CallScope)scope), SymbolKindEnum.FUNCTION);

            // c
            LookupItems.MakeFunctor("count", scope => GetWrapper((CallScope)scope, a => GetCount(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("cost", scope => GetWrapper((CallScope)scope, a => GetCost(a)), SymbolKindEnum.FUNCTION);

            // d
            LookupItems.MakeFunctor("depth", scope => GetWrapper((CallScope)scope, a => GetDepth(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("depth_parent", scope => GetWrapper((CallScope)scope, a => GetDepthParent(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("depth_spacer", scope => GetWrapper((CallScope)scope, a => GetDepthSpacer(a)), SymbolKindEnum.FUNCTION);

            // e
            LookupItems.MakeFunctor("earliest", scope => GetWrapper((CallScope)scope, a => GetEarliest(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("earliest_checkin", scope => GetWrapper((CallScope)scope, a => GetEarliestCheckin(a)), SymbolKindEnum.FUNCTION);

            // i
            LookupItems.MakeFunctor("is_account", scope => Value.True, SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("is_index", scope => GetWrapper((CallScope)scope, a => GetSubcount(a)), SymbolKindEnum.FUNCTION);

            // l
            LookupItems.MakeFunctor("l", scope => GetWrapper((CallScope)scope, a => GetDepth(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("latest_cleared", scope => GetWrapper((CallScope)scope, a => GetLatestCleared(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("latest", scope => GetWrapper((CallScope)scope, a => GetLatest(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("latest_checkout", scope => GetWrapper((CallScope)scope, a => GetLatestCheckout(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("latest_checkout_cleared", scope => GetWrapper((CallScope)scope, a => GetLatestCheckoutCleared(a)), SymbolKindEnum.FUNCTION);

            // n
            LookupItems.MakeFunctor("n", scope => GetWrapper((CallScope)scope, a => GetSubcount(a)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("note", scope => GetWrapper((CallScope)scope, a => GetNote(a)), SymbolKindEnum.FUNCTION);

            // p
            LookupItems.MakeFunctor("partial_account", scope => GetPartialName((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("parent", scope => GetWrapper((CallScope)scope, a => Value.ScopeValue(a.Parent)), SymbolKindEnum.FUNCTION);

            // s
            LookupItems.MakeFunctor("subcount", scope => GetWrapper((CallScope)scope, a => GetSubcount(a)), SymbolKindEnum.FUNCTION);

            // t
            LookupItems.MakeFunctor("total", scope => GetWrapper((CallScope)scope, a => GetTotal(a)), SymbolKindEnum.FUNCTION);

            // u
            LookupItems.MakeFunctor("use_direct_amount", scope => Value.False /* ignore */, SymbolKindEnum.FUNCTION);

            // N
            LookupItems.MakeFunctor("N", scope => GetWrapper((CallScope)scope, a => GetCount(a)), SymbolKindEnum.FUNCTION);

            // O
            LookupItems.MakeFunctor("O", scope => GetWrapper((CallScope)scope, a => GetTotal(a)), SymbolKindEnum.FUNCTION);
        }
Example #3
0
 private void CreateLookupItems()
 {
     LookupItems.MakeFunctor("account", scope => FnAccount((CallScope)scope));
     LookupItems.MakeFunctor("lot_price", scope => FnLotPrice((CallScope)scope));
     LookupItems.MakeFunctor("lot_date", scope => FnLotDate((CallScope)scope));
     LookupItems.MakeFunctor("lot_tag", scope => FnLotTag((CallScope)scope));
     LookupItems.MakeFunctor("int", scope => FnInt((CallScope)scope));
     LookupItems.MakeFunctor("min", scope => FnMin((CallScope)scope));
     LookupItems.MakeFunctor("max", scope => FnMax((CallScope)scope));
     LookupItems.MakeFunctor("str", scope => FnStr((CallScope)scope));
     // Check if they are trying to access an option's setting or value.
     LookupItems.MakeOptionFunctors(Options);
     LookupItems.MakeOptionHandlers(Options);
 }
Example #4
0
        private void CreateLookupItems()
        {
            // a
            LookupItems.MakeFunctor("any", scope => FnAny((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("all", scope => FnAll((CallScope)scope), SymbolKindEnum.FUNCTION);

            // c
            LookupItems.MakeFunctor("code", scope => GetWrapper((CallScope)scope, x => GetCode(x)), SymbolKindEnum.FUNCTION);

            // m
            LookupItems.MakeFunctor("magnitude", scope => GetWrapper((CallScope)scope, x => x.Magnitude()), SymbolKindEnum.FUNCTION);

            // p
            LookupItems.MakeFunctor("p", scope => GetWrapper((CallScope)scope, x => Value.StringValue(x.Payee)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("payee", scope => GetWrapper((CallScope)scope, x => Value.StringValue(x.Payee)), SymbolKindEnum.FUNCTION);
        }
Example #5
0
 public override ExprOp Lookup(SymbolKindEnum kind, string name)
 {
     return(LookupItems.Lookup(kind, name, this) ?? base.Lookup(kind, name));
 }
Example #6
0
 public IEnumerable <LookupItem> GetLookupItemsByCategoryId(LookupItems cId)
 {
     return(GetAllLookupItems(lc => lc.LookupId == (int)cId));
 }
Example #7
0
        private void CreateLookupItems()
        {
            // a
            LookupItems.MakeFunctor("actual", scope => GetWrapper((CallScope)scope, p => GetActual(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("actual_date", scope => GetWrapper((CallScope)scope, p => GetPrimaryDate(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("addr", scope => GetWrapper((CallScope)scope, p => Value.Get(p) /* Not allowed in .Net */), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("aux_date", scope => GetWrapper((CallScope)scope, p => GetAuxDate(p)), SymbolKindEnum.FUNCTION);

            // b
            LookupItems.MakeFunctor("beg_line", scope => GetWrapper((CallScope)scope, p => GetBegLine(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("beg_pos", scope => GetWrapper((CallScope)scope, p => GetBegPos(p)), SymbolKindEnum.FUNCTION);

            // c
            LookupItems.MakeFunctor("cleared", scope => GetWrapper((CallScope)scope, p => GetCleared(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("comment", scope => GetWrapper((CallScope)scope, p => GetComment(p)), SymbolKindEnum.FUNCTION);

            // d
            LookupItems.MakeFunctor("d", scope => GetWrapper((CallScope)scope, p => Value.Get(p.GetDate())), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("date", scope => GetWrapper((CallScope)scope, p => Value.Get(p.GetDate())), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("depth", scope => Value.Zero, SymbolKindEnum.FUNCTION);

            // e
            LookupItems.MakeFunctor("end_line", scope => GetWrapper((CallScope)scope, p => GetEndLine(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("end_pos", scope => GetWrapper((CallScope)scope, p => GetEndPos(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("effective_date", scope => GetWrapper((CallScope)scope, p => GetAuxDate(p)), SymbolKindEnum.FUNCTION);

            // f
            LookupItems.MakeFunctor("filename", scope => GetWrapper((CallScope)scope, p => GetPathName(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("filebase", scope => GetWrapper((CallScope)scope, p => GetFileBase(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("filepath", scope => GetWrapper((CallScope)scope, p => GetFilePath(p)), SymbolKindEnum.FUNCTION);

            // h
            LookupItems.MakeFunctor("has_tag", scope => HasTag((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("has_meta", scope => HasTag((CallScope)scope), SymbolKindEnum.FUNCTION);

            // i
            LookupItems.MakeFunctor("is_account", scope => Value.False /* ignore */, SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("id", scope => GetWrapper((CallScope)scope, p => GetId(p)), SymbolKindEnum.FUNCTION);

            // m
            LookupItems.MakeFunctor("meta", scope => GetTag((CallScope)scope), SymbolKindEnum.FUNCTION);

            // n
            LookupItems.MakeFunctor("note", scope => GetWrapper((CallScope)scope, p => GetNote(p)), SymbolKindEnum.FUNCTION);

            // p
            LookupItems.MakeFunctor("pending", scope => GetWrapper((CallScope)scope, p => GetPending(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("parent", scope => Value.False /* ignore */, SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("primary_date", scope => GetWrapper((CallScope)scope, p => GetPrimaryDate(p)), SymbolKindEnum.FUNCTION);

            // s
            LookupItems.MakeFunctor("status", scope => GetWrapper((CallScope)scope, p => GetStatus(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("state", scope => GetWrapper((CallScope)scope, p => GetStatus(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("seq", scope => GetWrapper((CallScope)scope, p => Value.Get(p.Seq)), SymbolKindEnum.FUNCTION);

            // t
            LookupItems.MakeFunctor("tag", scope => GetTag((CallScope)scope), SymbolKindEnum.FUNCTION);

            // u
            LookupItems.MakeFunctor("uncleared", scope => GetWrapper((CallScope)scope, p => GetUncleared(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("uuid", scope => GetWrapper((CallScope)scope, p => GetId(p)), SymbolKindEnum.FUNCTION);

            // v
            LookupItems.MakeFunctor("value_date", scope => GetWrapper((CallScope)scope, p => Value.Get(p.Date)), SymbolKindEnum.FUNCTION);

            // L
            LookupItems.MakeFunctor("L", scope => GetWrapper((CallScope)scope, p => GetActual(p)), SymbolKindEnum.FUNCTION);

            // X
            LookupItems.MakeFunctor("X", scope => GetWrapper((CallScope)scope, p => GetCleared(p)), SymbolKindEnum.FUNCTION);

            // Y
            LookupItems.MakeFunctor("Y", scope => GetWrapper((CallScope)scope, p => GetPending(p)), SymbolKindEnum.FUNCTION);
        }
Example #8
0
        private void CreateLookupItems()
        {
            // a
            LookupItems.MakeFunctor("a", scope => GetWrapper((CallScope)scope, p => GetAmount(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("amount", scope => GetWrapper((CallScope)scope, p => GetAmount(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("account", scope => GetAccount((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("account_base", scope => GetWrapper((CallScope)scope, p => GetAccountBase(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("account_id", scope => GetWrapper((CallScope)scope, p => GetAccountId(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("any", scope => FnAny((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("all", scope => FnAll((CallScope)scope), SymbolKindEnum.FUNCTION);

            // b
            LookupItems.MakeFunctor("b", scope => GetWrapper((CallScope)scope, p => GetCost(p)), SymbolKindEnum.FUNCTION);

            // c
            LookupItems.MakeFunctor("code", scope => GetWrapper((CallScope)scope, p => GetCode(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("cost", scope => GetWrapper((CallScope)scope, p => GetCost(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("cost_calculated", scope => GetWrapper((CallScope)scope, p => GetIsCostCalculated(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("count", scope => GetWrapper((CallScope)scope, p => GetCount(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("calculated", scope => GetWrapper((CallScope)scope, p => GetIsCalculated(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("commodity", scope => GetCommodity((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("checkin", scope => GetWrapper((CallScope)scope, p => GetCheckin(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("checkout", scope => GetWrapper((CallScope)scope, p => GetCheckout(p)), SymbolKindEnum.FUNCTION);

            // d
            LookupItems.MakeFunctor("display_account", scope => GetDisplayAccount((CallScope)scope), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("depth", scope => GetWrapper((CallScope)scope, p => GetAccountDepth(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("datetime", scope => GetWrapper((CallScope)scope, p => GetDateTime(p)), SymbolKindEnum.FUNCTION);

            // h
            LookupItems.MakeFunctor("has_cost", scope => GetWrapper((CallScope)scope, p => GetHasCost(p)), SymbolKindEnum.FUNCTION);

            // i
            LookupItems.MakeFunctor("index", scope => GetWrapper((CallScope)scope, p => GetCount(p)), SymbolKindEnum.FUNCTION);

            // m
            LookupItems.MakeFunctor("magnitude", scope => GetWrapper((CallScope)scope, p => GetMagnitude(p)), SymbolKindEnum.FUNCTION);

            // n
            LookupItems.MakeFunctor("n", scope => GetWrapper((CallScope)scope, p => GetCount(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("note", scope => GetWrapper((CallScope)scope, p => GetNote(p)), SymbolKindEnum.FUNCTION);

            // p
            LookupItems.MakeFunctor("post", scope => GetWrapper((CallScope)scope, p => Value.ScopeValue(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("payee", scope => GetWrapper((CallScope)scope, p => Value.StringValue(p.Payee)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("primary", scope => GetWrapper((CallScope)scope, p => GetCommodityIsPrimary(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("price", scope => GetWrapper((CallScope)scope, p => GetPrice(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("parent", scope => GetWrapper((CallScope)scope, p => GetXact(p)), SymbolKindEnum.FUNCTION);

            // r
            LookupItems.MakeFunctor("real", scope => GetWrapper((CallScope)scope, p => GetReal(p)), SymbolKindEnum.FUNCTION);

            // t
            LookupItems.MakeFunctor("total", scope => GetWrapper((CallScope)scope, p => GetTotal(p)), SymbolKindEnum.FUNCTION);

            // u
            LookupItems.MakeFunctor("use_direct_amount", scope => GetWrapper((CallScope)scope, p => GetUseDirectAmount(p)), SymbolKindEnum.FUNCTION);

            // v
            LookupItems.MakeFunctor("virtual", scope => GetWrapper((CallScope)scope, p => GetVirtual(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("value_date", scope => GetWrapper((CallScope)scope, p => GetValueDate(p)), SymbolKindEnum.FUNCTION);

            // x
            LookupItems.MakeFunctor("xact", scope => GetWrapper((CallScope)scope, p => GetXact(p)), SymbolKindEnum.FUNCTION);
            LookupItems.MakeFunctor("xact_id", scope => GetWrapper((CallScope)scope, p => GetXactId(p)), SymbolKindEnum.FUNCTION);

            // N
            LookupItems.MakeFunctor("N", scope => GetWrapper((CallScope)scope, p => GetCount(p)), SymbolKindEnum.FUNCTION);

            // O
            LookupItems.MakeFunctor("O", scope => GetWrapper((CallScope)scope, p => GetTotal(p)), SymbolKindEnum.FUNCTION);

            // R
            LookupItems.MakeFunctor("R", scope => GetWrapper((CallScope)scope, p => GetReal(p)), SymbolKindEnum.FUNCTION);
        }