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

Public Member Functions

 SummariesSyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< SummaryCollection >
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 SummaryCollection InternalCompile ()
 
override void InternalResolve (SymbolTable table)
 
override void ValidateMandatories ()
 Override to validates the mandatory types in this syntax node. More...
 
override void ValidateReferences (SymbolTable table)
 
override void ValidateTypes ()
 Override to validates the types in this syntax node. More...
 
- Protected Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< SummaryCollection >
 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...
 

Private Attributes

readonly List< PeerSummaryPageSyntaxNodepages
 

Additional Inherited Members

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

Detailed Description

Definition at line 30 of file SummariesSyntaxNode.cs.

Constructor & Destructor Documentation

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

Definition at line 32 of file SummariesSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordSummaries.

33  : base(Symbol.KeywordSummaries, name, line, true)
34  {
35  pages = new List<PeerSummaryPageSyntaxNode>();
36  }
readonly List< PeerSummaryPageSyntaxNode > pages

Member Function Documentation

override SummaryCollection Ntp.Analyzer.Config.Syntax.SummariesSyntaxNode.InternalCompile ( )
inlineprotectedvirtual
override void Ntp.Analyzer.Config.Syntax.SummariesSyntaxNode.InternalResolve ( SymbolTable  table)
inlineprotected

Definition at line 45 of file SummariesSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.SymbolTable.Lookup().

46  {
47  pages.AddRange(
48  Nodes.
49  Where(n => n.Symbol == Symbol.KeywordPeerSummaryPage).
50  Cast<StringSettingNode>().
51  Select(page => table.Lookup(page.Value)).
52  Cast<PeerSummaryPageSyntaxNode>()
53  );
54  }
readonly List< PeerSummaryPageSyntaxNode > pages
ISyntaxNode Lookup(string name)
Definition: SymbolTable.cs:41

Here is the call graph for this function:

override void Ntp.Analyzer.Config.Syntax.SummariesSyntaxNode.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< SummaryCollection >.

Definition at line 56 of file SummariesSyntaxNode.cs.

57  {
58  CheckAllIsPresent(new List<Symbol> {Symbol.KeywordPeerSummaryPage});
59  }
override void Ntp.Analyzer.Config.Syntax.SummariesSyntaxNode.ValidateReferences ( SymbolTable  table)
inlineprotected

Definition at line 61 of file SummariesSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.Keyword.Find(), and Ntp.Analyzer.Config.Table.Keyword.Name.

62  {
63  string keyword = Keyword.Find(Symbol.KeywordSummaries).Name;
64  string pageKeyword = Keyword.Find(Symbol.KeywordPeerSummaryPage).Name;
65  var pageNames = Nodes.Where(n => n.Symbol == Symbol.KeywordPeerSummaryPage).Cast<StringSettingNode>();
66 
67  foreach (var page in pageNames)
68  {
69  var reference = table.Lookup(page.Value);
70  if (reference == null)
71  {
72  AddReferenceNameError(page, keyword, page.Value);
73  }
74  else if (!(reference is PeerSummaryPageSyntaxNode))
75  {
76  AddReferenceTypeError(page, keyword, pageKeyword, page.Value);
77  }
78  }
79  }
void AddReferenceTypeError(ISyntaxNode node, string keyword, string section, string name)
Definition: SyntaxNode.cs:441
static Keyword Find(Symbol symbol)
Definition: Keyword.cs:216
void AddReferenceNameError(ISyntaxNode node, string keyword, string name)
Definition: SyntaxNode.cs:428
ISyntaxNode Lookup(string name)
Definition: SymbolTable.cs:41

Here is the call graph for this function:

override void Ntp.Analyzer.Config.Syntax.SummariesSyntaxNode.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< SummaryCollection >.

Definition at line 81 of file SummariesSyntaxNode.cs.

82  {
83  CheckTypeIs<StringSettingNode>(Symbol.KeywordPeerSummaryPage);
84  }

Member Data Documentation

readonly List<PeerSummaryPageSyntaxNode> Ntp.Analyzer.Config.Syntax.SummariesSyntaxNode.pages
private

Definition at line 38 of file SummariesSyntaxNode.cs.


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