summaryrefslogtreecommitdiff
path: root/Source/Core/Parser.cs
diff options
context:
space:
mode:
authorGravatar rustanleino <unknown>2010-10-26 01:28:32 +0000
committerGravatar rustanleino <unknown>2010-10-26 01:28:32 +0000
commit14fd1ed33b759735c9bd8255c37885c066f7040f (patch)
tree10a21e3c8dbd045e85462234c5240fc6303f84ed /Source/Core/Parser.cs
parent0557e6509f413fe48ee21f538b69bf72e52fc36e (diff)
Updated parser.cs files to pick up the new .frame improvements from boogiepartners
Diffstat (limited to 'Source/Core/Parser.cs')
-rw-r--r--Source/Core/Parser.cs27
1 files changed, 15 insertions, 12 deletions
diff --git a/Source/Core/Parser.cs b/Source/Core/Parser.cs
index 9b344a4f..0d906de4 100644
--- a/Source/Core/Parser.cs
+++ b/Source/Core/Parser.cs
@@ -2038,12 +2038,15 @@ public class Errors {
public string errMsgFormat = "{0}({1},{2}): error: {3}"; // 0=filename, 1=line, 2=column, 3=text
public string warningMsgFormat = "{0}({1},{2}): warning: {3}"; // 0=filename, 1=line, 2=column, 3=text
- public virtual void SynErr (string filename, int line, int col, int n) {
- string s = GetErrorString(n);
- errorStream.WriteLine(errMsgFormat, filename, line, col, s);
+ public void SynErr(string filename, int line, int col, int n) {
+ SynErr(filename, line, col, GetSyntaxErrorString(n));
+ }
+ public virtual void SynErr(string filename, int line, int col, string msg) {
+ Contract.Requires(msg != null);
+ errorStream.WriteLine(errMsgFormat, filename, line, col, msg);
count++;
}
- public string GetErrorString(int n) {
+ string GetSyntaxErrorString(int n) {
string s;
switch (n) {
case 0: s = "EOF expected"; break;
@@ -2181,20 +2184,20 @@ public class Errors {
return s;
}
- public virtual void SemErr (string filename, int line, int col, string/*!*/ s) {
- Contract.Requires(s != null);
- errorStream.WriteLine(errMsgFormat, filename, line, col, s);
- count++;
- }
-
public void SemErr(IToken/*!*/ tok, string/*!*/ msg) { // semantic errors
Contract.Requires(tok != null);
Contract.Requires(msg != null);
SemErr(tok.filename, tok.line, tok.col, msg);
}
+ public virtual void SemErr(string filename, int line, int col, string/*!*/ msg) {
+ Contract.Requires(msg != null);
+ errorStream.WriteLine(errMsgFormat, filename, line, col, msg);
+ count++;
+ }
- public virtual void Warning (int line, int col, string s) {
- errorStream.WriteLine(warningMsgFormat, line, col, s);
+ public virtual void Warning(string filename, int line, int col, string msg) {
+ Contract.Requires(msg != null);
+ errorStream.WriteLine(warningMsgFormat, filename, line, col, msg);
}
} // Errors