bug-bison
[Top][All Lists]
Advanced

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

Bison does not generate a output file!


From: 손우상
Subject: Bison does not generate a output file!
Date: Wed, 21 May 2014 16:40:21 +0800

I am using the bison 2.4.1 on Solaris 10.
I cannot have any output file using bison.

prompt> bison -d sample.y

--> no output file, but bison quit successfully.


What is wrong?
How I can get output c file?

sample.y is sample code i used

=======================================================
%{
#include <stdio.h>
%}

// Symbols.
%union
{
        char    *sval;
};
%token <sval> IDENTIFIER
%token PROCEDURE
%token BLOCK
%token ENDBLOCK

%start Procedure
%%

Procedure:
        PROCEDURE IDENTIFIER BLOCK { printf("Procedure : %s\n", $2); }
        Parts
        ENDBLOCK
        ;

Parts:
        /* empty */
        | Parts Part
        ;

Part:
        IDENTIFIER BLOCK { printf("\tPart : %s\n", $1); }
                Keywords
        ENDBLOCK
        ;

Keywords:
        /* empty */
        | Keywords Keyword
        ;

Keyword:
        IDENTIFIER { printf("\t\tKeyword : %s\n", $1); }
        ;
%%

int yyerror(char *s) {
  printf("yyerror : %s\n",s);
}

int main(void) {
  yyparse();
}
===============================================================


reply via email to

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