vala r2452 - in trunk: . gobject vala



Author: juergbi
Date: Wed Feb 18 18:26:14 2009
New Revision: 2452
URL: http://svn.gnome.org/viewvc/vala?rev=2452&view=rev

Log:
2009-02-18  JÃrg Billeter  <j bitron ch>

	* vala/Makefile.am:
	* vala/valaassignment.vala:
	* vala/valacodevisitor.vala:
	* vala/valacodewriter.vala:
	* vala/valagenieparser.vala:
	* vala/valaparenthesizedexpression.vala:
	* vala/valaparser.vala:
	* vala/valasymbolresolver.vala:
	* vala/valaunaryexpression.vala:
	* gobject/valaccodebasemodule.vala:
	* gobject/valaccodegenerator.vala:
	* gobject/valaccodemodule.vala:

	Remove ParenthesizedExpression to simmplify AST


Removed:
   trunk/vala/valaparenthesizedexpression.vala
Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodebasemodule.vala
   trunk/gobject/valaccodegenerator.vala
   trunk/gobject/valaccodemodule.vala
   trunk/vala/Makefile.am
   trunk/vala/valaassignment.vala
   trunk/vala/valacodevisitor.vala
   trunk/vala/valacodewriter.vala
   trunk/vala/valagenieparser.vala
   trunk/vala/valaparser.vala
   trunk/vala/valasymbolresolver.vala
   trunk/vala/valaunaryexpression.vala

Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala	(original)
+++ trunk/gobject/valaccodebasemodule.vala	Wed Feb 18 18:26:14 2009
@@ -2412,12 +2412,6 @@
 		expr.ccodenode = new CCodeConstant ("NULL");
 	}
 
-	public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
-		expr.accept_children (codegen);
-
-		expr.ccodenode = new CCodeParenthesizedExpression ((CCodeExpression) expr.inner.ccodenode);
-	}
-
 	public virtual string get_delegate_target_cname (string delegate_cname) {
 		assert_not_reached ();
 	}
