public override Func <IReadOnlyList <IGrammarTerm>, decimal> VisitFxRateFunc(MyGrammarParser.FxRateFuncContext context)
        {
            var termId       = context.GetText();
            var currencyPair = context.currencyPair().GetText();
            var term         = new FxRateTerm(termId, CurrencyPairIdentifier.ParseExact(currencyPair));

            _terms.Add(term);
            return(x => x.First(t => t.TermId == term.TermId).Value);
        }
Пример #2
0
        public override Func <IReadOnlyList <ExpressionTerm>, decimal> VisitFxRateFunc(MyGrammarParser.FxRateFuncContext context)
        {
            var currencyPair = context.currencyPair().GetText();

            _terms.Add(new ExpressionTerm(currencyPair));
            return(x => x.First(y => y.TermId == currencyPair).Value);
        }