2016-08-06 16:19:35 +02:00
|
|
|
//
|
2017-07-13 22:32:11 +02:00
|
|
|
// Copyright (c) 2013-2017 Carsten Sonne Larsen <cs@innolan.net>
|
2016-08-06 16:19:35 +02:00
|
|
|
//
|
2016-04-02 11:22:42 +02:00
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
// in the Software without restriction, including without limitation the rights
|
|
|
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
// furnished to do so, subject to the following conditions:
|
2016-08-06 16:19:35 +02:00
|
|
|
//
|
2016-04-02 11:22:42 +02:00
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
|
// all copies or substantial portions of the Software.
|
2016-08-06 16:19:35 +02:00
|
|
|
//
|
2016-04-02 11:22:42 +02:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
// THE SOFTWARE.
|
|
|
|
|
|
2016-08-13 21:42:25 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2016-08-06 16:19:35 +02:00
|
|
|
using Ntp.Analyzer.Config.Node.Navigation;
|
|
|
|
|
using Ntp.Analyzer.Config.Table;
|
2016-04-02 11:22:42 +02:00
|
|
|
|
2016-08-06 16:19:35 +02:00
|
|
|
namespace Ntp.Analyzer.Config.Syntax
|
2016-04-02 11:22:42 +02:00
|
|
|
{
|
2016-08-13 21:42:25 +02:00
|
|
|
public sealed class MenuSyntaxNode : SyntaxNode<MenuConfiguration>
|
2016-04-02 11:22:42 +02:00
|
|
|
{
|
2016-08-06 16:19:35 +02:00
|
|
|
public MenuSyntaxNode(string name, int line)
|
|
|
|
|
: base(Symbol.KeywordMenu, name, line)
|
2016-04-02 11:22:42 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-18 19:18:52 +02:00
|
|
|
protected override MenuConfiguration InternalCompile()
|
|
|
|
|
{
|
|
|
|
|
return new MenuConfiguration(Name, Nodes.OfType<MenuItemSyntaxNode>().Select(n => n.Compile()));
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-13 21:42:25 +02:00
|
|
|
protected override void ValidateMandatories()
|
|
|
|
|
{
|
|
|
|
|
CheckAllIsPresent(new List<Symbol>
|
|
|
|
|
{
|
|
|
|
|
Symbol.KeywordItem
|
|
|
|
|
});
|
|
|
|
|
}
|
2016-04-02 11:22:42 +02:00
|
|
|
}
|
2016-03-05 15:25:01 +01:00
|
|
|
}
|