Added missed files to RazorSyntaxGenerator (dotnet/aspnetcore-tooling#318)

\n\nCommit migrated from 84066bc880
This commit is contained in:
Ajay Bhargav Baaskaran 2019-03-08 15:56:46 -08:00 committed by GitHub
parent b2b8ca6479
commit c7dcbd82d6
9 changed files with 148 additions and 5 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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
{
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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`