private void ExecuteConflictAction(ParserAction action)
        {
            var args = new ConflictResolutionArgs(Context, action);

            _grammar.OnResolvingConflict(args);
            switch (args.Result)
            {
            case ParserActionType.Reduce:
                ExecuteReduce(new ParserAction(ParserActionType.Reduce, null, args.ReduceProduction));
                break;

            case ParserActionType.Operator:
                ExecuteOperatorAction(new ParserAction(ParserActionType.Operator, action.NewState, args.ReduceProduction));
                break;

            case ParserActionType.Shift:
            default:
                ExecuteShift(action);
                break;
            }
            Context.AddTrace(Resources.MsgTraceConflictResolved);
        }
 /// <summary>
 /// Override this method to provide custom conflict resolution; for example, custom code may decide proper shift or reduce
 /// action based on preview of tokens ahead.
 /// </summary>
 public virtual void OnResolvingConflict(ConflictResolutionArgs args)
 {
     //args.Result is Shift by default
 }
Example #3
0
 public abstract bool Match(ConflictResolutionArgs args);