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

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Definition at line 32 of file AboutPageSyntaxNode.cs.

Constructor & Destructor Documentation

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

Definition at line 34 of file AboutPageSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordAboutPage.

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

Member Function Documentation

override AboutPageConfiguration Ntp.Analyzer.Config.Syntax.AboutPageSyntaxNode.InternalCompile ( )
inlineprotectedvirtual

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

Definition at line 41 of file AboutPageSyntaxNode.cs.

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 title = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTitle) as StringSettingNode ??
47  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPageTitle) as StringSettingNode;
48  var serverId = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordServerId) as IntegerSettingNode;
49  var contentTitle = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordContentTitle) as StringSettingNode;
50  var content = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordContent) as StringSettingNode;
51  var pageTemplate = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPageTemplate) as PageThemeNode;
52  var dest = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordDestinations) as FileDestinationSyntaxNode;
53 
54  return new AboutPageConfiguration(
55  Name,
56  frequency?.Value,
57  initialRun?.Value,
58  fixedRun?.Value,
59  title?.Value,
60  pageTemplate?.PageTheme,
61  serverId?.Value,
62  contentTitle?.Value,
63  content?.Value,
64  location,
65  dest?.Compile()
66  );
67  }
override void Ntp.Analyzer.Config.Syntax.AboutPageSyntaxNode.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< AboutPageConfiguration >.

Definition at line 69 of file AboutPageSyntaxNode.cs.

70  {
71  CheckIsUnique(new List<Symbol>
72  {
73  Symbol.KeywordFrequency,
74  Symbol.KeywordInitialRun,
75  Symbol.KeywordFixedRun,
76  Symbol.KeywordTitle,
77  Symbol.KeywordPageTitle,
78  Symbol.KeywordPageTemplate,
79  Symbol.KeywordContentTitle,
80  Symbol.KeywordContent,
81  Symbol.KeywordServerId,
82  Symbol.KeywordLink
83  });
84 
85  CheckAllIsPresent(new List<Symbol>
86  {
87  Symbol.KeywordDestinations,
88  Symbol.KeywordContentTitle,
89  Symbol.KeywordContent
90  });
91 
92  CheckOnlyOneIsPresent(new List<Symbol>
93  {
94  Symbol.KeywordTitle,
95  Symbol.KeywordPageTitle
96  });
97  }
override void Ntp.Analyzer.Config.Syntax.AboutPageSyntaxNode.ValidateReferences ( SymbolTable  table)
inlineprotected

Definition at line 99 of file AboutPageSyntaxNode.cs.

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

100  {
101  var link = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordLink) as StringSettingNode;
102  if (link == null)
103  return;
104 
105  var keyword = Keyword.Find(Symbol.KeywordLink).Name;
106  location = CheckLink(link.Value, keyword);
107  }
static Keyword Find(Symbol symbol)
Definition: Keyword.cs:216

Here is the call graph for this function:

override void Ntp.Analyzer.Config.Syntax.AboutPageSyntaxNode.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< AboutPageConfiguration >.

Definition at line 109 of file AboutPageSyntaxNode.cs.

110  {
111  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordFrequency);
112  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordInitialRun);
113  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordFixedRun);
114  CheckTypeIs<PageThemeNode>(Symbol.KeywordPageTemplate);
115  CheckTypeIs<StringSettingNode>(Symbol.KeywordTitle);
116  CheckTypeIs<StringSettingNode>(Symbol.KeywordPageTitle);
117  CheckTypeIs<StringSettingNode>(Symbol.KeywordContentTitle);
118  CheckTypeIs<StringSettingNode>(Symbol.KeywordContent);
119  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordServerId);
120  CheckTypeIs<StringSettingNode>(Symbol.KeywordLink);
121  }

Member Data Documentation

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

Definition at line 39 of file AboutPageSyntaxNode.cs.


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