private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { string message = "Token error with input: '" + args.Token.ToString() + "'"; //todo: Report message to UI? lstError.Items.Add(message); }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { /*** MODIFICAÇÕES ***/ String file_name = _mainForm.getFileName(); String error_type = "Lexical error"; String line_number = args.Token.Location.LineNr.ToString(); String col_number = args.Token.Location.ColumnNr.ToString(); String error_description = "Unrecognized symbol at .. " + args.Token.ToString(); _insertError(file_name, error_type, line_number, col_number, error_description); /*** MODIFICAÇÕES ***/ }
private bool ProcessError(TerminalToken token) { if (OnTokenError != null) { TokenErrorEventArgs e = new TokenErrorEventArgs(token); OnTokenError(this, e); return(e.Continue); } else { return(false); } }
/// <summary> /// Constructor /// </summary> /// <param name="args"></param> public TokenException(TokenErrorEventArgs args) { this.tokenList = args.Token.Text; }
private bool ProcessError(TerminalToken token) { if (OnTokenError != null) { TokenErrorEventArgs e = new TokenErrorEventArgs(token); OnTokenError(this, e); return e.Continue; } else return false; }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { MainForm.mainForm.ShowInputError(args.Token); MainForm.mainForm.WriteResult("Token error with input: '" + args.Token.ToString() + "'"); }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { string message = "Token error with input: '"+args.Token.ToString()+"'"; //todo: Report message to UI? }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { throw new TokenException(args); }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { string message = args.Token.Location.ToString()+"[\n\r"; message+="Token error with input: '"+args.Token.ToString()+"'"; if (LastGotoEventArgs!=null) message+="\n\rLastGoto:"+LastGotoEventArgs.Symbol.ToString(); if (LastReduceEventArgs!=null) message+="\n\rLastReduce.Rule:"+LastReduceEventArgs.Rule.ToString(); message+="\n\r]"; Console.WriteLine(message); }
protected virtual void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { string message = String.Format("Token error with input: '{0}' at location {1}", args.Token, args.Token.Location); throw new ParserException(message); }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { message = message + "Token error with input: '" + args.Token.ToString() + "'"; //todo: Report message to UI? }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { AddViewItem("Token error", args.Token.Location, "Cannot recognize token", args.Token.Text,"",5); errors++; if (errors <= maxerrors) args.Continue = true; }
private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args) { MainForm.mainForm.ShowInputError(args.Token); MainForm.mainForm.WriteResult("Token error with input: '"+args.Token.ToString()+"'"); }
private void lalrParser_OnTokenError(LALRParser parser, TokenErrorEventArgs e) { // Ignore token errors OnParseComplete(EventArgs.Empty); }
private void TokenErrorEvent(LALRParser argParser, TokenErrorEventArgs args) { WriteError("Parse error caused by token: '" + args.Token.Text + "'" + " at " + args.Token.Location, args.Token.Location); args.Continue = true; }