diff options
author | rustanleino <unknown> | 2010-10-26 01:28:32 +0000 |
---|---|---|
committer | rustanleino <unknown> | 2010-10-26 01:28:32 +0000 |
commit | 14fd1ed33b759735c9bd8255c37885c066f7040f (patch) | |
tree | 10a21e3c8dbd045e85462234c5240fc6303f84ed /Source | |
parent | 0557e6509f413fe48ee21f538b69bf72e52fc36e (diff) |
Updated parser.cs files to pick up the new .frame improvements from boogiepartners
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Core/Parser.cs | 27 | ||||
-rw-r--r-- | Source/Dafny/Parser.cs | 27 |
2 files changed, 30 insertions, 24 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
diff --git a/Source/Dafny/Parser.cs b/Source/Dafny/Parser.cs index 1877fafe..cc295157 100644 --- a/Source/Dafny/Parser.cs +++ b/Source/Dafny/Parser.cs @@ -2063,12 +2063,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;
@@ -2223,20 +2226,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
|