using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OfficeOpenXml.FormulaParsing.LexicalAnalysis;
using OfficeOpenXml.FormulaParsing.ExpressionGraph;
using OfficeOpenXml.FormulaParsing.ExcelUtilities;
using OfficeOpenXml.FormulaParsing;
using OfficeOpenXml.FormulaParsing.Logging;
namespace OfficeOpenXml.FormulaParsing
{
///
/// Parsing context
///
public class ParsingContext : IParsingLifetimeEventHandler
{
private ParsingContext() { }
///
/// The of the current context.
///
public FormulaParser Parser { get; set; }
///
/// The is an abstraction on top of
/// Excel, in this case EPPlus.
///
public ExcelDataProvider ExcelDataProvider { get; set; }
///
/// Utility for handling addresses
///
public RangeAddressFactory RangeAddressFactory { get; set; }
///
/// of the current context
///
public INameValueProvider NameValueProvider { get; set; }
///
/// Configuration
///
public ParsingConfiguration Configuration { get; set; }
///
/// Scopes, a scope represents the parsing of a cell or a value.
///
public ParsingScopes Scopes { get; private set; }
///
/// Returns true if a is attached to the parser.
///
public bool Debug
{
get { return Configuration.Logger != null; }
}
///
/// Factory method.
///
///
public static ParsingContext Create()
{
var context = new ParsingContext();
context.Configuration = ParsingConfiguration.Create();
context.Scopes = new ParsingScopes(context);
return context;
}
void IParsingLifetimeEventHandler.ParsingCompleted()
{
}
}
}