/// <summary> /// Creates a control flow symbol node /// </summary> public ControlFlowElementBase CreateControlFlow(ControlFlowElementBase left, ControlFlowElementBase right, String @operator) { Assume.NotNull(left, nameof(left)); Assume.NotNull(right, nameof(right)); Assume.NotNull(@operator, nameof(@operator)); var children = new[] { left, right }; switch (@operator) { case PIPELINE_OPERATOR: return new PipelineControlFlowElement(children); case SEQUENCE_OPERATOR: return new SequenceControlFlowElement(children); case LAZY_AND_OPERATOR: return new LazyAndControlFlowElement(children); default: throw new NotSupportedException(String.Format("Not supported operator: {0}", @operator)); } }
/// <summary> /// Creates a control flow symbol node /// </summary> public ControlFlowElementBase CreateControlFlow(ControlFlowElementBase left, ControlFlowElementBase right, String @operator) { Assume.NotNull(left, nameof(left)); Assume.NotNull(right, nameof(right)); Assume.NotNull(@operator, nameof(@operator)); var children = new[] { left, right }; switch (@operator) { case PIPELINE_OPERATOR: return(new PipelineControlFlowElement(children)); case SEQUENCE_OPERATOR: return(new SequenceControlFlowElement(children)); case LAZY_AND_OPERATOR: return(new LazyAndControlFlowElement(children)); default: throw new NotSupportedException(String.Format("Not supported operator: {0}", @operator)); } }