NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Config.ConfigBuilder Class Reference

Public Member Functions

 ConfigBuilder (string file)
 
Configuration Execute ()
 

Public Attributes

IEnumerable< string > Errors => errors
 

Private Attributes

readonly List< string > errors
 
readonly string file
 

Detailed Description

Definition at line 30 of file ConfigBuilder.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Config.ConfigBuilder.ConfigBuilder ( string  file)
inline

Definition at line 32 of file ConfigBuilder.cs.

33  {
34  this.file = file;
35  errors = new List<string>();
36  }
readonly List< string > errors

Member Function Documentation

Configuration Ntp.Analyzer.Config.ConfigBuilder.Execute ( )
inline

Definition at line 44 of file ConfigBuilder.cs.

References Ntp.Analyzer.Config.Compiler.ConfigCompiler.SymbolTable.

45  {
46  SymbolTable table = new SymbolTable();
47  ISyntaxNode node = new RootSyntaxNode();
48 
49  var stages = new List<ICompilerStage>
50  {
51  new ConfigParser(file, node),
52  new SchematicValidator(node),
53  new SymbolResolver(node),
54  new ConfigCompiler(node)
55  };
56 
57  foreach (var stage in stages)
58  {
59  if (errors.Count != 0)
60  continue;
61 
62  stage.SymbolTable = table;
63  stage.Execute();
64  errors.AddRange(stage.Errors);
65  }
66 
67  return errors.Count == 0
68  ? node.CompiledNode as Configuration
69  : null;
70  }
The config compiler transforms syntax nodes into configurations and assemble all missing links...
SymbolTable SymbolTable
Gets or sets the symbol table.
readonly List< string > errors
The config parser transforms configuration texts into a syntax tree.
Definition: ConfigParser.cs:35

Member Data Documentation

readonly List<string> Ntp.Analyzer.Config.ConfigBuilder.errors
private

Definition at line 38 of file ConfigBuilder.cs.

IEnumerable<string> Ntp.Analyzer.Config.ConfigBuilder.Errors => errors

Definition at line 42 of file ConfigBuilder.cs.

readonly string Ntp.Analyzer.Config.ConfigBuilder.file
private

Definition at line 40 of file ConfigBuilder.cs.


The documentation for this class was generated from the following file: