summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-03-11 14:06:57 +0100
committerClifford Wolf <clifford@clifford.at>2014-03-11 14:06:57 +0100
commit9992026a8d4482abd8fbae8cb246a87cbbbde364 (patch)
treeeada4274a949b485c093fad1370cec1b0ba88a89 /frontends
parentfa75c8286e066ba4b73da94068662834cb671640 (diff)
Added support for `line compiler directive
Diffstat (limited to 'frontends')
-rw-r--r--frontends/verilog/lexer.l11
1 files changed, 11 insertions, 0 deletions
diff --git a/frontends/verilog/lexer.l b/frontends/verilog/lexer.l
index 79f44b4a..e3e5e4ab 100644
--- a/frontends/verilog/lexer.l
+++ b/frontends/verilog/lexer.l
@@ -75,6 +75,17 @@ namespace VERILOG_FRONTEND {
ln_stack.pop_back();
}
+"`line"[ \t]+[^ \t\r\n]+[ \t]+\"[^ \r\n]+\"[^\r\n]*\n {
+ char *p = yytext + 5;
+ while (*p == ' ' || *p == '\t') p++;
+ frontend_verilog_yyset_lineno(atoi(p));
+ while (*p && *p != ' ' && *p != '\t') p++;
+ while (*p == ' ' || *p == '\t') p++;
+ char *q = *p ? p + 1 : p;
+ while (*q && *q != '"') q++;
+ current_filename = std::string(p).substr(1, q-p-1);
+}
+
"`file_notfound "[^\n]* {
log_error("Can't open include file `%s'!\n", yytext + 15);
}