From cf4f6e6da179114b3d7cfc564889401485b57fdf Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 11 Feb 2010 20:32:24 -0500 Subject: Support stream directives. --- dimension/directives.rules | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'dimension/directives.rules') diff --git a/dimension/directives.rules b/dimension/directives.rules index 48cdd77..6f8a812 100644 --- a/dimension/directives.rules +++ b/dimension/directives.rules @@ -53,6 +53,23 @@ LANGUAGE_DIRECTIVE: "#include" STRING { " backwards-compatibility not supported"); dmnsn_delete_astnode($2); } + | "#debug" STRING { + fprintf(stderr, "%s\n", (const char *)$2.ptr); + dmnsn_delete_astnode($2); + } + | "#warning" STRING { + dmnsn_diagnostic(@$.first_filename, @$.first_line, + @$.first_column, + "WARNING: %s", (const char *)$2.ptr); + dmnsn_delete_astnode($2); + } + | "#error" STRING { + dmnsn_diagnostic(@$.first_filename, @$.first_line, + @$.first_column, + "%s", (const char *)$2.ptr); + dmnsn_delete_astnode($2); + YYERROR; + } RVALUE: ARITH_EXPR ";" %dprec 2 { $$ = dmnsn_eval($1, symtable); -- cgit v1.2.3