/// <summary> /// Constructor. /// </summary> /// <param name="configuration">Configuration</param> private CompilationContext(LanguageServicesConfiguration configuration) { this.Configuration = configuration; this.ActiveCompilationTarget = configuration.CompilationTargets.First(); this.SolutionMap = new Dictionary<CompilationTarget, Solution>(); this.PSharpProjectMap = new Dictionary<CompilationTarget, List<PSharpProject>>(); }
/// <summary> /// Create a new P# compilation context. /// </summary> /// <param name="configuration">Configuration</param> /// <returns>CompilationContext</returns> public static CompilationContext Create(LanguageServicesConfiguration configuration) { return new CompilationContext(configuration); }
/// <summary> /// Create a new P# compilation context using the default /// configuration. /// </summary> /// <returns>CompilationContext</returns> public static CompilationContext Create() { var configuration = new LanguageServicesConfiguration(); return new CompilationContext(configuration); }
/// <summary> /// Constructor. /// </summary> /// <param name="configuration">Configuration</param> /// <param name="project">Project</param> private AnalysisContext(LanguageServicesConfiguration configuration, Project project) { this.Configuration = configuration; this.Solution = project.Solution; this.Compilation = project.GetCompilationAsync().Result; this.Machines = new List<ClassDeclarationSyntax>(); this.MachineInheritance = new Dictionary<ClassDeclarationSyntax, ClassDeclarationSyntax>(); this.MachineActions = new Dictionary<ClassDeclarationSyntax, List<string>>(); this.Summaries = new Dictionary<BaseMethodDeclarationSyntax, MethodSummary>(); this.StateTransitionGraphs = new Dictionary<ClassDeclarationSyntax, StateTransitionGraphNode>(); // Finds all the machines in the project. this.FindAllMachines(); // Finds machine inheritance information. this.FindMachineInheritanceInformation(); // Find all machine actions in the project. this.FindAllMachineActions(); }
/// <summary> /// Create a new P# static analysis context from the given project. /// </summary> /// <param name="configuration">Configuration</param> /// <param name="project">Project</param> /// <returns>AnalysisContext</returns> public static AnalysisContext Create(LanguageServicesConfiguration configuration, Project project) { return new AnalysisContext(configuration, project); }