From: sof Date: Sun, 8 Nov 1998 17:06:13 +0000 (+0000) Subject: [project @ 1998-11-08 17:06:13 by sof] X-Git-Tag: Approx_2487_patches~222 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=838fb9e23a510f80c1f71abecb6fa29b09f5a39f;p=ghc-hetmet.git [project @ 1998-11-08 17:06:13 by sof] front end support for 'foreign label's --- diff --git a/ghc/compiler/parser/hslexer.flex b/ghc/compiler/parser/hslexer.flex index a5adef3..fc1b66b 100644 --- a/ghc/compiler/parser/hslexer.flex +++ b/ghc/compiler/parser/hslexer.flex @@ -401,6 +401,7 @@ NL [\n\r] "_casm_GC_" { RETURN(CASM_GC); } "foreign" { RETURN(FOREIGN); } "export" { RETURN(EXPORT); } +"label" { RETURN(LABEL); } "unsafe" { RETURN(UNSAFE); } "_stdcall" { RETURN(STDCALL); } "_ccall" { RETURN(C_CALL); } diff --git a/ghc/compiler/parser/hsparser.y b/ghc/compiler/parser/hsparser.y index 59d6f9d..8a691fd 100644 --- a/ghc/compiler/parser/hsparser.y +++ b/ghc/compiler/parser/hsparser.y @@ -161,7 +161,7 @@ BOOLEAN pat_check=TRUE; %token SCC %token CCALL CCALL_GC CASM CASM_GC -%token EXPORT UNSAFE STDCALL C_CALL +%token EXPORT UNSAFE STDCALL C_CALL LABEL %token PASCAL FASTCALL FOREIGN DYNAMIC /********************************************************************** @@ -548,6 +548,8 @@ defaultd: defaultkey OPAREN types CPAREN { $$ = mkdbind($3,startlineno); foreignd: foreignkey IMPORT callconv ext_name unsafe_flag qvarid DCOLON sigtype { $$ = mkfobind($6,$8,$4,$5,$3,FOREIGN_IMPORT,startlineno); } | foreignkey EXPORT callconv ext_name qvarid DCOLON sigtype { $$ = mkfobind($5,$7,$4,0,$3,FOREIGN_EXPORT,startlineno); } ; + | foreignkey LABEL ext_name qvarid DCOLON sigtype { $$ = mkfobind($4,$6,$3,0,-1,FOREIGN_LABEL,startlineno); } + ; callconv: STDCALL { $$ = CALLCONV_STDCALL; } | C_CALL { $$ = CALLCONV_CCALL; } diff --git a/ghc/compiler/parser/utils.h b/ghc/compiler/parser/utils.h index 8124440..4ebf921 100644 --- a/ghc/compiler/parser/utils.h +++ b/ghc/compiler/parser/utils.h @@ -122,6 +122,7 @@ void checkprec PROTO((tree, qid, BOOLEAN)); #define FOREIGN_IMPORT 0 #define FOREIGN_EXPORT 1 +#define FOREIGN_LABEL 2 BOOLEAN isconstr PROTO((char *)); void setstartlineno PROTO((void));