/// <summary> /// A list with all the generators /// </summary> /// <param name="context">The context</param> public AllGenerators(WalkerContext context) { AddAssignment = new AssignmentGenerator(context, AssignmentType.Add); AddressOfExpression = new AddressOfExpressionGenerator(context); ArgumentList = new ArgumentListGenerator(context); ArrayCreationExpression = new ArrayCreationExpressionGenerator(context); ArrayInitializerExpression = new ArrayInitializerGenerator(context); BinaryAndAssignment = new AssignmentGenerator(context, AssignmentType.BinaryAnd); BinaryOrAssignment = new AssignmentGenerator(context, AssignmentType.BinaryOr); Block = new BlockGenerator(context); CastExpression = new CastExpressionGenerator(context); ConditionalAccessExpression = new ConditionalAccessExpressionGenerator(context); ClassCode = new ClassCodeGenerator(context); DelegateDeclaration = new DelegateDeclarationGenerator(context); DoStatement = new DoStatementGenerator(context); DivideAssignment = new AssignmentGenerator(context, AssignmentType.Divide); ElementAccess = new ElementAccessGenerator(context); Enum = new EnumGenerator(context); ExclusiveOrAssignment = new AssignmentGenerator(context, AssignmentType.ExclusiveOr); Expression = new ExpressionGenerator(context); ExpressionStatement = new ExpressionStatementGenerator(context); FixedStatement = new FixedStatementGenerator(context); ForStatement = new ForStatementGenerator(context); GotoStatement = new GotoStatementGenerator(context); IfStatement = new IfStatementGenerator(context); Invocation = new InvocationGenerator(context); Interface = new InterfaceGenerator(context); IdentifierName = new IdentifierNameGenerator(context); LabeledStatement = new LabeledStatementGenerator(context); LeftShiftAssignment = new AssignmentGenerator(context, AssignmentType.LeftShift); LocalDeclaration = new LocalDeclarationGenerator(context); MethodDeclaration = new MethodGenerator(context); ModuloAssignment = new AssignmentGenerator(context, AssignmentType.Modulo); MultiplyAssignment = new AssignmentGenerator(context, AssignmentType.Multiply); ObjectCreationExpression = new ObjectCreationExpressionGenerator(context); PreIncrementExpression = new PrePostExpressionGenerator(context, ExpressionType.PreIncrement); PreDecrementExpression = new PrePostExpressionGenerator(context, ExpressionType.PreDecrement); PostIncrementExpression = new PrePostExpressionGenerator(context, ExpressionType.PostIncrement); PostDecrementExpression = new PrePostExpressionGenerator(context, ExpressionType.PostDecrement); PointerMemberAccessExpression = new PointerMemberAccessGenerator(context); Property = new PropertyGenerator(context); ReturnStatement = new ReturnStatementGenerator(context); RightShiftAssignment = new AssignmentGenerator(context, AssignmentType.RightShift); SimpleAssignment = new SimpleAssignmentGenerator(context); SimpleMemberAccess = new SimpleMemberAccessGenerator(context); SizeOfExpression = new SizeofExpressionGenerator(context); Struct = new StructGenerator(context); SubstractAssignment = new AssignmentGenerator(context, AssignmentType.Substract); SwitchStatement = new SwitchStatementGenerator(context); checkedStatement = new checkedStatementGenerator(context); Variable = new VariableGenerator(context); WhileStatement = new WhileStatementGenerator(context); }
public bool Validate(ProcessContext context, WalkerContext token) { // TODO: Should be asynchronous process foreach (var p in this._predicates) { if (p(context, token).Result == false) { return(false); } } return(true); }
public void CreateWalker(Transition transition, WalkerContext token = null) { if (token == null) { token = new WalkerContext(); } var walker = new Walker(); token.Transitions.Add(transition); walker.SetToken(token); this._walkers.Add(walker); }
public WorkflowStation(string id, NormalNode rootNode, WalkerContext context) { _walkerContext = context ?? throw new ArgumentNullException(nameof(context)); _rootNode = rootNode ?? throw new ArgumentNullException(nameof(rootNode)); _registeredNodeList = new List <Node> { _rootNode }; Id = id; Name = _rootNode.Name; _rootNode.IsRoot = true; _rootNode.UpdateWorkflowContainer(this); _startNode = new StartNode(this); _endNode = new EndNode(this); }
public (WalkerContext, IList <Transition>) execute( ProcessContext context, WalkerContext token) { ExecutionDelegate next = (c, t) => Task.CompletedTask; foreach (var exec in this._executions) { next = exec(next); } next(context, token).Wait(); return(token, this.OutgoingTransitions); }
/// <summary> /// Block generator /// </summary> /// <param name="context">The walker context</param> public BlockGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Argument list generator /// </summary> /// <param name="context">The walker context</param> public ArgumentListGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Enum statement generator /// </summary> /// <param name="context">The walker context</param> public EnumGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Fixed statement generator /// </summary> /// <param name="context">The walker context</param> public FixedStatementGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Delegate declaration generator /// </summary> /// <param name="context">The walker context</param> public DelegateDeclarationGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Element access expression generator /// </summary> /// <param name="context">The walker context</param> public ElementAccessGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Expression generator /// </summary> /// <param name="context">The walker context</param> public ExpressionGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Class field generator /// </summary> /// <param name="context">The walker context</param> public ClassCodeGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Expression generator /// </summary> /// <param name="context">The walker context</param> public ExpressionStatementGenerator(WalkerContext context) { m_context = context; }
/// <summary> /// Class struct generator /// </summary> /// <param name="context">The walker context</param> /// <param name="classCode">Class code</param> public ClassStructGenerator(WalkerContext context, ClassCodeData classCode) { m_context = context; m_classCode = classCode; }
/// <summary> /// Conditional access expression generator /// </summary> /// <param name="context">The walker context</param> public ConditionalAccessExpressionGenerator(WalkerContext context) { m_context = context; }
public void SetToken(WalkerContext token) { this.Token = token; }
public Walker() { this.Id = Guid.NewGuid(); this.Token = new WalkerContext(); }
/// <summary> /// Assignment generator /// </summary> /// <param name="context">The walker context</param> /// <param name="assignmentType">Assignment type</param> public AssignmentGenerator(WalkerContext context, AssignmentType assignmentType) { m_context = context; m_assignmentType = assignmentType; }
/// <summary> /// Walks through the syntax and outputs C code to a string /// </summary> public SyntaxWalker(string initSuffix) : base(SyntaxWalkerDepth.Node) { m_context = new WalkerContext(); m_initSuffix = initSuffix; }
/// <summary> /// Array initializer expression generator /// </summary> /// <param name="context">The walker context</param> public ArrayInitializerGenerator(WalkerContext context) { m_context = context; }
public abstract Task Next(WalkerContext context);
public WorkflowContext(WalkerContext context) { WalkerContext = context ?? throw new ArgumentNullException(nameof(context)); }
/// <summary> /// Sizeof statement generator /// </summary> /// <param name="context">The walker context</param> public ArrayCreationExpressionGenerator(WalkerContext context) { m_context = context; }