Example #1
0
        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);
        }
Example #2
0
        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 ***/
        }
Example #3
0
 private bool ProcessError(TerminalToken token)
 {
     if (OnTokenError != null)
     {
         TokenErrorEventArgs e = new TokenErrorEventArgs(token);
         OnTokenError(this, e);
         return(e.Continue);
     }
     else
     {
         return(false);
     }
 }
Example #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="args"></param>
 public TokenException(TokenErrorEventArgs args)
 {
     this.tokenList = args.Token.Text;
 }
Example #5
0
		private bool ProcessError(TerminalToken token)
		{
			if (OnTokenError != null)
			{
				TokenErrorEventArgs e = new TokenErrorEventArgs(token);
				OnTokenError(this, e);
				return e.Continue;
			}
			else
				return false;
		}
Example #6
0
 private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args)
 {
     MainForm.mainForm.ShowInputError(args.Token);
     MainForm.mainForm.WriteResult("Token error with input: '" + args.Token.ToString() + "'");
 }
Example #7
0
 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);
 }
Example #9
0
        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);
        }
Example #10
0
        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);
        }
Example #11
0
 private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args)
 {
     message = message + "Token error with input: '" + args.Token.ToString() + "'";
     //todo: Report message to UI?
 }
Example #12
0
 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;
 }
Example #13
0
 private void TokenErrorEvent(LALRParser parser, TokenErrorEventArgs args)
 {
     MainForm.mainForm.ShowInputError(args.Token);
     MainForm.mainForm.WriteResult("Token error with input: '"+args.Token.ToString()+"'");
 }
Example #14
0
 private void lalrParser_OnTokenError(LALRParser parser, TokenErrorEventArgs e)
 {
     // Ignore token errors
     OnParseComplete(EventArgs.Empty);
 }
Example #15
0
        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;
        }