Commit 8f2c6691 authored by Brendan Gregg's avatar Brendan Gregg

add multi-line comments

parent 6f5b3fa2
......@@ -27,6 +27,7 @@ space {hspace}|{vspace}
path :(\\.|[_\-\./a-zA-Z0-9])*:
header <(\\.|[_\-\./a-zA-Z0-9])*>
%x STR
%x COMMENT
%%
......@@ -36,7 +37,13 @@ header <(\\.|[_\-\./a-zA-Z0-9])*>
{hspace}+ { loc.step(); }
{vspace}+ { loc.lines(yyleng); loc.step(); }
"//".*$ // Comments
"//".*$ // single-line comments
"/*" BEGIN(COMMENT); // multi-line comments
<COMMENT>"/*" driver.error(loc, std::string("nested comments unsupported"));
<COMMENT>"*/" BEGIN(INITIAL);
<COMMENT>"EOF" driver.error(loc, std::string("end of file during comment"));
<COMMENT>.|"\n" ;
pid|tid|uid|gid|nsecs|cpu|comm|stack|ustack|arg[0-9]|retval|func|name {
return Parser::make_BUILTIN(yytext, loc); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment