Example #1
0
 /// <summary>Creates a new tokenizer for the specified input stream.</summary>
 /// <param name='input'>the input stream to read</param>
 /// <param name='settings'>Formula additional settings like ListSeparator and NumberDecimalSeparator</param>
 /// <exception cref='ParserCreationException'>if the tokenizer couldn't be initialized correctly</exception>
 public FormulaTokenizer(TextReader input, FormulaParserSettings settings)
     : base(input, true)
 {
     // Use the arg separator from the current culture
     Settings = settings;
     CreatePatterns();
 }
Example #2
0
 private FormulaEngine(SerializationInfo info, StreamingContext context)
 {
     DependencyManager    = (DependencyManager)info.GetValue("DependencyManager", typeof(DependencyManager));
     ReferencePool        = (ReferencePool)info.GetValue("ReferencePool", typeof(ReferencePool));
     _referenceFormulaMap = (IDictionary)info.GetValue("ReferenceFormulaMap", typeof(IDictionary));
     Sheets           = (SheetCollection)info.GetValue("SheetManager", typeof(SheetCollection));
     FunctionLibrary  = (FunctionLibrary)info.GetValue("FunctionLibrary", typeof(FunctionLibrary));
     Info             = new FormulaEngineInfo(this);
     ReferenceFactory = new ReferenceFactory(this);
     Settings         = new FormulaParserSettings();
     Parser           = CreateParser();
 }
Example #3
0
 public FormulaEngine(FormulaParserSettings settings = null)
 {
     _referenceFormulaMap = new Hashtable();
     FunctionLibrary      = new FunctionLibrary(this);
     DependencyManager    = new DependencyManager(this);
     ReferenceFactory     = new ReferenceFactory(this);
     ReferencePool        = new ReferencePool(this);
     Sheets   = new SheetCollection(this);
     Info     = new FormulaEngineInfo(this);
     Settings = settings ?? new FormulaParserSettings();
     Parser   = CreateParser();
 }
Example #4
0
 /// <summary>Creates a new parser.</summary>
 /// <param name='input'>the input stream to read from</param>
 /// <param name='settings'>Formula additional settings like ListSeparator and NumberDecimalSeparator</param>
 /// <param name='analyzer'>the analyzer to parse with</param>
 /// <exception cref='ParserCreationException'>if the parser couldn't be initialized correctly</exception>
 public FormulaParser(TextReader input, FormulaParserSettings settings, Analyzer analyzer) :
     base(new FormulaTokenizer(input, settings), analyzer)
 {
     CreatePatterns();
 }