Exemple #1
0
 /// <summary>
 /// Event handler for the shift action.
 /// </summary>
 /// <param name="parser">parser that is the source of this event</param>
 /// <param name="args">event arguments</param>
 private void ShiftEvent(LALRParser parser, ShiftEventArgs args)
 {
     AddViewItem("Shift",
         args.Token.Location,
         args.Token.Symbol.ToString(),
         StringUtil.ShowEscapeChars(args.Token.Text),
         args.NewState.Id.ToString(),
         1);
 }
Exemple #2
0
 void OnShift(LALRParser argParser, ShiftEventArgs args)
 {
     if (endSymbol == 2)
     {
         TerminalToken eofToken =
             new TerminalToken(SymbolCollection.EOF, SymbolCollection.EOF.Name, args.Token.Location);
         argParser.lookahead = eofToken;
         endSymbol = 3;
     }
 }