Example #1
0
        private void ExecuteConflictAction(ParserAction action)
        {
            var args = action.ResolveConflict(_grammar, Context);

            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;
            }
            if (_traceEnabled)
            {
                Context.AddTrace(Resources.MsgTraceConflictResolved);
            }
        }
Example #2
0
 private void ExecuteConflictAction(ParserAction action) {
   var args = action.ResolveConflict(_grammar, Context);
   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; 
   }
   if (_traceEnabled) Context.AddTrace(Resources.MsgTraceConflictResolved);
 }