help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segmentation Fault !


From: Rutu Raghu Manchiganti [T]
Subject: Segmentation Fault !
Date: Sat, 24 Mar 2001 17:51:25 +0530

hi !

I am making a parser using lex and yacc..not flex and bison..so sorry
for posting the  message on this group.

Am working on Solaris 2.6/5.6 on Sun PC !

I get a segmentation fault when i try 2 allocate some memory..here is
the sample code..

[a-zA-Z-]+[0-9]*        {       
                        
                        yylval.name = (char *)malloc(strlen(yytext) + 1);
                        strcpy(yylval.name, yytext);
                        return IDENTIFIER;
                        
                }

This works fine for the first time and gives a segmentation fault the
second time !!

My yylval is 

%union {

        char *name;
        int intval;
        double realval;
}

So any ideas ??

Thanx for the help !

-- 
Rutu Manchiganti, Trainee, Motorola India Electronics Ltd. 
Bangalore.

**************************************
[x] General Business Information
[] Motorola Internal Use only
[] Motorola Confidential Proprietary
**************************************



reply via email to

[Prev in Thread] Current Thread [Next in Thread]