Пример #1
0
        private static string Short(TableCell actions)
        {
            string s = string.Empty;

            foreach (var action in actions.Distinct())
            {
                if (action is Reduce reduce)
                {
                    s = $"{s}«{reduce.Production}»";
                }
                else if (action is Shift shift)
                {
                    s = $"{s}s{shift.State}";
                }
                else if (action is Accept)
                {
                    s = $"{s}acc";
                }
            }

            return(Short(s));
        }