using System;
namespace QFSW.QC
{
///
/// Creates a Parser for a custom grammar construct that is loaded and used by the QuantumParser.
/// Grammar constructs are tested and used before resorting to IQcParsers for object value parsing.
///
public interface IQcGrammarConstruct
{
///
/// The precedence of this grammar construct.
///
int Precedence { get; }
///
/// If the incoming data matches this grammar construct.
///
/// The incoming string data.
/// The type to test.
/// If it matches the grammar defined by this construct.
bool Match(string value, Type type);
///
/// Parses the incoming string to the specified type.
///
/// The incoming string data.
/// The type to parse the incoming string to.
/// Delegate back to the main parser to allow for recursive parsing of sub elements.
/// The parsed object.
object Parse(string value, Type type, Func recursiveParser);
}
}