23 using System.Collections.Generic;
30 namespace Ntp.Analyzer.Config.Syntax
47 var hostType = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordHostType) as
HostTypeNode;
48 var filePath = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordFilePath) as StringSettingNode;
53 var hostStats = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordHostStats) as
StatSyntaxNode;
54 var hostIoStats = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordHostIoStats) as StatSyntaxNode;
55 var peerStats = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordPeerStats) as StatSyntaxNode;
56 var driftStats = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordDriftStats) as StatSyntaxNode;
66 throw new InvalidOperationException(
@"Internal compiler error: HostSyntaxNode");
78 hostIoStats?.Compile(),
84 hostGraphs.Select(
c =>
c.Compile()),
85 hostPages.Select(
c =>
c.Compile()),
86 peerGraphs.Select(
c =>
c.Compile()),
87 peerPages.Select(
c =>
c.Compile()),
88 summery.Select(
c =>
c.Compile()),
89 trafficGraphs.Select(
c =>
c.Compile())
95 CheckIsUnique(
new List<Symbol>
103 Symbol.KeywordHostGraphPage,
104 Symbol.KeywordPeerGraphPage,
107 Symbol.KeywordHostIoStats,
112 CheckAllIsPresent(
new List<Symbol> {
Symbol.KeywordHostId});
114 if (Nodes.Count(n => n.RequirePath) != 0)
115 CheckAllIsPresent(
new List<Symbol> {
Symbol.KeywordFilePath});
125 location = CheckLink(webPath.Value, keyword);
130 CheckTypeIs<IntegerSettingNode>(
Symbol.KeywordHostId);
131 CheckTypeIs<StringSettingNode>(
Symbol.KeywordFilePath);
132 CheckTypeIs<StringSettingNode>(
Symbol.KeywordWebPath);
133 CheckTypeIs<HostTypeNode>(
Symbol.KeywordHostType);
134 CheckTypeIs<TimeStampNode>(
Symbol.KeywordTimeStamp);
override void ValidateReferences(SymbolTable table)
static Keyword Find(Symbol symbol)
override void ValidateTypes()
Override to validates the types in this syntax node.
HostSyntaxNode(string name, int line)
override HostConfiguration InternalCompile()
override void ValidateMandatories()
Override to validates the mandatory types in this syntax node.