免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7685 | 回复: 0
打印 上一主题 下一主题

请教: request for member `' in something not a structure [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-04-14 22:35 |只看该作者 |倒序浏览
我在编译parser的时候,遇到了这个问题,始终不能解决
request for member `str' in something not a structure or union
请问这个错误是什么意思?谢谢
%union {
    int iValue;                 /* integer value */
    char *str;                /* a character string */
    char *ipValue;            /* node pointer */
    TreeNode *nPtr;
};
%token  <iValue>;INTEGER
%token  <str>;VARIABLE STRING
%token  <ipValue>;IP_ADDR
%token IF PRINT RULE_LEAF RULE_TREE
%token FALSE TRUE
%token PROTO IP ICMP TCP UDP
%token SRC_ADDR DST_ADDR SRC_PORT DST_PORT
%token TTL ID CONTENT OFFSET DEPTH NOCASE FLAGS DSIZE
%token SEQ ITYPE ICODE ICMP_ID IP_OPTION
%token RR EOL NOP TS SEC LSRR SSRR SATID
%token FIN ACK SYN PSH URG RST
%nonassoc IFX
%nonassoc ELSE

%left OR
%left AND
%nonassoc NOT
%left GE LE EQ NE '>;' '<'
%nonassoc UMINUS
%type <nPtr>; stmt expr stmt_list term rterm identifier
%type <nPtr>; rule body function assign var_assign
%type <nPtr>; keyword_offset keyword_depth keyword_nocase keyword_int
%type <nPtr>; keyword_ip keyword_proto keyword_ipoption ip_option keyword_flags
%type <nPtr>; flag keyword_content boolv integer  string proto ip_addr
...

...

rule:

        RULE_TREE string '{' body  '}'  {tree=NewTreeNode(RULE,2,$2,$4);}
        ;

body:   assign function   {$$=NewTreeNode(BODY,2,$1,$2);}
        ;


function:
          function stmt {$$=NewTreeNode(FUNCTION,2,$1,$2);}
...

typedef struct
{
NodeType type;
Value value;
SymDesc *symbol;
KeyWord KeywordIndex;
int nops;
DataType rettype;
TreeNode *child[1];
}TreeNode;

errors:

calc3.y:198: request for member `nPtr' in something not a structure or union
calc3.y:198: request for member `nPtr' in something not a structure or union
calc3.y:199: request for member `nPtr' in something not a structure or union
calc3.y:199: request for member `nPtr' in something not a structure or union
calc3.y:200: request for member `nPtr' in something not a structure or union
calc3.y:200: request for member `nPtr' in something not a structure or union
calc3.y:201: request for member `nPtr' in something not a structure or union
calc3.y:201: request for member `nPtr' in something not a structure or union
calc3.y:202: request for member `nPtr' in something not a structure or union
calc3.y:202: request for member `nPtr' in something not a structure or union
calc3.y:203: request for member `nPtr' in something not a structure or union
calc3.y:203: request for member `nPtr' in something not a structure or union
calc3.y:204: request for member `nPtr' in something not a structure or union
calc3.y:204: request for member `nPtr' in something not a structure or union
calc3.y:207: request for member `nPtr' in something not a structure or union
calc3.y:208: request for member `nPtr' in something not a structure or union
calc3.y:208: request for member `str' in something not a structure or union
...
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP