﻿using System.Collections.Generic;

namespace Irony.Parsing
{
    //Terminal report group is a facility for improving syntax error messages. 
    // Irony parser/scanner reports an error like "Syntax error, invalid character. Expected: <expected list>."
    // The <expected list> is a list of all terminals (symbols) that are expected in current position.
    // This list might quite long and quite difficult to look through. The solution is to provide Group names for 
    // groups of terminals - these are groups of type Normal. 
    // Some terminals might be excluded from showing in expected list by including them into group of type DoNotReport. 
    // Finally, Operator group allows you to specify group name for all operator symbols without listing operators -
    // Irony will collect all operator symbols registered with RegisterOperator method automatically. 

    public enum TermReportGroupType
    {
        Normal,
        DoNotReport,
        Operator
    }

    public class TermReportGroup
    {
        public string Alias;
        public TermReportGroupType GroupType;
        public TerminalSet Terminals = new TerminalSet();

        public TermReportGroup(string alias, TermReportGroupType groupType, IEnumerable<Terminal> terminals)
        {
            Alias = alias;
            GroupType = groupType;
            if (terminals != null)
                Terminals.UnionWith(terminals);
        }
    } //class

    public class TermReportGroupList : List<TermReportGroup>
    {
    }
} //namespace