1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
7
namespace ICSharpCode.NRefactory.VB.Parser
9
public delegate void ErrorCodeProc(int line, int col, int n);
10
public delegate void ErrorMsgProc(int line, int col, string msg);
14
int count = 0; // number of errors detected
15
public ErrorCodeProc SynErr;
16
public ErrorCodeProc SemErr;
17
public ErrorMsgProc Error;
18
StringBuilder errorText = new StringBuilder();
20
public string ErrorOutput {
22
return errorText.ToString();
28
SynErr = new ErrorCodeProc(DefaultCodeError); // syntactic errors
29
SemErr = new ErrorCodeProc(DefaultCodeError); // semantic errors
30
Error = new ErrorMsgProc(DefaultMsgError); // user defined string based errors
39
void DefaultCodeError(int line, int col, int n)
41
errorText.AppendLine(String.Format("-- line {0} col {1}: error {2}", line, col, n));
45
void DefaultMsgError(int line, int col, string s) {
46
errorText.AppendLine(String.Format("-- line {0} col {1}: {2}", line, col, s));