Skip to content

Commit 55a1199

Browse files
authored
Dev/remove libhandler (#847)
1 parent acc5581 commit 55a1199

File tree

2 files changed

+90
-2
lines changed

2 files changed

+90
-2
lines changed

Ext/libhandler

Submodule libhandler deleted from 0f1e367

Src/PCompiler/CompilerCore/CompilerConfiguration.cs

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,26 @@
77

88
namespace Plang.Compiler
99
{
10+
/// <summary>
11+
/// Represents the configuration settings for the P language compiler.
12+
/// This class contains all parameters and options that control the compilation process,
13+
/// including input/output paths, code generation options, and project settings.
14+
/// </summary>
1015
public class CompilerConfiguration : ICompilerConfiguration
1116
{
17+
/// <summary>
18+
/// Initializes a new instance of the <see cref="CompilerConfiguration"/> class with default settings.
19+
/// </summary>
20+
/// <remarks>
21+
/// Default settings include:
22+
/// - No output directory
23+
/// - Empty input file lists
24+
/// - "generatedOutput" as project name
25+
/// - Current directory as project root
26+
/// - C# as the default output language
27+
/// - Default location resolver and error handler
28+
/// - Debug mode disabled
29+
/// </remarks>
1230
public CompilerConfiguration()
1331
{
1432
OutputDirectory = null;
@@ -25,6 +43,19 @@ public CompilerConfiguration()
2543
ProjectDependencies = new List<string>();
2644
Debug = false;
2745
}
46+
/// <summary>
47+
/// Initializes a new instance of the <see cref="CompilerConfiguration"/> class with specific settings.
48+
/// </summary>
49+
/// <param name="output">The compiler output handler.</param>
50+
/// <param name="outputDir">The directory where compiler output will be generated.</param>
51+
/// <param name="outputLanguages">The list of target programming languages for code generation.</param>
52+
/// <param name="inputFiles">The list of input files to compile (P files and foreign files).</param>
53+
/// <param name="projectName">The name of the project being compiled. If null, derives from first input file.</param>
54+
/// <param name="projectRoot">The root directory of the project. If null, uses the current directory.</param>
55+
/// <param name="projectDependencies">The list of project dependencies. If null, initializes as empty list.</param>
56+
/// <param name="pObservePackageName">The name of the PObserve package. If null, defaults to "{ProjectName}.pobserve".</param>
57+
/// <param name="debug">Flag indicating whether to include debug information in output.</param>
58+
/// <exception cref="ArgumentException">Thrown when no input files are provided.</exception>
2859
public CompilerConfiguration(ICompilerOutput output, DirectoryInfo outputDir, IList<CompilerOutput> outputLanguages, IList<string> inputFiles,
2960
string projectName, DirectoryInfo projectRoot = null, IList<string> projectDependencies = null, string pObservePackageName = null, bool debug = false)
3061
{
@@ -59,21 +90,79 @@ public CompilerConfiguration(ICompilerOutput output, DirectoryInfo outputDir, IL
5990
Debug = debug;
6091
}
6192

93+
/// <summary>
94+
/// Gets or sets the compiler output handler.
95+
/// </summary>
6296
public ICompilerOutput Output { get; set; }
97+
98+
/// <summary>
99+
/// Gets or sets the directory where compiler output will be generated.
100+
/// </summary>
63101
public DirectoryInfo OutputDirectory { get; set; }
102+
103+
/// <summary>
104+
/// Gets or sets the list of target programming languages for code generation.
105+
/// </summary>
64106
public IList<CompilerOutput> OutputLanguages { get; set; }
107+
108+
/// <summary>
109+
/// Gets or sets the name of the project being compiled.
110+
/// </summary>
65111
public string ProjectName { get; set; }
112+
113+
/// <summary>
114+
/// Gets or sets the name of the PObserve package.
115+
/// </summary>
66116
public string PObservePackageName { get; set; }
117+
118+
/// <summary>
119+
/// Gets or sets the root directory of the project.
120+
/// </summary>
67121
public DirectoryInfo ProjectRootPath { get; set; }
122+
123+
/// <summary>
124+
/// Gets or sets the backend code generator.
125+
/// </summary>
68126
public ICodeGenerator Backend { get; set; }
127+
128+
/// <summary>
129+
/// Gets or sets the list of P language input files to compile.
130+
/// </summary>
69131
public IList<string> InputPFiles { get; set; }
132+
133+
/// <summary>
134+
/// Gets or sets the list of foreign (non-P) input files to include.
135+
/// </summary>
70136
public IList<string> InputForeignFiles { get; set; }
137+
138+
/// <summary>
139+
/// Gets or sets the location resolver for source code positions.
140+
/// </summary>
71141
public ILocationResolver LocationResolver { get; set; }
142+
143+
/// <summary>
144+
/// Gets or sets the handler for translation errors.
145+
/// </summary>
72146
public ITranslationErrorHandler Handler { get; set; }
73147

148+
/// <summary>
149+
/// Gets or sets the list of project dependencies.
150+
/// </summary>
74151
public IList<string> ProjectDependencies { get; set; }
152+
153+
/// <summary>
154+
/// Gets or sets a value indicating whether debug information should be included in output.
155+
/// </summary>
75156
public bool Debug { get; set; }
76157

158+
/// <summary>
159+
/// Copies all properties from another CompilerConfiguration instance to this instance.
160+
/// </summary>
161+
/// <param name="parsedConfig">The source configuration to copy from.</param>
162+
/// <remarks>
163+
/// This method performs a shallow copy of all properties from the specified configuration
164+
/// to the current instance, effectively replacing the current configuration.
165+
/// </remarks>
77166
public void Copy(CompilerConfiguration parsedConfig)
78167
{
79168
Backend = parsedConfig.Backend;
@@ -91,4 +180,4 @@ public void Copy(CompilerConfiguration parsedConfig)
91180
Debug = parsedConfig.Debug;
92181
}
93182
}
94-
}
183+
}

0 commit comments

Comments
 (0)