示例#1
0
        public static LR1ParsingTableCell Parse(string input)
        {
            var result = LR1ParsingTableEntryActionExtensions.Parse(input);

            switch (result)
            {
            case TableCellAction.Shift:
            case TableCellAction.Reduce:
                return(new LR1ParsingTableCell(result, int.Parse(input.Substring(1))));

            default:
                return(new LR1ParsingTableCell(result));
            }
        }
示例#2
0
        public LR1ParsingTableCell(string input)
        {
            Action = LR1ParsingTableEntryActionExtensions.Parse(input);
            switch (Action)
            {
            case TableCellAction.Shift:
            case TableCellAction.Reduce:
                TargetState = int.Parse(input.Substring(1));
                break;

            default:
                TargetState = 0;
                break;
            }
        }