+"/*" { BEGIN(comment); comm = ""; }
+<comment>[^*\n]* { comm += yytext; }
+<comment>"*"+[^*/]* { comm += yytext; }
+<comment>"*/" {
+ BEGIN(INITIAL);
+ if(comm[0] == '*') { // It's a docu comment...
+ last_docucomment = "";
+ bool linestart = true;
+ for(size_t i = 1; i < comm.size(); ++i) {
+ if(linestart && (comm[i] == '*' || isspace(comm[i]))) {
+ continue;
+ } else if(comm[i] == '\n') {
+ linestart = true;
+ } else {
+ linestart = false;
+ }
+ last_docucomment += comm[i];
+ }
+ }
+}
+\/\/[^\n]*\n {
+ if(yytext[2] == '/') { // it's a docu comment...
+ last_docucomment = std::string(yytext+3, strlen(yytext)-4);
+ }
+}