Added missed files to RazorSyntaxGenerator (dotnet/aspnetcore-tooling#318)
\n\nCommit migrated from 84066bc880
This commit is contained in:
parent
b2b8ca6479
commit
c7dcbd82d6
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
public class AbstractNode : TreeType
|
||||
{
|
||||
[XmlElement(ElementName = "Field", Type = typeof(Field))]
|
||||
public List<Field> Fields;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
public class Comment
|
||||
{
|
||||
[XmlAnyElement]
|
||||
public XmlElement[] Body;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
public class Field
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Name;
|
||||
|
||||
[XmlAttribute]
|
||||
public string Type;
|
||||
|
||||
[XmlAttribute]
|
||||
public string Optional;
|
||||
|
||||
[XmlAttribute]
|
||||
public string Override;
|
||||
|
||||
[XmlAttribute]
|
||||
public string New;
|
||||
|
||||
[XmlElement(ElementName = "Kind", Type = typeof(Kind))]
|
||||
public List<Kind> Kinds;
|
||||
|
||||
[XmlElement]
|
||||
public Comment PropertyComment;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
public class Kind
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
public class Node : TreeType
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Root;
|
||||
|
||||
[XmlAttribute]
|
||||
public string Errors;
|
||||
|
||||
[XmlElement(ElementName = "Kind", Type = typeof(Kind))]
|
||||
public List<Kind> Kinds;
|
||||
|
||||
[XmlElement(ElementName = "Field", Type = typeof(Field))]
|
||||
public List<Field> Fields;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
public class PredefinedNode : TreeType
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
[XmlRoot]
|
||||
public class Tree
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Root;
|
||||
|
||||
[XmlElement(ElementName = "Node", Type = typeof(Node))]
|
||||
[XmlElement(ElementName = "AbstractNode", Type = typeof(AbstractNode))]
|
||||
[XmlElement(ElementName = "PredefinedNode", Type = typeof(PredefinedNode))]
|
||||
public List<TreeType> Types;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RazorSyntaxGenerator
|
||||
{
|
||||
public class TreeType
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Name;
|
||||
|
||||
[XmlAttribute]
|
||||
public string Base;
|
||||
|
||||
[XmlElement]
|
||||
public Comment TypeComment;
|
||||
|
||||
[XmlElement]
|
||||
public Comment FactoryComment;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,8 +4,4 @@ Syntax generator tool for the Razor syntax tree. This is a modified version of R
|
|||
|
||||
## Usage
|
||||
|
||||
dotnet run `path/to/Syntax.xml` `path/to/generated/output`
|
||||
|
||||
E.g,
|
||||
|
||||
`dotnet run ../Microsoft.AspNetCore.Razor.Language/Syntax/Syntax.xml ../Microsoft.AspNetCore.Razor.Language/Syntax/Generated/`
|
||||
dotnet run `full/path/to/Syntax.xml` `full/path/to/generated/output`
|
||||
Loading…
Reference in New Issue