char *desc; // token description
long long min, max; // for ranges
char *arg; // user input that matches this token
+
+ struct graph_node *forkjoin; // paired FORK/JOIN for JOIN/FORK
};
/* Structure of command element. */
$$ = malloc (sizeof (struct subgraph));
$$->start = new_token_node (ctx, FORK_TKN, NULL, NULL);
$$->end = new_token_node (ctx, JOIN_TKN, NULL, NULL);
+ ((struct cmd_token *)$$->start->data)->forkjoin = $$->end;
+ ((struct cmd_token *)$$->end->data)->forkjoin = $$->start;
for (unsigned int i = 0; i < vector_active ($2->start->to); i++)
{
struct graph_node *sn = vector_slot ($2->start->to, i),
$$ = malloc (sizeof (struct subgraph));
$$->start = new_token_node (ctx, FORK_TKN, NULL, NULL);
$$->end = new_token_node (ctx, JOIN_TKN, NULL, NULL);
+ ((struct cmd_token *)$$->start->data)->forkjoin = $$->end;
+ ((struct cmd_token *)$$->end->data)->forkjoin = $$->start;
graph_add_edge ($$->start, $$->end);
for (unsigned int i = 0; i < vector_active ($2->start->to); i++)
{
$$ = malloc (sizeof (struct subgraph));
$$->start = new_token_node (ctx, FORK_TKN, NULL, NULL);
$$->end = new_token_node (ctx, JOIN_TKN, NULL, NULL);
+ ((struct cmd_token *)$$->start->data)->forkjoin = $$->end;
+ ((struct cmd_token *)$$->end->data)->forkjoin = $$->start;
// add a path through the sequence to the end
graph_add_edge ($$->start, $2->start);
graph_add_edge ($2->end, $$->end);