public static CodegenExpression EvaluateCodegen( ExprEventIdentityEqualsNodeForge forge, CodegenMethodScope parent, ExprForgeCodegenSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(bool?), typeof(ExprEventIdentityEqualsNodeEval), classScope); method.Block .DeclareVar<EventBean>("left", ArrayAtIndex(symbols.GetAddEPS(method), Constant(forge.UndLeft.StreamId))) .DeclareVar<EventBean>("right", ArrayAtIndex(symbols.GetAddEPS(method), Constant(forge.UndRight.StreamId))) .IfCondition(Or(EqualsNull(Ref("left")), EqualsNull(Ref("right")))) .BlockReturn(ConstantNull()) .MethodReturn(StaticMethod<object>("Equals", Ref("left"), Ref("right"))); return LocalMethod(method); }
public override ExprNode Validate(ExprValidationContext validationContext) { if (this.ChildNodes.Length != 2) { throw new ExprValidationException(NAME + "requires two parameters"); } ExprStreamUnderlyingNode undOne = CheckStreamUnd(this.ChildNodes[0]); ExprStreamUnderlyingNode undTwo = CheckStreamUnd(this.ChildNodes[1]); if (undOne.EventType != undTwo.EventType) { throw new ExprValidationException( NAME + " received two different event types as parameter, type '" + undOne.EventType.Name + "' is not the same as type '" + undTwo.EventType.Name + "'"); } forge = new ExprEventIdentityEqualsNodeForge(this, undOne, undTwo); return(null); }