public override object Walk(LeftAssignmentExpression node) { // Identifier, resolve from scope if (node.Variable is Identifier) { var scope = Context.CurrentFrame; var var = ((Identifier)node.Variable); var suffix = new PropertyReferenceSuffix { Identifier = var }; var lvThunk = (Func<object>)(() => var.Accept(this)); var rvThunk = (Func<object>)(() => node.Operand.Accept(this)); return AssignSwitch(node.Operator.Text, scope, suffix, lvThunk, rvThunk); } else { var suffixes = node.Variable is MemberExpression ? ((MemberExpression)node.Variable).Suffixes : ((CallExpression)node.Variable).Suffixes; var secondLastObject = node.Variable is MemberExpression ? Member((MemberExpression)node.Variable, suffixes.ExceptLast()) : Call((CallExpression)node.Variable, suffixes.ExceptLast()); var lvThunk = (Func<object>)(() => node.Variable is MemberExpression ? Member((MemberExpression)node.Variable, suffixes) : Call((CallExpression)node.Variable, suffixes)); var rvThunk = (Func<object>) (() => node.Operand.Accept(this)); var suffix = suffixes[suffixes.Count - 1]; // Static .NET, Console.Out = ...) if (secondLastObject is Type) { return AssignSwitch(node.Operator.Text, secondLastObject, suffix, lvThunk, rvThunk, true); } return AssignSwitch(node.Operator.Text, secondLastObject, suffix, lvThunk, rvThunk); } }
public virtual object Walk(PropertyReferenceSuffix node) { if (Enter(node)) { node.Identifier.Accept(this); } Exit(node); return(null); }
public PropertyReferenceSuffix ParsePropertyReferenceSuffix() { var suffix = new PropertyReferenceSuffix { Token = Next() }; Match(TokenType.Dot); suffix.Identifier = ParseIdentifier(); return(suffix); }
public override object Walk(LeftAssignmentExpression node) { // Identifier, resolve from scope if (node.Variable is Identifier) { var scope = Context.CurrentFrame; var var = ((Identifier)node.Variable); var suffix = new PropertyReferenceSuffix { Identifier = var }; var lvThunk = (Func <object>)(() => var.Accept(this)); var rvThunk = (Func <object>)(() => node.Operand.Accept(this)); return(AssignSwitch(node.Operator.Text, scope, suffix, lvThunk, rvThunk)); } else { var suffixes = node.Variable is MemberExpression ? ((MemberExpression)node.Variable).Suffixes : ((CallExpression)node.Variable).Suffixes; var secondLastObject = node.Variable is MemberExpression ? Member((MemberExpression)node.Variable, suffixes.ExceptLast()) : Call((CallExpression)node.Variable, suffixes.ExceptLast()); var lvThunk = (Func <object>)(() => node.Variable is MemberExpression ? Member((MemberExpression)node.Variable, suffixes) : Call((CallExpression)node.Variable, suffixes)); var rvThunk = (Func <object>)(() => node.Operand.Accept(this)); var suffix = suffixes[suffixes.Count - 1]; // Static .NET, Console.Out = ...) if (secondLastObject is Type) { return(AssignSwitch(node.Operator.Text, secondLastObject, suffix, lvThunk, rvThunk, true)); } return(AssignSwitch(node.Operator.Text, secondLastObject, suffix, lvThunk, rvThunk)); } }
public override void Exit(PropertyReferenceSuffix node) { level--; }
public override bool Enter(PropertyReferenceSuffix node) { Print("PropertyReferenceSuffix"); level++; return true; }
public virtual void Exit(PropertyReferenceSuffix node) { }
public virtual bool Enter(PropertyReferenceSuffix node) { return true; }
public virtual void Exit(PropertyReferenceSuffix node) { }
public virtual bool Enter(PropertyReferenceSuffix node) { return(true); }
public override void Exit(PropertyReferenceSuffix node) { level--; }
public override bool Enter(PropertyReferenceSuffix node) { Print("PropertyReferenceSuffix"); level++; return(true); }
public PropertyReferenceSuffix ParsePropertyReferenceSuffix() { var suffix = new PropertyReferenceSuffix { Token = Next() }; Match(TokenType.Dot); suffix.Identifier = ParseIdentifier(); return suffix; }
public virtual object Walk(PropertyReferenceSuffix node) { if (Enter(node)) { node.Identifier.Accept(this); } Exit(node); return null; }