The CST code creates tuples with: return T[0] = mktuple(G_ELSEQ, alt, phrases, T); The AST code gets it wrong and returns T[0] which contains nothing sensible. (It should contain an index to arbitrary user tuples. Also $$ and $1 $2 etc yacc-style to be added to takeon? Aside: still need to put P_xxx in the grammar at index G_x... ------------------------------------------------------------------------------- gtoal@linux:~/github/uparse-main$ cat array2d.c int fred[6][4]; $define fred[a][b] fred[(a)+1][(b)+2] fred[23][45] = 123; gtoal@linux:~/github/uparse-main$ gtcpp < array2d.c #line 1 "" int fred[6][4]; fred[(23)+1][(45)+2] = 123; Would be helpful to extend it with scopes - $begin/$end as in HAL. Which would also imply a command to push a definition so that an earlier one encountered before the last $begin was restored on a $end ... btw may want to reverse order of indexes because I believe Imp and C differ as to row/column-major. C's right-to-left evaluation of parameters is annoying - but I did find a note by Peter Stephens that Imp's order of evaluation was undefined and that if you wanted to force an order you should assign each parameter to a variable in whatever order you wanted before calling the procedure. So just document and maybe warn rather than implement differently. ------------------------------------------------------------------------------- #pragma GCC diagnostic error "-Wuninitialized" foo(a); /* error is given for this one */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wuninitialized" foo(b); /* no diagnostic for this one */ #pragma GCC diagnostic pop foo(c); /* error is given for this one */ #pragma GCC diagnostic pop foo(d); /* depends on command line options */ - to allow checks but suppress them for things like << or calculating a hash where the multiplication is allowed to overflow. Maybe invoke with a %control? -------------------------------------------------------------------------------