public EndPointDescriptor createClone() { EndPointDescriptor result = new EndPointDescriptor(); result.value = value; result.blockId = blockId; result.serviceName = serviceName; result.connectorKey = connectorKey; foreach (EndPointDescriptor epd in FixedArgs) { result.FixedArgs.Add(epd.createClone()); } return result; }
private EndPointDescriptor extractEndPoint(FunctionCall fc) { //Helper.RefineToken(ref fc.Identifier); if (fc.Identifier.EndsWith(";")) fc.Identifier = fc.Identifier.Substring(0, fc.Identifier.Length - 1); EndPointDescriptor endPoint = new EndPointDescriptor(); //! connector mode: !txtResult3.FireEvent(... //{ value mode: {11} //else: service mode txtResult2.SetValue(... if (fc.Identifier.StartsWith("!")) { List<string> tokens = Helper.ExtractTokens(fc.Identifier, "!", "."); endPoint.blockId = tokens[0]; endPoint.connectorKey = tokens[1]; } else if (Helper.IsObject(fc.Identifier)) { endPoint.value = Helper.ReadObject(fc.Identifier.Replace(";","")); } else //service mode { List<string> tokens = Helper.ExtractTokens(fc.Identifier, "."); endPoint.blockId = tokens[0]; endPoint.serviceName = tokens[1]; } foreach (FunctionCall child in fc.Arguments) { endPoint.FixedArgs.Add(extractEndPoint(child)); } return endPoint; }
public override void Process() { string separator = "="; if (processedContents.Contains("+=")) separator = "+="; string[] ownerBody = processedContents.Split(new string[] { separator }, StringSplitOptions.None); string owner = ownerBody[0].Trim(); string body = ownerBody[1].Trim(); endPoint = new EndPointDescriptor(); int idx = owner.IndexOf("."); if (idx == -1) { blockId = null; } else { blockId = owner.Substring(0, idx); } connectorKey = owner.Substring(idx + 1); if (body.Contains("{create}")) { body = body.Replace("{create}", ""); createConnector = true; } List<FunctionCall> fc = Helper.ExtractNestedFunctionCalls(body); endPoint = extractEndPoint(fc[0]); }