/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> internal BaseMachineVisitor(PSharpProject project, List <Tuple <SyntaxToken, string> > errorLog) : base(project, errorLog) { this.Actions = new Dictionary <ClassDeclarationSyntax, List <MethodDeclarationSyntax> >(); this.ActionsThatRaise = new Dictionary <ClassDeclarationSyntax, List <MethodDeclarationSyntax> >(); this.ActionsThaPop = new Dictionary <ClassDeclarationSyntax, List <MethodDeclarationSyntax> >(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> /// <param name="warningLog">Warning log</param> protected BaseVisitor(PSharpProject project, List<Tuple<SyntaxToken, string>> errorLog, List<Tuple<SyntaxToken, string>> warningLog) { this.Project = project; this.ErrorLog = errorLog; this.WarningLog = warningLog; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> internal BaseMachineVisitor(PSharpProject project, List<Tuple<SyntaxToken, string>> errorLog) : base(project, errorLog) { this.Actions = new Dictionary<ClassDeclarationSyntax, List<MethodDeclarationSyntax>>(); this.ActionsThatRaise = new Dictionary<ClassDeclarationSyntax, List<MethodDeclarationSyntax>>(); this.ActionsThaPop = new Dictionary<ClassDeclarationSyntax, List<MethodDeclarationSyntax>>(); }
/// <summary> /// Runs the P# parsing engine. /// </summary> public void Run() { // Parse the projects. if (this.CompilationContext.Configuration.ProjectName.Equals("")) { foreach (var project in this.CompilationContext.GetSolution().Projects) { var psharpProject = new PSharpProject(this.CompilationContext, project.Name); psharpProject.Parse(); this.CompilationContext.GetProjects().Add(psharpProject); } } else { // Find the project specified by the user. var targetProject = this.CompilationContext.GetSolution().Projects.Where( p => p.Name.Equals(this.CompilationContext.Configuration.ProjectName)).FirstOrDefault(); var projectDependencyGraph = this.CompilationContext.GetSolution().GetProjectDependencyGraph(); var projectDependencies = projectDependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(targetProject.Id); foreach (var project in this.CompilationContext.GetSolution().Projects) { if (!projectDependencies.Contains(project.Id) && !project.Id.Equals(targetProject.Id)) { continue; } var psharpProject = new PSharpProject(this.CompilationContext, project.Name); psharpProject.Parse(); this.CompilationContext.GetProjects().Add(psharpProject); } } }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> /// <param name="warningLog">Warning log</param> protected BaseVisitor(PSharpProject project, List <Tuple <SyntaxToken, string> > errorLog, List <Tuple <SyntaxToken, string> > warningLog) { this.Project = project; this.ErrorLog = errorLog; this.WarningLog = warningLog; }
/// <summary> /// Runs the P# parsing engine. /// </summary> public static void Run() { ParsingEngine.PSharpProjects = new List<PSharpProject>(); // Parse the projects. if (Configuration.ProjectName.Equals("")) { foreach (var project in ProgramInfo.Solution.Projects) { var psharpProject = new PSharpProject(project.Name); psharpProject.Parse(); ParsingEngine.PSharpProjects.Add(psharpProject); } } else { // Find the project specified by the user. var targetProject = ProgramInfo.Solution.Projects.Where( p => p.Name.Equals(Configuration.ProjectName)).FirstOrDefault(); var projectDependencyGraph = ProgramInfo.Solution.GetProjectDependencyGraph(); var projectDependencies = projectDependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(targetProject.Id); foreach (var project in ProgramInfo.Solution.Projects) { if (!projectDependencies.Contains(project.Id) && !project.Id.Equals(targetProject.Id)) { continue; } var psharpProject = new PSharpProject(project.Name); psharpProject.Parse(); ParsingEngine.PSharpProjects.Add(psharpProject); } } // Rewrite the projects. for (int idx = 0; idx < ParsingEngine.PSharpProjects.Count; idx++) { ParsingEngine.PSharpProjects[idx].Rewrite(); } }
/// <summary> /// Runs the P# parsing engine. /// </summary> public static void Run() { ParsingEngine.PSharpProjects = new List <PSharpProject>(); // Parse the projects. if (Configuration.ProjectName.Equals("")) { foreach (var project in ProgramInfo.Solution.Projects) { var psharpProject = new PSharpProject(project.Name); psharpProject.Parse(); ParsingEngine.PSharpProjects.Add(psharpProject); } } else { // Find the project specified by the user. var targetProject = ProgramInfo.Solution.Projects.Where( p => p.Name.Equals(Configuration.ProjectName)).FirstOrDefault(); var projectDependencyGraph = ProgramInfo.Solution.GetProjectDependencyGraph(); var projectDependencies = projectDependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(targetProject.Id); foreach (var project in ProgramInfo.Solution.Projects) { if (!projectDependencies.Contains(project.Id) && !project.Id.Equals(targetProject.Id)) { continue; } var psharpProject = new PSharpProject(project.Name); psharpProject.Parse(); ParsingEngine.PSharpProjects.Add(psharpProject); } } // Rewrite the projects. for (int idx = 0; idx < ParsingEngine.PSharpProjects.Count; idx++) { ParsingEngine.PSharpProjects[idx].Rewrite(); } }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal RaiseRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="exitAtError">Exits at error</param> internal PParser(PSharpProject project, SyntaxTree tree, bool exitAtError = true) : base(project, tree, exitAtError) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> public PSharpProgram(PSharpProject project, SyntaxTree tree) : base(project, tree) { this.UsingDeclarations = new List <UsingDeclaration>(); this.NamespaceDeclarations = new List <NamespaceDeclaration>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> protected CSharpRewriter(PSharpProject project) { this.Project = project; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal PopRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal MonitorRewriter(PSharpProject project) : base(project) { this.ToRemove = new List <SyntaxNode>(); }
/// <summary> /// Initializes a new instance of the <see cref="MachineDeclarationParser"/> class. /// </summary> internal MachineDeclarationParser(PSharpProject project, List <Tuple <SyntaxToken, string> > errorLog, List <Tuple <SyntaxToken, string> > warningLog) : base(project, errorLog, warningLog) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal NondeterministicChoiceRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="exitAtError">Exits at error</param> internal BaseParser(PSharpProject project, SyntaxTree tree, bool exitAtError) { this.Project = project; this.SyntaxTree = tree; this.IsRunningInternally = exitAtError; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal TriggerRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal AssertRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="skipErrorChecking">Skips error checking</param> internal CSharpParser(PSharpProject project, SyntaxTree tree, bool skipErrorChecking) : base(project, tree, false) { this.ErrorLog = new List <Tuple <SyntaxToken, string> >(); this.SkipErrorChecking = skipErrorChecking; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal HaltEventRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal SendRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> internal MonitorStateDeclarationParser(PSharpProject project, List <Tuple <SyntaxToken, string> > errorLog) : base(project, errorLog) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal FieldAccessRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> /// <param name="warningLog">Warning log</param> internal BaseStateVisitor(PSharpProject project, List<Tuple<SyntaxToken, string>> errorLog, List<Tuple<SyntaxToken, string>> warningLog) : base(project, errorLog, warningLog) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="exitAtError">Exits at error</param> internal PSharpParser(PSharpProject project, SyntaxTree tree, bool exitAtError = true) : base(project, tree, exitAtError) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="skipErrorChecking">Skips error checking</param> internal CSharpParser(PSharpProject project, SyntaxTree tree, bool skipErrorChecking) : base(project, tree, false) { this.ErrorLog = new List<Tuple<SyntaxToken, string>>(); this.SkipErrorChecking = skipErrorChecking; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal PopRewriter(PSharpProject project) : base(project) { this.PopStmts = new List <StatementSyntax>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal MachineTypeRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> /// <param name="warningLog">Warning log</param> internal MonitorDeclarationParser(PSharpProject project, List<Tuple<SyntaxToken, string>> errorLog, List<Tuple<SyntaxToken, string>> warningLog) : base(project, errorLog, warningLog) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="options">ParsingOptions</param> internal BaseParser(PSharpProject project, SyntaxTree tree, ParsingOptions options) { this.Project = project; this.SyntaxTree = tree; this.Options = options; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal PayloadRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal ThisRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="options">ParsingOptions</param> internal TokenParser(PSharpProject project, SyntaxTree tree, ParsingOptions options) : base(project, tree, options) { this.ErrorLog = new StringBuilder(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="options">ParsingOptions</param> internal PSharpParser(PSharpProject project, SyntaxTree tree, ParsingOptions options) : base(project, tree, options) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> /// <param name="exitAtError">Exits at error</param> internal TokenParser(PSharpProject project, SyntaxTree tree, bool exitAtError) : base(project, tree, exitAtError) { this.ErrorLog = ""; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="tree">SyntaxTree</param> internal AbstractPSharpProgram(PSharpProject project, SyntaxTree tree) { this.Project = project; this.SyntaxTree = tree; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="filePath">SyntaxTree</param> public PProgram(PSharpProject project, SyntaxTree tree) : base(project, tree) { this.EventDeclarations = new List <EventDeclaration>(); this.MachineDeclarations = new List <MachineDeclaration>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal MonitorRewriter(PSharpProject project) : base(project) { this.ToRemove = new List<SyntaxNode>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal CreateMachineRewriter(PSharpProject project) : base(project) { this.ToReplace = new List<SyntaxNode>(); this.ToRemove = new List<SyntaxNode>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal FairNondetRewriter(PSharpProject project) : base(project) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="filePath">SyntaxTree</param> public PProgram(PSharpProject project, SyntaxTree tree) : base(project, tree) { this.EventDeclarations = new List<EventDeclaration>(); this.MachineDeclarations = new List<MachineDeclaration>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> internal MachineDeclarationParser(PSharpProject project, List<Tuple<SyntaxToken, string>> errorLog) : base(project, errorLog) { }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal CreateMachineRewriter(PSharpProject project) : base(project) { this.ToReplace = new List <SyntaxNode>(); this.ToRemove = new List <SyntaxNode>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> internal RaiseRewriter(PSharpProject project) : base(project) { this.RaiseStmts = new List<ExpressionStatementSyntax>(); }
/// <summary> /// Initializes a new instance of the <see cref="CSharpParser"/> class. /// </summary> internal CSharpParser(PSharpProject project, SyntaxTree tree, ParsingOptions options) : base(project, tree, options) { this.ErrorLog = new List <Tuple <SyntaxToken, string> >(); this.WarningLog = new List <Tuple <SyntaxToken, string> >(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">PSharpProject</param> /// <param name="errorLog">Error log</param> internal BaseStateVisitor(PSharpProject project, List <Tuple <SyntaxToken, string> > errorLog) : base(project, errorLog) { }