23 using System.Collections.Generic;
30 namespace Ntp.Analyzer.Config.Syntax
46 var fixedRun = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordFixedRun) as BooleanSettingNode;
49 var poolMember = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordPoolMember) as BooleanSettingNode;
50 var queryDirect = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordQueryDirect) as BooleanSettingNode;
51 var pageTemplate = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordPageTemplate) as
PageThemeNode;
52 var pageTime = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordPageTime) as
TimeStampNode ??
63 pageTime?.DateTimeKind,
69 peerPagesNode?.Compile(),
70 graphSets.Select(g => g.Compile()),
85 CheckIsUnique(
new List<Symbol>
94 Symbol.KeywordPageTemplate,
101 CheckOnlyOneIsPresent(
new List<Symbol>
107 CheckOnlyOneIsPresent(
new List<Symbol>
113 CheckAllIsPresent(
new List<Symbol> {
Symbol.KeywordDestinations});
119 if (pageName != null)
122 var reference = table.
Lookup(pageName.Value);
123 if (reference == null)
124 AddReferenceNameError(pageName, keyword, pageName.Value);
126 AddReferenceTypeError(pageName, keyword, keyword, pageName.Value);
129 var link = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordLink) as StringSettingNode;
134 location = CheckLink(link.Value, linkKeyword);
139 CheckTypeIs<IntegerSettingNode>(
Symbol.KeywordFrequency);
140 CheckTypeIs<BooleanSettingNode>(
Symbol.KeywordInitialRun);
141 CheckTypeIs<BooleanSettingNode>(
Symbol.KeywordFixedRun);
142 CheckTypeIs<StringSettingNode>(
Symbol.KeywordTitle);
143 CheckTypeIs<StringSettingNode>(
Symbol.KeywordPageTitle);
144 CheckTypeIs<StringSettingNode>(
Symbol.KeywordPeerPage);
145 CheckTypeIs<StringSettingNode>(
Symbol.KeywordLink);
146 CheckTypeIs<BooleanSettingNode>(
Symbol.KeywordPoolMember);
147 CheckTypeIs<BooleanSettingNode>(
Symbol.KeywordQueryDirect);
148 CheckTypeIs<PageThemeNode>(
Symbol.KeywordPageTemplate);
149 CheckTypeIs<TimeStampNode>(
Symbol.KeywordPageTime);
150 CheckTypeIs<TimeStampNode>(
Symbol.KeywordTimeStamp);
override void ValidateMandatories()
Override to validates the mandatory types in this syntax node.
static Keyword Find(Symbol symbol)
PeerPageSyntaxNode peerPagesNode
override void InternalResolve(SymbolTable table)
override void ValidateReferences(SymbolTable table)
override HostPageConfiguration InternalCompile()
HostPageSyntaxNode(string name, int line)
override void ValidateTypes()
Override to validates the types in this syntax node.
Configuration for a HTML page showing status and graphs for a hosted NTP server.
ISyntaxNode Lookup(string name)