@@ -2466,11 +2460,6 @@
 	}
 	
 	private MemberAccess? find_property_access (Expression expr) {
-		if (expr is ParenthesizedExpression) {
-			var pe = (ParenthesizedExpression) expr;
-			return find_property_access (pe.inner);
-		}
-	
 		if (!(expr is MemberAccess)) {
 			return null;
 		}

Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala	(original)
+++ trunk/gobject/valaccodegenerator.vala	Wed Feb 18 18:26:14 2009
@@ -1,6 +1,7 @@
 /* valaccodegenerator.vala
  *
- * Copyright (C) 2006-2008  JÃrg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2009  JÃrg Billeter
+ * Copyright (C) 2006-2008  Raffaele Sandrini
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -263,10 +264,6 @@
 		head.visit_null_literal (expr);
 	}
 
-	public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
-		head.visit_parenthesized_expression (expr);
-	}
-
 	public override void visit_member_access (MemberAccess expr) {
 		head.visit_member_access (expr);
 	}

Modified: trunk/gobject/valaccodemodule.vala
==============================================================================
--- trunk/gobject/valaccodemodule.vala	(original)
+++ trunk/gobject/valaccodemodule.vala	Wed Feb 18 18:26:14 2009
@@ -260,10 +260,6 @@
 		next.visit_null_literal (expr);
 	}
 
-	public virtual void visit_parenthesized_expression (ParenthesizedExpression expr) {
-		next.visit_parenthesized_expression (expr);
-	}
-
 	public virtual void visit_member_access (MemberAccess expr) {
 		next.visit_member_access (expr);
 	}

Modified: trunk/vala/Makefile.am
==============================================================================
--- trunk/vala/Makefile.am	(original)
+++ trunk/vala/Makefile.am	Wed Feb 18 18:26:14 2009
@@ -101,7 +101,6 @@
 	valaobjectcreationexpression.vala \
 	valaobjecttype.vala \
 	valaobjecttypesymbol.vala \
-	valaparenthesizedexpression.vala \
 	valaparser.vala \
 	valaphifunction.vala \
 	valapointerindirection.vala \

Modified: trunk/vala/valaassignment.vala
==============================================================================
--- trunk/vala/valaassignment.vala	(original)
+++ trunk/vala/valaassignment.vala	Wed Feb 18 18:26:14 2009
@@ -184,7 +184,7 @@
 			if (!(ma.symbol_reference is Signal)) {
 				var old_value = new MemberAccess (ma.inner, ma.member_name);
 
-				var bin = new BinaryExpression (BinaryOperator.PLUS, old_value, new ParenthesizedExpression (right, right.source_reference));
+				var bin = new BinaryExpression (BinaryOperator.PLUS, old_value, right);
 				bin.target_type = right.target_type;
 				right.target_type = right.target_type.copy ();
 				right.target_type.value_owned = false;

Modified: trunk/vala/valacodevisitor.vala
==============================================================================
--- trunk/vala/valacodevisitor.vala	(original)
+++ trunk/vala/valacodevisitor.vala	Wed Feb 18 18:26:14 2009
@@ -1,6 +1,7 @@
 /* valacodevisitor.vala
  *
- * Copyright (C) 2006-2008  JÃrg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2009  JÃrg Billeter
+ * Copyright (C) 2006-2008  Raffaele Sandrini
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -468,14 +469,6 @@
 	}
 
 	/**
-	 * Visit operation called for parenthesized expressions.
-	 *
-	 * @param expr a parenthesized expression
-	 */
-	public virtual void visit_parenthesized_expression (ParenthesizedExpression expr) {
-	}
-
-	/**
 	 * Visit operation called for member access expressions.
 	 *
 	 * @param expr a member access expression

Modified: trunk/vala/valacodewriter.vala
==============================================================================
--- trunk/vala/valacodewriter.vala	(original)
+++ trunk/vala/valacodewriter.vala	Wed Feb 18 18:26:14 2009
@@ -1297,12 +1297,6 @@
 		write_string ("null");
 	}
 
-	public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
-		write_string ("(");
-		expr.inner.accept (this);
-		write_string (")");
-	}
-
 	public override void visit_member_access (MemberAccess expr) {
 		if (expr.inner != null) {
 			expr.inner.accept (this);

Modified: trunk/vala/valagenieparser.vala
==============================================================================
--- trunk/vala/valagenieparser.vala	(original)
+++ trunk/vala/valagenieparser.vala	Wed Feb 18 18:26:14 2009
@@ -619,7 +619,6 @@
 	}
 
 	Expression parse_tuple () throws ParseError {
-		var begin = get_location ();
 		expect (TokenType.OPEN_PARENS);
 		var expr_list = new ArrayList<Expression> ();
 		if (current () != TokenType.CLOSE_PARENS) {
@@ -635,7 +634,7 @@
 			}
 			return tuple;
 		}
-		return new ParenthesizedExpression (expr_list.get (0), get_src (begin));
+		return expr_list.get (0);
 	}
 
 	Expression parse_member_access (SourceLocation begin, Expression inner) throws ParseError {

Modified: trunk/vala/valaparser.vala
==============================================================================
--- trunk/vala/valaparser.vala	(original)
+++ trunk/vala/valaparser.vala	Wed Feb 18 18:26:14 2009
@@ -575,7 +575,6 @@
 	}
 
 	Expression parse_tuple () throws ParseError {
-		var begin = get_location ();
 		expect (TokenType.OPEN_PARENS);
 		var expr_list = new ArrayList<Expression> ();
 		if (current () != TokenType.CLOSE_PARENS) {
@@ -591,7 +590,7 @@
 			}
 			return tuple;
 		}
-		return new ParenthesizedExpression (expr_list.get (0), get_src (begin));
+		return expr_list.get (0);
 	}
 
 	Expression parse_member_access (SourceLocation begin, Expression inner) throws ParseError {

Modified: trunk/vala/valasymbolresolver.vala
==============================================================================
--- trunk/vala/valasymbolresolver.vala	(original)
+++ trunk/vala/valasymbolresolver.vala	Wed Feb 18 18:26:14 2009
@@ -419,10 +419,6 @@
 		e.accept_children (this);
 	}
 
-	public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
-		expr.accept_children (this);
-	}
-
 	public override void visit_member_access (MemberAccess expr) {
 		expr.accept_children (this);
 	}

Modified: trunk/vala/valaunaryexpression.vala
==============================================================================
--- trunk/vala/valaunaryexpression.vala	(original)
+++ trunk/vala/valaunaryexpression.vala	Wed Feb 18 18:26:14 2009
@@ -1,6 +1,6 @@
 /* valaunaryexpression.vala
  *
- * Copyright (C) 2006-2008  JÃrg Billeter
+ * Copyright (C) 2006-2009  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -124,11 +124,6 @@
 	}
 
 	MemberAccess? find_member_access (Expression expr) {
-		if (expr is ParenthesizedExpression) {
-			var pe = (ParenthesizedExpression) expr;
-			return find_member_access (pe.inner);
-		}
-
 		if (expr is MemberAccess) {
 			return (MemberAccess) expr;
 		}
@@ -207,11 +202,10 @@
 			var bin = new BinaryExpression (operator == UnaryOperator.INCREMENT ? BinaryOperator.PLUS : BinaryOperator.MINUS, old_value, new IntegerLiteral ("1"), source_reference);
 
 			var assignment = new Assignment (ma, bin, AssignmentOperator.SIMPLE, source_reference);
-			var parenthexp = new ParenthesizedExpression (assignment, source_reference);
-			parenthexp.target_type = target_type;
+			assignment.target_type = target_type;
 			analyzer.replaced_nodes.add (this);
-			parent_node.replace_expression (this, parenthexp);
-			parenthexp.check (analyzer);
+			parent_node.replace_expression (this, assignment);
+			assignment.check (analyzer);
 			return true;
 		} else if (operator == UnaryOperator.REF || operator == UnaryOperator.OUT) {
 			if (inner.symbol_reference is Field || inner.symbol_reference is FormalParameter || inner.symbol_reference is LocalVariable) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]