A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
842 B

// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Perspex.Markup.Binding.Parsers;
namespace Perspex.Markup.Binding
{
internal static class ExpressionNodeBuilder
{
public static ExpressionNode Build(string expression)
{
if (string.IsNullOrWhiteSpace(expression))
{
throw new ArgumentException("'expression' may not be empty.");
}
var reader = new Reader(expression);
var node = ExpressionParser.Parse(reader);
if (!reader.End)
{
throw new ExpressionParseException(reader, "Expected end of expression.");
}
return node;
}
}
}