Exemple #1
0
        private void ParserGeneration_ErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.Data) && !e.IsIgnoreJavaError())
            {
                var strs = e.Data.Split(':');
                int line = 1, column = 1;

                int locationIndex = strs.Length > 2 && strs[2].Length > 0 && strs[2][0] == '\\' ? 3 : 2;
                if (strs.Length > locationIndex)
                {
                    if (!int.TryParse(strs[locationIndex], out line))
                    {
                        line = 1;
                    }
                    if (strs.Length > locationIndex + 1)
                    {
                        if (!int.TryParse(strs[locationIndex + 1], out column))
                        {
                            column = 1;
                        }
                    }
                }
                ParsingError error = new ParsingError(line, column, e.Data, _currentGrammarSource, WorkflowStage.ParserGenerated);
                if (strs.Length > 0 && strs[0].StartsWith("warning"))
                {
                    error.IsWarning = true;
                }
                ErrorEvent?.Invoke(this, error);
                _result.Errors.Add(error);
            }
        }
Exemple #2
0
 private void ParserGeneration_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Data) && !e.IsIgnoreJavaError())
     {
     }
 }