Skip to content

Commit

Permalink
Remove .file, .line, setfile and setline directives from the IMCC par…
Browse files Browse the repository at this point in the history
…ser. These mechanisms are to be replaced by the newer and more flexible .annotate directive.
  • Loading branch information
Whiteknight committed May 13, 2012
1 parent 1952060 commit d27a655
Show file tree
Hide file tree
Showing 5 changed files with 3,077 additions and 3,607 deletions.
6 changes: 0 additions & 6 deletions compilers/imcc/imcc.l
Expand Up @@ -223,10 +223,6 @@ SP [ ]
yy_push_state(cmt4, yyscanner);
}

<*>setfile{SP}+["] { yy_push_state(cmt2, yyscanner); }

<*>setline{SP}+ { yy_push_state(cmt1, yyscanner); }

<cmt1>{DIGITS} {
yylineno = imcc->line = atoi(yytext);
yy_pop_state(yyscanner);
Expand Down Expand Up @@ -284,8 +280,6 @@ SP [ ]

<pod>{EOL} { /* ignore */ }

<*>".line" return TK_LINE;
<*>".file" return TK_FILE;
<INITIAL,emit>".annotate" return ANNOTATE;
<INITIAL,emit>".lex" return LEXICAL;
".set_arg" return ARG;
Expand Down
18 changes: 1 addition & 17 deletions compilers/imcc/imcc.y
Expand Up @@ -1042,7 +1042,7 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib))
%nonassoc '\n'
%nonassoc <t> PARAM

%token <t> SOL HLL TK_LINE TK_FILE
%token <t> SOL HLL
%token <t> GOTO ARG IF UNLESS PNULL SET_RETURN SET_YIELD
%token <t> ADV_FLAT ADV_SLURPY ADV_OPTIONAL ADV_OPT_FLAG ADV_NAMED ADV_ARROW
%token <t> ADV_INVOCANT ADV_CALL_SIG
Expand Down Expand Up @@ -1145,7 +1145,6 @@ compilation_unit:
}
| MACRO '\n' { $$ = 0; }
| pragma { $$ = 0; }
| location_directive { $$ = 0; }
| '\n' { $$ = 0; }
;

Expand All @@ -1159,20 +1158,6 @@ pragma:
}
;

location_directive:
TK_LINE INTC COMMA STRINGC '\n'
{
imcc->line = atoi($2);
/* set_filename() frees the STRINGC */
set_filename(imcc, $4);
}
| TK_FILE STRINGC '\n'
{
/* set_filename() frees the STRINGC */
set_filename(imcc, $2);
}
;

annotate_directive:
ANNOTATE STRINGC COMMA const
{
Expand Down Expand Up @@ -1850,7 +1835,6 @@ statement:
| MACRO '\n' { $$ = 0; }
| FILECOMMENT { $$ = 0; }
| LINECOMMENT { $$ = 0; }
| location_directive { $$ = 0; }
| annotate_directive { $$ = $1; }
;

Expand Down

0 comments on commit d27a655

Please sign in to comment.