public override void VisitAssignExpression (AssignExpression node)
	{
		Console.Write ("assign ");

		Visit (node.Expression);

		Console.Write (" to ");

		Visit (node.Target);

		Console.WriteLine ();
	}
Esempio n. 2
0
		public override ICodeNode VisitAssignExpression (AssignExpression node)
		{
			var result = Pattern.CodePattern.Match (SelfAssignmentPattern, node);
			if (!result.Success)
				return base.VisitAssignExpression (node);

			var target = (Expression) result [TargetKey];
			var @operator = (BinaryOperator) result [OperatorKey];

			switch (@operator) {
			case BinaryOperator.Add:
			case BinaryOperator.Subtract:
				return new UnaryExpression (
					GetCorrespondingOperator (@operator), target);
			default:
				return base.VisitAssignExpression (node);
			}
		}
Esempio n. 3
0
 public void EmitAssignExpression(AssignExpression node, int si)
 {
     EmitExpression(node.Expression, si);
     this.Text.Emit("movl %eax, {0}(%ebp)", LookupVariable(node.Target));
 }
Esempio n. 4
0
 public virtual ICodeNode VisitAssignExpression(AssignExpression node)
 {
     node.Target     = (Expression)Visit(node.Target);
     node.Expression = (Expression)Visit(node.Expression);
     return(node);
 }
		public override void VisitAssignExpression (AssignExpression node)
		{
			Write (node.Target);
			WriteTokenBetweenSpace ("=");
			Write (node.Expression);
		}
Esempio n. 6
0
 public override ICodeNode VisitAssignExpression(AssignExpression node)
 {
     node = (AssignExpression)base.VisitAssignExpression(node);
     return new TypedAssignExpression(node.Target, node.Expression);
 }
Esempio n. 7
0
		public virtual void VisitAssignExpression (AssignExpression node)
		{
			Visit (node.Target);
			Visit (node.Expression);
		}
	public static void Main ()
	{
		var assign = new AssignExpression (new BarExpression (), new FooExpression ());

		var printer = new FooPrinter ();

		printer.Visit (assign);
	}
 public virtual void VisitAssignExpression(AssignExpression node)
 {
     Visit(node.Target);
     Visit(node.Expression);
 }