Exemple #1
0
        private static ExprOpCollection CreateLookupItems()
        {
            var lookupItems = new ExprOpCollection();

            // 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);

            return(lookupItems);
        }
Exemple #2
0
        private static ExprOpCollection CreateLookupItems()
        {
            var lookupItems = new ExprOpCollection();

            // 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);

            return(lookupItems);
        }
Exemple #3
0
        private static ExprOpCollection CreateLookupItems()
        {
            ExprOpCollection lookupItems = new ExprOpCollection();

            // 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);

            return(lookupItems);
        }
Exemple #4
0
        private static ExprOpCollection CreateLookupItems()
        {
            var lookupItems = new ExprOpCollection();

            // 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);

            return(lookupItems);
        }