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

Public Member Functions

 ListenerSyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< ListenerConfiguration >
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 ListenerConfiguration InternalCompile ()
 
override void ValidateMandatories ()
 Override to validates the mandatory types in this syntax node. More...
 
override void ValidateTypes ()
 Override to validates the types in this syntax node. More...
 
- Protected Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< ListenerConfiguration >
 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...
 

Additional Inherited Members

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

Detailed Description

Definition at line 30 of file ListenerSyntaxNode.cs.

Constructor & Destructor Documentation

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

Definition at line 32 of file ListenerSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordListener.

33  : base(Symbol.KeywordListener, name, line)
34  {
35  }

Member Function Documentation

override ListenerConfiguration Ntp.Analyzer.Config.Syntax.ListenerSyntaxNode.InternalCompile ( )
inlineprotectedvirtual

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

Definition at line 37 of file ListenerSyntaxNode.cs.

38  {
39  var host = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordIp) as StringSettingNode ??
40  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordHost) as StringSettingNode ??
41  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordAddress) as StringSettingNode;
42  var port = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPort) as IntegerSettingNode;
43 
44  return new ListenerConfiguration(Name, host?.Value, port?.Value);
45  }
override void Ntp.Analyzer.Config.Syntax.ListenerSyntaxNode.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< ListenerConfiguration >.

Definition at line 47 of file ListenerSyntaxNode.cs.

48  {
49  CheckIsUnique(new List<Symbol>
50  {
51  Symbol.KeywordIp,
52  Symbol.KeywordAddress,
53  Symbol.KeywordHostAddress,
54  Symbol.KeywordPort
55  });
56 
57  CheckOneIsPresent(new List<Symbol>
58  {
59  Symbol.KeywordIp,
60  Symbol.KeywordHost,
61  Symbol.KeywordAddress
62  });
63 
64  CheckOnlyOneIsPresent(new List<Symbol>
65  {
66  Symbol.KeywordIp,
67  Symbol.KeywordHost,
68  Symbol.KeywordAddress
69  });
70  }
override void Ntp.Analyzer.Config.Syntax.ListenerSyntaxNode.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< ListenerConfiguration >.

Definition at line 72 of file ListenerSyntaxNode.cs.

73  {
74  CheckTypeIs<StringSettingNode>(Symbol.KeywordIp);
75  CheckTypeIs<StringSettingNode>(Symbol.KeywordHost);
76  CheckTypeIs<StringSettingNode>(Symbol.KeywordAddress);
77  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordPort);
78  }

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