.bycopy. was originally in the pragma for all the C types. I removed any pragma that didn't seem to help to not obfuscate the issue. The code segfaults in dump_ast at the switch statement. The first 32 bits made me think that it was ntype a c integer that was the issue but I don't think so now. Lemon produces a header in this case called calc.h of token types:
#define ADD 1
#define SUB 2
#define MUL 3
#define DIV 4
#define LPAR 5
#define RPAR 6
#define NUM 7
which the Makefile evokes c2nim to create calc.nim:
const
ADD* = 1
SUB* = 2
MUL* = 3
DIV* = 4
LPAR* = 5
RPAR* = 6
NUM* = 7
The reason I don't think this is the issue is that I hard coded the c int's to their actual values in both calc.y and main.nim and got the same result.
Thank you both for your input.