public AdapterRef ReadAdapterRef() { var adapterRef = new AdapterRef(); adapterRef.Read(this); return(adapterRef); }
public override void MakeScript(TextWriter writer, Story story, Tuple tuple) { switch (GetRuleType(story)) { case RuleType.Proc: writer.WriteLine("PROC"); break; case RuleType.Query: writer.WriteLine("QRY"); break; case RuleType.Rule: writer.WriteLine("IF"); break; } var initialTuple = MakeInitialTuple(); if (AdapterRef.IsValid) { var adapter = AdapterRef.Resolve(); initialTuple = adapter.Adapt(initialTuple); } ParentRef.Resolve().MakeScript(writer, story, initialTuple); writer.WriteLine("THEN"); foreach (var call in Calls) { call.MakeScript(writer, story, initialTuple); writer.WriteLine(";"); } }
public override void Read(OsiReader reader) { base.Read(reader); ParentRef = reader.ReadNodeRef(); AdapterRef = reader.ReadAdapterRef(); RelDatabaseRef = reader.ReadDatabaseRef(); RelDatabase = new NodeEntryItem(); RelDatabase.Read(reader); RelDatabaseFlag = reader.ReadByte(); }
public override void Read(OsiReader reader) { base.Read(reader); LeftParentRef = reader.ReadNodeRef(); RightParentRef = reader.ReadNodeRef(); Adapter1Ref = reader.ReadAdapterRef(); Adapter2Ref = reader.ReadAdapterRef(); Database1Ref = reader.ReadDatabaseRef(); Database1 = new NodeEntryItem(); Database1.Read(reader); Database1Flag = reader.ReadByte(); Database2Ref = reader.ReadDatabaseRef(); Database2 = new NodeEntryItem(); Database2.Read(reader); Database2Flag = reader.ReadByte(); }
public override void MakeScript(TextWriter writer, Story story, Tuple tuple) { var adaptedTuple = AdapterRef.Resolve().Adapt(tuple); ParentRef.Resolve().MakeScript(writer, story, adaptedTuple); writer.WriteLine("AND"); if (LeftValueIndex != -1) { adaptedTuple.Logical[LeftValueIndex].MakeScript(writer, story, tuple); } else { LeftValue.MakeScript(writer, story, tuple); } switch (RelOp) { case RelOpType.Less: writer.Write(" < "); break; case RelOpType.LessOrEqual: writer.Write(" <= "); break; case RelOpType.Greater: writer.Write(" > "); break; case RelOpType.GreaterOrEqual: writer.Write(" >= "); break; case RelOpType.Equal: writer.Write(" == "); break; case RelOpType.NotEqual: writer.Write(" != "); break; } if (RightValueIndex != -1) { adaptedTuple.Logical[RightValueIndex].MakeScript(writer, story, tuple); } else { RightValue.MakeScript(writer, story, tuple); } writer.WriteLine(); }