22 using System.Collections.Generic;
29 namespace Ntp.Analyzer.Config.Syntax
34 : base(symbol, name, line)
43 var fixedRun = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordFixedRun) as BooleanSettingNode;
44 var stamp = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordTimeStamp) as
TimeStampNode;
46 var freq = bulk == null
80 CheckIsUnique(
new List<Symbol>
89 CheckAllIsPresent(
new List<Symbol> {
Symbol.KeywordFrequency});
93 CheckAllIsPresent(
new List<Symbol> {
Symbol.KeywordFile});
102 var freq = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordFrequency);
105 AddError($
"{keyword} must be either an integer value or the name of a {name} section.");
108 var freqName = freq as StringSettingNode;
109 if (freqName == null)
112 var reference = table.
Lookup(freqName.Value);
113 if (reference == null)
115 AddReferenceNameError(freqName, keyword, freqName.Value);
119 AddReferenceTypeError(freqName, keyword, name, freqName.Value);
122 if (
Symbol ==
Symbol.KeywordDriftStats || Nodes.Count(n => n.Symbol ==
Symbol.KeywordFile) == 0)
127 AddError($
"{fileKeyword} is not a valid setting in a {sectionKeyword} section.");
132 CheckTypeIs<BooleanSettingNode>(
Symbol.KeywordInitialRun);
133 CheckTypeIs<BooleanSettingNode>(
Symbol.KeywordFixedRun);
134 CheckTypeIs<TimeStampNode>(
Symbol.KeywordTimeStamp);
135 CheckTypeIs<IntegerSettingNode, StringSettingNode>(
Symbol.KeywordFrequency);
136 CheckTypeIs<StringSettingNode>(
Symbol.KeywordFile);
static Keyword Find(Symbol symbol)
StatSyntaxNode(Symbol symbol, string name, int line)
override void ValidateMandatories()
Override to validates the mandatory types in this syntax node.
override void ValidateReferences(SymbolTable table)
override void InternalResolve(SymbolTable table)
override StatConfiguration InternalCompile()
override void ValidateTypes()
Override to validates the types in this syntax node.
ISyntaxNode Lookup(string name)