NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Config.Syntax.HostGraphSyntaxNode Class Reference
Inheritance diagram for Ntp.Analyzer.Config.Syntax.HostGraphSyntaxNode:
Collaboration diagram for Ntp.Analyzer.Config.Syntax.HostGraphSyntaxNode:

Public Member Functions

 HostGraphSyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< HostGraphConfiguration >
void Add (ISyntaxNode node)
 
void Assemble (ISyntaxNode node)
 
Compile ()
 
void CompileNode ()
 
IEnumerator< ISyntaxNodeGetEnumerator ()
 
void Resolve (SymbolTable table)
 
void Validate (SymbolTable table)
 

Protected Member Functions

override HostGraphConfiguration InternalCompile ()
 
override void ValidateMandatories ()
 Override to validates the mandatory types in this syntax node. More...
 
override void ValidateTypes ()
 Override to validates the types in this syntax node. More...
 
- Protected Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< HostGraphConfiguration >
 SyntaxNode (Symbol symbol, string name, int line, bool requirePath=false)
 
void AddError (string message)
 
void AddReferenceNameError (ISyntaxNode node, string keyword, string name)
 
void AddReferenceTypeError (ISyntaxNode node, string keyword, string section, string name)
 
void CheckAllIsPresent (IEnumerable< Symbol > list)
 
void CheckIsUnique (IEnumerable< Symbol > list)
 
Uri CheckLink (string link, string keyword)
 
void CheckOneIsPresent (IEnumerable< Symbol > list)
 
void CheckOnlyOneIsPresent (IEnumerable< Symbol > list)
 
void CheckTypeIs< TU > (Symbol symbol)
 
void CheckTypeIs< TU, TV > (Symbol symbol)
 
virtual void InternalResolve (SymbolTable table)
 Override to resolve references to other syntax nodes from this syntax node. More...
 
virtual void ValidateReferences (SymbolTable table)
 Override to validates the references in this syntax node. More...
 

Additional Inherited Members

- Public Attributes inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< HostGraphConfiguration >
ConfigurationNode CompiledNode
 
IEnumerable< string > Errors
 
bool HasErrors
 
- Properties inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< HostGraphConfiguration >
int Line [get]
 
string Name [get]
 
List< ISyntaxNodeNodes [get]
 
bool RequirePath [get]
 
Symbol Symbol [get]
 

Detailed Description

Definition at line 31 of file HostGraphSyntaxNode.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Config.Syntax.HostGraphSyntaxNode.HostGraphSyntaxNode ( string  name,
int  line 
)
inline

Definition at line 33 of file HostGraphSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordHostGraph.

34  : base(Symbol.KeywordHostGraph, name, line, true)
35  {
36  }

Member Function Documentation

override HostGraphConfiguration Ntp.Analyzer.Config.Syntax.HostGraphSyntaxNode.InternalCompile ( )
inlineprotectedvirtual

Implements Ntp.Analyzer.Config.Syntax.SyntaxNode< HostGraphConfiguration >.

Definition at line 38 of file HostGraphSyntaxNode.cs.

39  {
40  var frequency = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFrequency) as IntegerSettingNode;
41  var initialRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordInitialRun) as BooleanSettingNode;
42  var fixedRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFixedRun) as BooleanSettingNode;
43  var title = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTitle) as StringSettingNode;
44  var width = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordWidth) as IntegerSettingNode;
45  var height = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordHeight) as IntegerSettingNode;
46  var stamp = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTimeStamp) as TimeStampNode ??
47  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphTime) as TimeStampNode;
48  var timespan = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTimespan) as IntegerSettingNode;
49  var filter = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFilterFactor) as NumericSettingNode;
50  var gfrequency = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphFrequency) as NumericSettingNode;
51  var stability = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphStability) as NumericSettingNode;
52  var jitter = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordJitter) as NumericSettingNode;
53  var offset = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordOffset) as NumericSettingNode;
54  var dest = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordDestinations) as FileDestinationSyntaxNode;
55  var links = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordWebLinks) as WebLinkSyntaxNode;
56 
57  return new HostGraphConfiguration(
58  Name,
59  frequency?.Value,
60  initialRun?.Value,
61  fixedRun?.Value,
62  title?.Value,
63  width?.Value,
64  height?.Value,
65  timespan?.Value,
66  stamp?.DateTimeKind,
67  filter?.Value,
68  gfrequency?.Value,
69  stability?.Value,
70  jitter?.Value,
71  offset?.Value,
72  dest?.Compile(),
73  links?.Compile()
74  );
75  }
Host graph configuration used when creating Analyzer.Graph.HostGraph.
override void Ntp.Analyzer.Config.Syntax.HostGraphSyntaxNode.ValidateMandatories ( )
inlineprotectedvirtual

Override to validates the mandatory types in this syntax node.

When overriding this method do not call the base method.

Reimplemented from Ntp.Analyzer.Config.Syntax.SyntaxNode< HostGraphConfiguration >.

Definition at line 77 of file HostGraphSyntaxNode.cs.

78  {
79  CheckIsUnique(new List<Symbol>
80  {
81  Symbol.KeywordFrequency,
82  Symbol.KeywordInitialRun,
83  Symbol.KeywordFixedRun,
84  Symbol.KeywordTitle,
85  Symbol.KeywordWidth,
86  Symbol.KeywordHeight,
87  Symbol.KeywordTimespan,
88  Symbol.KeywordTimeStamp,
89  Symbol.KeywordGraphTime,
90  Symbol.KeywordFilterFactor,
91  Symbol.KeywordGraphFrequency,
92  Symbol.KeywordGraphStability,
93  Symbol.KeywordJitter,
94  Symbol.KeywordOffset,
95  Symbol.KeywordDestinations,
96  Symbol.KeywordWebLinks
97  });
98 
99  CheckAllIsPresent(new List<Symbol>
100  {
101  Symbol.KeywordTitle,
102  Symbol.KeywordDestinations
103  });
104 
105  CheckOneIsPresent(new List<Symbol>
106  {
107  Symbol.KeywordGraphFrequency,
108  Symbol.KeywordGraphStability,
109  Symbol.KeywordJitter,
110  Symbol.KeywordOffset
111  });
112 
113  CheckOnlyOneIsPresent(new List<Symbol>
114  {
115  Symbol.KeywordGraphTime,
116  Symbol.KeywordTimeStamp
117  });
118  }
override void Ntp.Analyzer.Config.Syntax.HostGraphSyntaxNode.ValidateTypes ( )
inlineprotectedvirtual

Override to validates the types in this syntax node.

When overriding this method do not call the base method.

Reimplemented from Ntp.Analyzer.Config.Syntax.SyntaxNode< HostGraphConfiguration >.

Definition at line 120 of file HostGraphSyntaxNode.cs.

121  {
122  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordFrequency);
123  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordInitialRun);
124  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordFixedRun);
125  CheckTypeIs<StringSettingNode>(Symbol.KeywordTitle);
126  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordWidth);
127  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordHeight);
128  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordTimespan);
129  CheckTypeIs<TimeStampNode>(Symbol.KeywordTimeStamp);
130  CheckTypeIs<TimeStampNode>(Symbol.KeywordGraphTime);
131  CheckTypeIs<NumericSettingNode>(Symbol.KeywordFilterFactor);
132  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphFrequency);
133  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphStability);
134  CheckTypeIs<NumericSettingNode>(Symbol.KeywordJitter);
135  CheckTypeIs<NumericSettingNode>(Symbol.KeywordOffset);
136  }

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