[Monodevelop-patches-list] r2200 - in trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory: . src/Lexer src/Parser/generated

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Jan 31 13:03:08 EST 2005


Author: jluke
Date: 2005-01-31 13:03:07 -0500 (Mon, 31 Jan 2005)
New Revision: 2200

Added:
   trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Makefile
Modified:
   trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
   trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Lexer/Lexer.cs
   trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
   trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG
Log:
warning fix


Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog	2005-01-31 17:55:08 UTC (rev 2199)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog	2005-01-31 18:03:07 UTC (rev 2200)
@@ -1,3 +1,13 @@
+2005-01-31  John Luke  <john.luke at gmail.com>
+
+	* src/Lexer/Lexer.cs:
+	* src/Parser/generated/cs.ATG:
+	* src/Parser/generated/Parser.cs:
+	warning fixes
+	* src/Parser/generated/Makefile:
+	add the equivalent of gen.bat to generate
+	a new parser from cs.ATG
+
 2005-01-28  John Luke  <john.luke at gmail.com>
 
 	* src/Parser/AST/LookupTableVisitor.cs:

Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Lexer/Lexer.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Lexer/Lexer.cs	2005-01-31 17:55:08 UTC (rev 2199)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Lexer/Lexer.cs	2005-01-31 18:03:07 UTC (rev 2200)
@@ -860,8 +860,6 @@
 		void ReadMultiLineComment()
 		{
 			specialTracker.StartComment(CommentType.Block, new Point(line, col));
-			int x = col;
-			int y = line;
 			while (!reader.Eos()) {
 				char ch;
 				switch (ch = reader.GetNext()) {

Added: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Makefile
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Makefile	2005-01-31 17:55:08 UTC (rev 2199)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Makefile	2005-01-31 18:03:07 UTC (rev 2200)
@@ -0,0 +1,4 @@
+
+all:
+	mono SharpCoco.exe -namespace ICSharpCode.SharpRefactory.Parser cs.ATG
+	rm -f Parser.old.cs

Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs	2005-01-31 17:55:08 UTC (rev 2199)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs	2005-01-31 18:03:07 UTC (rev 2200)
@@ -6,32 +6,32 @@
 using System.Text;
 using ICSharpCode.SharpRefactory.Parser;
 using ICSharpCode.SharpRefactory.Parser.AST;
-using System;
-using System.Reflection;
-
-namespace ICSharpCode.SharpRefactory.Parser {
-
-
-
-public class Parser
-{
+using System;
+using System.Reflection;
+
+namespace ICSharpCode.SharpRefactory.Parser {
+
+
+
+public class Parser
+{
 	const int maxT = 125;
+
+	const  bool   T            = true;
+	const  bool   x            = false;
+	const  int    minErrDist   = 2;
+	const  string errMsgFormat = "-- line {0} col {1}: {2}";  // 0=line, 1=column, 2=text
+	int    errDist             = minErrDist;
+	Errors errors;
+	Lexer  lexer;
+
+	public Errors Errors {
+		get {
+			return errors;
+		}
+	}
+
 
-	const  bool   T            = true;
-	const  bool   x            = false;
-	const  int    minErrDist   = 2;
-	const  string errMsgFormat = "-- line {0} col {1}: {2}";  // 0=line, 1=column, 2=text
-	int    errDist             = minErrDist;
-	Errors errors;
-	Lexer  lexer;
-
-	public Errors Errors {
-		get {
-			return errors;
-		}
-	}
-
-
 #line  10 "cs.ATG" 
 string assemblyName = null;
 
@@ -386,74 +386,74 @@
 /*------------------------------------------------------------------------*
  *----- LEXER TOKEN LIST  ------------------------------------------------*
  *------------------------------------------------------------------------*/
-
-
-/*
-
-*/
-	void SynErr(int n)
-	{
-		if (errDist >= minErrDist) {
-			errors.SynErr(lexer.LookAhead.line, lexer.LookAhead.col, n);
-		}
-		errDist = 0;
-	}
-
-	public void SemErr(string msg)
-	{
-		if (errDist >= minErrDist) {
-			errors.Error(lexer.Token.line, lexer.Token.col, msg);
-		}
-		errDist = 0;
-	}
-	
-	void Expect(int n)
-	{
-		if (lexer.LookAhead.kind == n) {
-			lexer.NextToken();
-		} else {
-			SynErr(n);
-		}
-	}
-	
-	bool StartOf(int s)
-	{
-		return set[s, lexer.LookAhead.kind];
-	}
-	
-	void ExpectWeak(int n, int follow)
-	{
-		if (lexer.LookAhead.kind == n) {
-			lexer.NextToken();
-		} else {
-			SynErr(n);
-			while (!StartOf(follow)) {
-				lexer.NextToken();
-			}
-		}
-	}
-	
-	bool WeakSeparator(int n, int syFol, int repFol)
-	{
-		bool[] s = new bool[maxT + 1];
-		
-		if (lexer.LookAhead.kind == n) {
-			lexer.NextToken();
-			return true; 
-		} else if (StartOf(repFol)) {
-			return false;
-		} else {
-			for (int i = 0; i <= maxT; i++) {
-				s[i] = set[syFol, i] || set[repFol, i] || set[0, i];
-			}
-			SynErr(n);
-			while (!s[lexer.LookAhead.kind]) {
-				lexer.NextToken();
-			}
-			return StartOf(syFol);
-		}
-	}
-	
+
+
+/*
+
+*/
+	void SynErr(int n)
+	{
+		if (errDist >= minErrDist) {
+			errors.SynErr(lexer.LookAhead.line, lexer.LookAhead.col, n);
+		}
+		errDist = 0;
+	}
+
+	public void SemErr(string msg)
+	{
+		if (errDist >= minErrDist) {
+			errors.Error(lexer.Token.line, lexer.Token.col, msg);
+		}
+		errDist = 0;
+	}
+	
+	void Expect(int n)
+	{
+		if (lexer.LookAhead.kind == n) {
+			lexer.NextToken();
+		} else {
+			SynErr(n);
+		}
+	}
+	
+	bool StartOf(int s)
+	{
+		return set[s, lexer.LookAhead.kind];
+	}
+	
+	void ExpectWeak(int n, int follow)
+	{
+		if (lexer.LookAhead.kind == n) {
+			lexer.NextToken();
+		} else {
+			SynErr(n);
+			while (!StartOf(follow)) {
+				lexer.NextToken();
+			}
+		}
+	}
+	
+	bool WeakSeparator(int n, int syFol, int repFol)
+	{
+		bool[] s = new bool[maxT + 1];
+		
+		if (lexer.LookAhead.kind == n) {
+			lexer.NextToken();
+			return true; 
+		} else if (StartOf(repFol)) {
+			return false;
+		} else {
+			for (int i = 0; i <= maxT; i++) {
+				s[i] = set[syFol, i] || set[repFol, i] || set[0, i];
+			}
+			SynErr(n);
+			while (!s[lexer.LookAhead.kind]) {
+				lexer.NextToken();
+			}
+			return StartOf(syFol);
+		}
+	}
+	
 	void CS() {
 
 #line  516 "cs.ATG" 
@@ -1677,9 +1677,6 @@
 #line  980 "cs.ATG" 
 			m.Check(Modifier.Constants); 
 			lexer.NextToken();
-
-#line  981 "cs.ATG" 
-			Point startPos = t.Location; 
 			Type(
 #line  982 "cs.ATG" 
 out type);
@@ -3423,7 +3420,7 @@
 			Expect(1);
 
 #line  1552 "cs.ATG" 
-			string varName = t.val; Point start = t.Location;
+			string varName = t.val; 
 			Expect(80);
 			Expr(
 #line  1553 "cs.ATG" 
@@ -4735,23 +4732,23 @@
 		}
 	}
 
-
-
-	public void Parse(Lexer lexer)
-	{
-		this.errors = lexer.Errors;
-		this.lexer = lexer;
-		errors.SynErr = new ErrorCodeProc(SynErr);
-		lexer.NextToken();
+
+
+	public void Parse(Lexer lexer)
+	{
+		this.errors = lexer.Errors;
+		this.lexer = lexer;
+		errors.SynErr = new ErrorCodeProc(SynErr);
+		lexer.NextToken();
 		CS();
-
-	}
-
-	void SynErr(int line, int col, int errorNumber)
-	{
-		errors.count++; 
-		string s;
-		switch (errorNumber) {
+
+	}
+
+	void SynErr(int line, int col, int errorNumber)
+	{
+		errors.count++; 
+		string s;
+		switch (errorNumber) {
 			case 0: s = "EOF expected"; break;
 			case 1: s = "ident expected"; break;
 			case 2: s = "literal expected"; break;
@@ -4937,13 +4934,13 @@
 			case 182: s = "invalid PrimaryExpr"; break;
 			case 183: s = "invalid RelationalExpr"; break;
 			case 184: s = "invalid RelationalExpr"; break;
-
-			default: s = "error " + errorNumber; break;
-		}
-		errors.Error(line, col, s);
-	}
-
-	static bool[,] set = {
+
+			default: s = "error " + errorNumber; break;
+		}
+		errors.Error(line, col, s);
+	}
+
+	static bool[,] set = {
 	{T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
 	{x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,T, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
 	{x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
@@ -4972,8 +4969,8 @@
 	{x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
 	{x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
 	{x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}
-
-	};
-} // end Parser
-
-}
+
+	};
+} // end Parser
+
+}
\ No newline at end of file

Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG	2005-01-31 17:55:08 UTC (rev 2199)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG	2005-01-31 18:03:07 UTC (rev 2200)
@@ -978,7 +978,7 @@
 .)
 =
 	/*--- constant declaration: */         (. m.Check(Modifier.Constants); .)
-	"const"                                (.Point startPos = t.Location; .)
+	"const"
 	Type<out type> ident                   (. FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifier.Const);
 	                                          VariableDeclaration f = new VariableDeclaration(t.val);
 	                                          fd.Fields.Add(f);
@@ -1549,7 +1549,7 @@
 	  [ Expr<out expr> ] ";"
 	  [ ForIterator<out iterator> ] ")"
 	  EmbeddedStatement<out embeddedStatement> (. statement = new ForStatement(initializer, expr, iterator, embeddedStatement); .)
-	| "foreach" "(" Type<out type> ident     (. string varName = t.val; Point start = t.Location;.)
+	| "foreach" "(" Type<out type> ident     (. string varName = t.val; .)
 	"in" Expr<out expr> ")"
 	EmbeddedStatement<out embeddedStatement> (.  statement = new ForeachStatement(type, varName , expr, embeddedStatement); 
 	                                             statement.EndLocation = t.EndLocation;
@@ -1790,7 +1790,7 @@
 			"bool"   | "byte"   | "char" | "decimal" | "double"
 			| "float"  | "int"    | "long" | "object"  | "sbyte"
 			| "short"  | "string" | "uint" | "ulong"   | "ushort"
-		) (. string val = t.val; t.val = "" .) "." ident (. pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val); .)
+		) (. string val = t.val; t.val = ""; .) "." ident (. pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val); .)
 		/*--- this access: */
 		| "this"                              (. pexpr = new ThisReferenceExpression(); .)
 		/*--- base access: */




More information about the Monodevelop-patches-list mailing list