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

Public Member Functions

 PeerGraphPageSyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< PeerGraphPageConfiguration >
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 PeerGraphPageConfiguration 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< PeerGraphPageConfiguration >
 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< PeerGraphPageConfiguration >
ConfigurationNode CompiledNode
 
IEnumerable< string > Errors
 
bool HasErrors
 
- Properties inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< PeerGraphPageConfiguration >
int Line [get]
 
string Name [get]
 
List< ISyntaxNodeNodes [get]
 
bool RequirePath [get]
 
Symbol Symbol [get]
 

Detailed Description

Definition at line 31 of file PeerGraphPageSyntaxNode.cs.

Constructor & Destructor Documentation

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

Definition at line 33 of file PeerGraphPageSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordPeerGraphPage.

34  : base(Symbol.KeywordPeerGraphPage, name, line, true)
35  {
36  }

Member Function Documentation

override PeerGraphPageConfiguration Ntp.Analyzer.Config.Syntax.PeerGraphPageSyntaxNode.InternalCompile ( )
inlineprotectedvirtual

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

Definition at line 41 of file PeerGraphPageSyntaxNode.cs.

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

42  {
43  var frequency = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFrequency) as IntegerSettingNode;
44  var initialRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordInitialRun) as BooleanSettingNode;
45  var fixedRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFixedRun) as BooleanSettingNode;
46  var linkIndex = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordLinkIndex) as IntegerSettingNode;
47  var dest = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordDestinations) as DirDestinationSyntaxNode;
48 
49  return new PeerGraphPageConfiguration(
50  Name,
51  frequency?.Value,
52  initialRun?.Value,
53  fixedRun?.Value,
54  linkIndex?.Value,
55  pageNode.Compile(),
56  dest?.Compile(),
57  location
58  );
59  }

Here is the call graph for this function:

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

Definition at line 61 of file PeerGraphPageSyntaxNode.cs.

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

62  {
63  var name = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphPage) as StringSettingNode;
64  if (name != null)
65  pageNode = table.Lookup(name.Value) as PeerPageSyntaxNode;
66  }
ISyntaxNode Lookup(string name)
Definition: SymbolTable.cs:41

Here is the call graph for this function:

override void Ntp.Analyzer.Config.Syntax.PeerGraphPageSyntaxNode.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< PeerGraphPageConfiguration >.

Definition at line 68 of file PeerGraphPageSyntaxNode.cs.

69  {
70  CheckIsUnique(new List<Symbol>
71  {
72  Symbol.KeywordFrequency,
73  Symbol.KeywordInitialRun,
74  Symbol.KeywordFixedRun,
75  Symbol.KeywordLinkIndex,
76  Symbol.KeywordGraphPage,
77  Symbol.KeywordLink,
78  Symbol.KeywordDestinations
79  });
80 
81  CheckAllIsPresent(new List<Symbol>
82  {
83  Symbol.KeywordGraphPage,
84  Symbol.KeywordDestinations
85  });
86  }
override void Ntp.Analyzer.Config.Syntax.PeerGraphPageSyntaxNode.ValidateReferences ( SymbolTable  table)
inlineprotected

Definition at line 88 of file PeerGraphPageSyntaxNode.cs.

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

89  {
90  var pageName = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphPage) as StringSettingNode;
91  if (pageName != null)
92  {
93  string keyword = Keyword.Find(Symbol.KeywordGraphPage).Name;
94 
95  var reference = table.Lookup(pageName.Value);
96  if (reference == null)
97  {
98  AddReferenceNameError(pageName, keyword, pageName.Value);
99  }
100  else if (!(reference is PeerPageSyntaxNode))
101  {
102  string peerPageKeyword = Keyword.Find(Symbol.KeywordPeerPage).Name;
103  AddReferenceTypeError(pageName, keyword, peerPageKeyword, pageName.Value);
104  }
105  }
106 
107  var link = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordLink) as StringSettingNode;
108  if (link == null)
109  return;
110 
111  var linkKeyword = Keyword.Find(Symbol.KeywordLink).Name;
112  location = CheckLink(link.Value, linkKeyword);
113  }
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.PeerGraphPageSyntaxNode.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< PeerGraphPageConfiguration >.

Definition at line 115 of file PeerGraphPageSyntaxNode.cs.

116  {
117  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordFrequency);
118  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordInitialRun);
119  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordFixedRun);
120  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordLinkIndex);
121  CheckTypeIs<StringSettingNode>(Symbol.KeywordGraphPage);
122  CheckTypeIs<StringSettingNode>(Symbol.KeywordLink);
123  }

Member Data Documentation

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

Definition at line 38 of file PeerGraphPageSyntaxNode.cs.

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

Definition at line 39 of file PeerGraphPageSyntaxNode.cs.


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