4
namespace ICSharpCode.SharpRefactory.Parser.VB
6
public delegate void ErrorCodeProc(int line, int col, int n);
7
public delegate void ErrorMsgProc(int line, int col, string msg);
11
public int count = 0; // number of errors detected
12
public ErrorCodeProc SynErr;
13
public ErrorCodeProc SemErr;
14
public ErrorMsgProc Error;
15
StringBuilder errorText = new StringBuilder();
17
public string ErrorOutput {
19
return errorText.ToString();
24
SynErr = new ErrorCodeProc(DefaultCodeError); // syntactic errors
25
SemErr = new ErrorCodeProc(DefaultCodeError); // semantic errors
26
Error = new ErrorMsgProc(DefaultMsgError); // user defined string based errors
29
// public void Exception (string s)
31
// Console.WriteLine(s);
32
// System.Environment.Exit(0);
35
void DefaultCodeError (int line, int col, int n)
37
errorText.Append(String.Format("-- line {0} col {1}: error {2}", line, col, n));
38
errorText.Append("\n");
42
void DefaultMsgError (int line, int col, string s) {
43
errorText.Append(String.Format("-- line {0} col {1}: {2}", line, col, s));
44
errorText.Append("\n");