Exemplo n.º 1
0
            public ParseContext(String expression, ITraceWriter trace, IEnumerable <IFunctionInfo> extensions)
            {
                if (trace == null)
                {
                    throw new ArgumentNullException(nameof(trace));
                }

                Expression = expression ?? String.Empty;
                Trace      = trace;
                foreach (IFunctionInfo extension in (extensions ?? new IFunctionInfo[0]))
                {
                    ExtensionFunctions.Add(extension.Name, extension);
                }

                Lexer = new LexicalAnalyzer(Expression, trace, ExtensionFunctions.Keys);
            }
Exemplo n.º 2
0
            public ParseContext(String expression, ITraceWriter trace, IEnumerable <INamedValueInfo> namedValues, IEnumerable <IFunctionInfo> functions)
            {
                if (trace == null)
                {
                    throw new ArgumentNullException(nameof(trace));
                }

                Expression = expression ?? String.Empty;
                Trace      = trace;
                foreach (INamedValueInfo namedValueInfo in (namedValues ?? new INamedValueInfo[0]))
                {
                    ExtensionNamedValues.Add(namedValueInfo.Name, namedValueInfo);
                }

                foreach (IFunctionInfo functionInfo in (functions ?? new IFunctionInfo[0]))
                {
                    ExtensionFunctions.Add(functionInfo.Name, functionInfo);
                }

                Lexer = new LexicalAnalyzer(Expression, trace, namedValues: ExtensionNamedValues.Keys, functions: ExtensionFunctions.Keys);
            }