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

Public Member Functions

 PeerSummaryPageSyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< PeerSummaryPageConfiguration >
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 PeerSummaryPageConfiguration 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< PeerSummaryPageConfiguration >
 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

Uri location
 
PeerPageSyntaxNode pageNode
 

Additional Inherited Members

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

Detailed Description

Definition at line 32 of file PeerSummaryPageSyntaxNode.cs.

Constructor & Destructor Documentation

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

Definition at line 34 of file PeerSummaryPageSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordPeerSummaryPage.

35  : base(Symbol.KeywordPeerSummaryPage, name, line, true)
36  {
37  }

Member Function Documentation

override PeerSummaryPageConfiguration Ntp.Analyzer.Config.Syntax.PeerSummaryPageSyntaxNode.InternalCompile ( )
inlineprotectedvirtual

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

Definition at line 42 of file PeerSummaryPageSyntaxNode.cs.

References Ntp.Analyzer.Config.Syntax.SyntaxNode< T >.Compile().

43  {
44  var frequency = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFrequency) as IntegerSettingNode;
45  var initialRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordInitialRun) as BooleanSettingNode;
46  var fixedRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFixedRun) as BooleanSettingNode;
47  var title = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTitle) as StringSettingNode ??
48  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPageTitle) as StringSettingNode;
49  var pageTemplate = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPageTemplate) as PageThemeNode;
50  var graphSets = Nodes.Where(n => n.Symbol == Symbol.KeywordGraphSet).Cast<GraphSetSyntaxNode>();
51  var dest = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordDestinations) as FileDestinationSyntaxNode;
52 
54  Name,
55  frequency?.Value,
56  initialRun?.Value,
57  fixedRun?.Value,
58  pageTemplate?.PageTheme,
59  title?.Value,
60  pageNode.Compile(),
61  graphSets.Select(g => g.Compile()),
62  dest?.Compile(),
63  location
64  );
65  }

Here is the call graph for this function:

override void Ntp.Analyzer.Config.Syntax.PeerSummaryPageSyntaxNode.InternalResolve ( SymbolTable  table)
inlineprotected

Definition at line 67 of file PeerSummaryPageSyntaxNode.cs.

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

68  {
69  var name = Nodes.Single(n => n.Symbol == Symbol.KeywordPeerPage) as StringSettingNode;
70  if (name != null)
71  pageNode = table.Lookup(name.Value) as PeerPageSyntaxNode;
72  }
ISyntaxNode Lookup(string name)
Definition: SymbolTable.cs:41

Here is the call graph for this function:

override void Ntp.Analyzer.Config.Syntax.PeerSummaryPageSyntaxNode.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< PeerSummaryPageConfiguration >.

Definition at line 74 of file PeerSummaryPageSyntaxNode.cs.

75  {
76  CheckIsUnique(new List<Symbol>
77  {
78  Symbol.KeywordFrequency,
79  Symbol.KeywordInitialRun,
80  Symbol.KeywordFixedRun,
81  Symbol.KeywordTitle,
82  Symbol.KeywordPageTitle,
83  Symbol.KeywordLink,
84  Symbol.KeywordPeerPage,
85  Symbol.KeywordPageTemplate,
86  Symbol.KeywordDestinations
87  });
88 
89  CheckOnlyOneIsPresent(new List<Symbol>
90  {
91  Symbol.KeywordTitle,
92  Symbol.KeywordPageTitle
93  });
94 
95  CheckAllIsPresent(new List<Symbol>
96  {
97  Symbol.KeywordPeerPage,
98  Symbol.KeywordGraphSet,
99  Symbol.KeywordDestinations
100  });
101  }
override void Ntp.Analyzer.Config.Syntax.PeerSummaryPageSyntaxNode.ValidateReferences ( SymbolTable  table)
inlineprotected

Definition at line 103 of file PeerSummaryPageSyntaxNode.cs.

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

104  {
105  var pageName = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPeerPage) as StringSettingNode;
106  if (pageName != null)
107  {
108  string keyword = Keyword.Find(Symbol.KeywordPeerPage).Name;
109 
110  var reference = table.Lookup(pageName.Value);
111  if (reference == null)
112  {
113  AddReferenceNameError(pageName, keyword, pageName.Value);
114  }
115  else if (!(reference is PeerPageSyntaxNode))
116  {
117  AddReferenceTypeError(pageName, keyword, keyword, pageName.Value);
118  }
119  }
120 
121  var link = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordLink) as StringSettingNode;
122  if (link == null)
123  return;
124 
125  var linkKeyword = Keyword.Find(Symbol.KeywordLink).Name;
126  location = CheckLink(link.Value, linkKeyword);
127  }
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.PeerSummaryPageSyntaxNode.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< PeerSummaryPageConfiguration >.

Definition at line 129 of file PeerSummaryPageSyntaxNode.cs.

130  {
131  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordFrequency);
132  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordInitialRun);
133  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordFixedRun);
134  CheckTypeIs<StringSettingNode>(Symbol.KeywordTitle);
135  CheckTypeIs<StringSettingNode>(Symbol.KeywordPageTitle);
136  CheckTypeIs<StringSettingNode>(Symbol.KeywordPeerPage);
137  CheckTypeIs<StringSettingNode>(Symbol.KeywordLink);
138  CheckTypeIs<PageThemeNode>(Symbol.KeywordPageTemplate);
139  }

Member Data Documentation

Uri Ntp.Analyzer.Config.Syntax.PeerSummaryPageSyntaxNode.location
private

Definition at line 39 of file PeerSummaryPageSyntaxNode.cs.

PeerPageSyntaxNode Ntp.Analyzer.Config.Syntax.PeerSummaryPageSyntaxNode.pageNode
private

Definition at line 40 of file PeerSummaryPageSyntaxNode.cs.


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