This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
C:\Program Files\GnuWin32\bin\m4.exe: internal error detected; please report thi
s bug to <bug-m4@gnu.org>: Aborted
C:\Program Files\GnuWin32\bin\bison.exe: m4: No such file or directory
Bison version: 2.1
m4 version: 1.4.12
Any ideas? How can i solve this?
Thanks,
glutters.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
fprintf(stderr, "error at line: %d, %s", yylineno, msg);
exit(-1);
}
void handleArguments(int argc, char *argv[]){
charc;char*input_file=NULL;char*output_file=NULL;// Può contenere o un percorso ad un file o una directory// NOTA: bisogna definire un formato per le libreriechar*library=NULL;shortassembler_opt=FALSE;intopt_level=0;while((c=getopt(argc,argv,"i:o:L:a:O:"))!=EOF){switch(c){case'i':// input fileinput_file=optarg;break;case'o':// output fileoutput_file=optarg;break;case'L':// library in inputlibrary=optarg;break;case'a':// Compile and assembly in bytecodeassembler_opt=TRUE;break;case'O':opt_level=atoi(optarg);break;default:break;}}// END WHILE
}
int main(int argc, char *argv[]){
// handleArguments(argc,argv);
yyin = stdin;
yyparse();
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
i have an end of the year problem with bison/m4 and windows vista. When i type the following command:
C:\Program Files\GnuWin32\bin\bison.exe -dy mparser.y | C:\Program Files\GnuWin32\bin\m4.exe
i have the error message:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
C:\Program Files\GnuWin32\bin\m4.exe: internal error detected; please report thi
s bug to <bug-m4@gnu.org>: Aborted
C:\Program Files\GnuWin32\bin\bison.exe: m4: No such file or directory
Bison version: 2.1
m4 version: 1.4.12
Any ideas? How can i solve this?
Thanks,
glutters.
Could you upload or include the file mparser.y, or a similar one that shows this behavior?
I've tested this file with byacc and i have no problem.
Yes, but it works on XP.
The code:
%{
define YYSTYPE char* // deve cambiare
include <stdlib.h>
include <getopt.h>
include "error.h"
%}
/
Credo sia opportuno dichiarare un struttura apposita per i token
/
%token NL
%token DOTCOMMA
%token CLASS
%token ASPECT
%token DEF
%token TYPE
%token ID
%token ASSIGN
%token LPAREN
%token RPAREN
%token LSQPAREN
%token RSQPAREN
%token GLPAREN
%token GRPAREN
%token STRINGDQ
%token STRINGSQ
%token PUBLIC
%token PRIVATE
%token PROTECTED
%token INT
%token FLOAT
%token EXNUM
%token CHAR
%token DEFINE
%token ENDIF
%token ASPECT
%token MAIN
%token IFDEF
%token COMPTYPE
%token TYPEOF
%token SELF
%token INIT
%token NOT
%token COMPONENT
%token EXTENDS
%token IMPLEMENTS
%token IF
%token SWITCH
%token CASE
%token IN
%token IMPORT
%token TRY
%token EXCEPT
%token PRINT
%token RAISE
%token WHILE
%token REF
%token LSHIFT
%token RSHIFT
%token BREAK
%token RETURN
%token DIVEQ
%token INCR
%token DECR
%token CLASS
%token INTERFACE
%token DOT
%token TRUE
%token FALSE
%token FOR
%token NEQ
%token DDOT
%token COMMA
%token FOR
%token OR
%token AND
%token EQ
/*********
DEVO USARE QUESTA STRUTTURA UNA VOLTA GENERATA UNA SINTASSI CORRETTA
%union{
char content;
var v;
};
***********/
%left '+' '-' '*' '/'
%left ANDBIT ORBIT XORBIT LT GT LTEQ GTEQ NEQ
%left AND OR EQ
%right LSHIFT RSHIFT
%right NOTBIT NOT
%start lines
%%
// Like python C++ mixed
/*
tutte queste regole vanno aggiunte al disotto
della produzione comp_decl
| modifier INTERFACE ID GLPAREN GRPAREN comp_decl {}
// Produzione iniziale funzionante :-)
lines: lines header COMPONENT ID GLPAREN comp_decl GRPAREN NL
|lines NL
|
|lines error NL { yyerrok;}
;
// Dichiarazione di classe
comp_decl: modifier CLASS ID class_extra GLPAREN class_dec GRPAREN comp_decl {}
|
;
// Dichiarazione di implementazioni di interfaccie e/o estensioni di superclasse
class_extra: DDOT IMPLEMENTS seq_id EXTENDS ID
|
DDOT EXTENDS ID
;
seq_id: ID COMMA seq_id
| ID
;
header: IMPORT seq_imp DOTCOMMA header
| DEFINE "DEBUG" {}
|
;
modifier: PUBLIC
| PRIVATE
| PROTECTED
;
seq_imp: ID DOT seq_imp
|ID
;
class_dec: DEF method_dec class_dec
| modifier TYPE REF ID DOTCOMMA class_dec {}
| modifier TYPE ID DOTCOMMA class_dec {}
| modifier ID ASSIGN TYPE DOTCOMMA class_dec {}
| modifier ID ASSIGN INT DOTCOMMA class_dec {}
| modifier ID ASSIGN EXNUM DOTCOMMA class_dec {}
| modifier ID ASSIGN CHAR DOTCOMMA class_dec {}
| modifier ID ASSIGN STRINGDQ DOTCOMMA class_dec {}
| modifier ID ASSIGN STRINGSQ DOTCOMMA class_dec {}
| modifier ID ASSIGN TRUE DOTCOMMA class_dec {}
| modifier ID ASSIGN FALSE DOTCOMMA class_dec {}
| modifier COMPTYPE REF ID DOTCOMMA class_dec {}
| modifier COMPTYPE ID DOTCOMMA class_dec {}
| modifier ID ASSIGN COMPTYPE DOTCOMMA class_dec {}
| modifier COMPTYPE ID ASSIGN LSQPAREN item_list RSQPAREN DOTCOMMA class_dec {}
| modifier COMPTYPE ID ASSIGN GLPAREN dict_list GRPAREN DOTCOMMA class_dec {}
| modifier COMPTYPE ID ASSIGN LPAREN item_list RPAREN DOTCOMMA class_dec {}
| modifier ID ASSIGN LSQPAREN item_list RSQPAREN DOTCOMMA class_dec {}
| modifier ID ASSIGN GLPAREN dict_list GRPAREN DOTCOMMA class_dec {}
| modifier ID ASSIGN LPAREN item_list RPAREN DOTCOMMA class_dec {}
|
;
method_dec: MAIN LPAREN param_dec RPAREN modifier GLPAREN GRPAREN {/main method/}
| MAIN LPAREN param_dec RPAREN GLPAREN GRPAREN {/main method/}
| INIT LPAREN param_dec RPAREN modifier GLPAREN GRPAREN {/Costruttore/}
| INIT LPAREN param_dec RPAREN GLPAREN GRPAREN {/Costruttore/}
| ID LPAREN param_dec RPAREN modifier GLPAREN GRPAREN {}
| ID LPAREN param_dec RPAREN GLPAREN GRPAREN
;
/
Dengling else problem... ! :-) Risolto
/
param_dec: TYPE REF ID sufx_param_dec
|TYPE ID sufx_param_dec
|ID ASSIGN TYPE sufx_param_dec
|COMPTYPE REF ID sufx_param_dec
|COMPTYPE ID sufx_param_dec
|ID ASSIGN COMPTYPE sufx_param_dec
|COMPTYPE ID ASSIGN LSQPAREN item_list RSQPAREN sufx_param_dec
|COMPTYPE ID ASSIGN LPAREN item_list RPAREN sufx_param_dec
|COMPTYPE ID ASSIGN GLPAREN dict_list GRPAREN sufx_param_dec
|ID ASSIGN LSQPAREN item_list RSQPAREN sufx_param_dec
|ID ASSIGN GLPAREN dict_list GRPAREN sufx_param_dec
|ID ASSIGN LPAREN item_list RPAREN sufx_param_dec
;
sufx_param_dec: COMMA param_dec
|
;
item_list: INT sufx_item_list
| CHAR sufx_item_list
| EXNUM sufx_item_list
| STRINGSQ sufx_item_list
| STRINGDQ sufx_item_list
| FALSE sufx_item_list
| TRUE sufx_item_list
;
sufx_item_list: COMMA item_list
|
;
dict_list: INT DDOT INT sufx_dict_list
|INT DDOT CHAR sufx_dict_list
|INT DDOT STRINGDQ sufx_dict_list
|INT DDOT STRINGSQ sufx_dict_list
|INT DDOT FLOAT sufx_dict_list
|INT DDOT TRUE sufx_dict_list
|INT DDOT FALSE sufx_dict_list
|INT DDOT LPAREN item_list RPAREN sufx_dict_list
|INT DDOT LSQPAREN item_list RSQPAREN sufx_dict_list
sufx_dict_list: COMMA dict_list
|
;
%%
include "lex.yy.c"
int yyerror(char const *msg){
fprintf(stderr, "error at line: %d, %s", yylineno, msg);
exit(-1);
}
void handleArguments(int argc, char *argv[]){
}
int main(int argc, char *argv[]){
// handleArguments(argc,argv);
yyin = stdin;
yyparse();
}