[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
$2 not a string
From: |
Jim Michaels |
Subject: |
$2 not a string |
Date: |
Sat, 6 Dec 2008 22:45:54 -0800 (PST) |
in the .y file,
|
ZERO T_SECTION
{ SyntaxNode t; t.ystype=0; t.enum_ystype=STRVAL;
t.datum.strval=_strdup($2); deque_put_back(t); }
|
| T__CELTYPE code6
{ SyntaxNode t; t.ystype=9; t.enum_ystype=STRVAL;
t.datum.strval=_strdup($1); deque_put_back(&t); }
| T__CELWEIGHT code370
{ SyntaxNode t; t.ystype=9; t.enum_ystype=STRVAL;
t.datum.strval=_strdup($1); deque_put_back(&t); }
| T__CEPSNID code390
{ SyntaxNode t; t.ystype=9; t.enum_ystype=STRVAL;
t.datum.strval=_strdup($1); deque_put_back(&t); }
I have tried this with yylval and with $2. I get the same results. I am using
bison 2.1 (sorry, it's the latest version available for my platform).
apparently what gets put in as a datum is a null the first time (here).
the rest of the times I use $2 I get an empty string or a crash when I try to
print the string. it works until the 10th item.
what I want is the string value from flex.
help
Jim Michaels
address@hidden
http://JesusnJim.com
- $2 not a string,
Jim Michaels <=