bug-bison
[Top][All Lists]
Advanced

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

assertion failure


From: Hagai Sela
Subject: assertion failure
Date: Mon, 19 Aug 2002 05:25:51 -0700 (PDT)

The attached file produces the following error
message:
Assertion failed: actions_dumped == 1, file output.c,
line 1236

abnormal program termination

The command line was:
bison -v -d html.ypp -o html.tab.cpp

The Bison version is 1.35. I am running it on windows
2000 Professional.

Thanks,
Hagai Sela.






__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void yyerror(const char *msg);
int yylex(void);

#define FALSE           (0)
#define TRUE            (!FALSE)
#include "types.h"

int yydebug = 1;
int g_InTag = FALSE;
Att_Type gAtt;

%}

%pure_parser

%union
{
        char* pChar;
        Att_Type Att;
}

%token <pChar> STRING TAG_START TAG_END EQUALS
%type <pChar> attribute_value 
%type <Att> attribute

%%
        document:       field_list;

        field_list:     field_list field
                                |;


        field:  tag

                        | STRING
                        {
                                int i=1;
                        };



        tag:    TAG_START STRING attribute_list TAG_END
                {
                        /* if the list has src, find it */
                        
                }
                |       TAG_START error
                {
                        /* in case of error read characters until tag end */

                        while (yychar != TAG_END)
                                yychar = yylex();

                        yychar = yylex();
                };

        attribute_list: attribute_list attribute
        |;

        attribute:      STRING attribute_value  
                {
                        $$.Name = strdup($1);
                        $$.Val = strdup($2);
                };

        attribute_value:        EQUALS STRING
                {
                        $$ = strdup($2);
                }
                |
                
                {
                        $$ = NULL;
                };

%%



int main(int argc, char** argv)
{
        extern FILE* yyin;

        yyin = fopen(argv[1], "r");

        /* If we could not open the input file, print an error and exit.*/
        if (yyin == NULL)
        {
                fprintf(stderr, "Could not open file %s. aborting.\n", argv[1]);
                exit(-1);
        }

        if (yyparse())
                fprintf(stderr, "Parse failed.\n");
        else
        {
        }
        return 0;
}

reply via email to

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