191 {Option} {
192 BEGIN (Option);
193 }
194<Option>"prefix"{ws}*"="{ws}* {
195 BEGIN (OptPrefix);
196 }
197<OptPrefix>"\""[^\"]*"\"" {
198 yyextra->prefix = yytext;
199 yyextra->prefix = yyextra->prefix.mid(1,yyleng-2);
200 BEGIN (Option);
201 }
202<Option>"reentrant" {
203 yyextra-> reentrant = true;
204 }
205<Option>"bison-bridge" {
206 yyextra-> bison_bridge = true;
207 }
208<Option>"bison-locations" {
209 yyextra-> bison_bridge = true;
210 yyextra-> bison_locations = true;
211 }
212<Option>{nws}+
213<Option>{ws}+
214<Option>{nl} {
215 yyextra->cCodeBuffer += yytext;
216 BEGIN (DefSection);
217 }
218<DefSection>^{RulesStart} {
219 {
220 bool fill = false;
221 yyextra->cCodeBuffer += "int " + yyextra->prefix + "lex (";
222 if (yyextra->bison_bridge )
223 {
224 if (fill) yyextra->cCodeBuffer += ",";
225 yyextra->cCodeBuffer += "YYSTYPE * yylval_param";
226 fill = true;
227 }
228 if (yyextra->bison_locations)
229 {
230 if (fill) yyextra->cCodeBuffer += ",";
231 yyextra->cCodeBuffer += "YYLTYPE * yylloc_param";
232 fill = true;
233 }
234 if (yyextra->reentrant)
235 {
236 if (fill) yyextra->cCodeBuffer += ",";
237 yyextra->cCodeBuffer += "yyscan_t yyscanner";
238 fill = true;
239 }
240 if (!yyextra->bison_bridge && !yyextra->bison_locations && !yyextra->reentrant)
241 {
242 yyextra->cCodeBuffer += "void";
243 }
244 yyextra->cCodeBuffer += ") {\n";
245 }
246 BEGIN (RulesSectionInit);
247 }
248<DefSection>^{TopStart} {
249 yyextra->cCodeBuffer += "\n";
250 yyextra->lastContext = YY_START;
251 BEGIN (TopSection);
252 }
253<DefSection>^{LiteralStart} {
254 yyextra->cCodeBuffer += "\n";
255 yyextra->lastContext = YY_START;
256 BEGIN (LiteralSection);
257 }
258<TopSection>^{TopEnd} {
259 yyextra->cCodeBuffer += "\n";
260 BEGIN( yyextra->lastContext ) ;
261 }
262<TopSection>.*{nl} {
263 yyextra->cCodeBuffer += yytext;
264 }
265<LiteralSection>^{LiteralEnd} {
266 yyextra->cCodeBuffer += "\n";
267 BEGIN( yyextra->lastContext ) ;
268 }
269<LiteralSection>.*{nl} {
270 yyextra->cCodeBuffer += yytext;
271 }
272<DefSection>^{nws} {
273 BEGIN(DefSectionLine);
274 }
275<DefSection>{CPPC}.*{nl} {
276 yyextra->cCodeBuffer += yytext;
277 }
278<DefSection>^{ws}*{CCS} {
279 yyextra->cCodeBuffer += yytext;
280 yyextra->lastContext = YY_START;
281 BEGIN(COMMENT);
282 }
283<COMMENT>{CCE}{ws}*{nl} {
284 yyextra->cCodeBuffer+=yytext;
285 BEGIN(yyextra->lastContext);
286 }
287<COMMENT>{CCE} {
288 yyextra->cCodeBuffer+=yytext;
289 BEGIN(yyextra->lastContext);
290 }
291<COMMENT>[^*\n]+ {
292 yyextra->cCodeBuffer += yytext;
293 }
294<COMMENT>{CPPC}|{CCS} {
295 yyextra->cCodeBuffer += yytext;
296 }
297<COMMENT>{nl} {
298 yyextra->cCodeBuffer += yytext;
299 }
300<COMMENT>. {
301 yyextra->cCodeBuffer += yytext;
302 }
303<DefSection>^{nl} {
304 yyextra->cCodeBuffer += "\n";
305 }
306<DefSection>^{ws}.*{nl} {
307 yyextra->cCodeBuffer += yytext;
308 }
309<DefSectionLine>.*{nl} {
310 yyextra->cCodeBuffer += "\n";
311 BEGIN(DefSection);
312 }
313<RulesSectionInit,RulesPattern>^{RulesEnd} {
314 yyextra->cCodeBuffer += "}\n";
315 BEGIN (UserSection);
316 }
317<RulesSectionInit>^{nws} {
318 unput(*yytext);
319 BEGIN(RulesPattern);
320 }
321<RulesSectionInit>^{ws}.*{nl} {
322 yyextra->cCodeBuffer += yytext;
323 }
324<RulesSectionInit>^{nl} {
325 yyextra->cCodeBuffer += yytext;
326 }
327<RulesPattern>"<<EOF>>" {
328 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
329 }
#define repeatChar(chr, cnt)
330<RulesPattern>{EscapeRulesChar} {
331 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
332 }
333<RulesPattern>{RulesSharp} {
334 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
335 }
336<RulesPattern>{RulesCurly} {
337 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
338 }
339<RulesPattern>{StartDouble} {
340 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
341 yyextra->lastContext = YY_START;
342 BEGIN(RulesDouble);
343 }
344<RulesDouble,RulesRoundDouble>"\\\\" {
345 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
346 }
347<RulesDouble,RulesRoundDouble>"\\\"" {
348 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
349 }
350<RulesDouble>"\"" {
351 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
352 BEGIN( yyextra->lastContext ) ;
353 }
354<RulesRoundDouble>"\"" {
355 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
356 BEGIN(RulesRound) ;
357 }
358<RulesDouble,RulesRoundDouble>. {
359 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
360 }
361<RulesPattern>{StartSquare} {
362 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
363 yyextra->lastContext = YY_START;
364 BEGIN(RulesSquare);
365 }
366<RulesSquare,RulesRoundSquare>{CHARCE} {
367 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
368 }
369<RulesSquare,RulesRoundSquare>"\\[" |
370<RulesSquare,RulesRoundSquare>"\\]" {
371 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
372 }
373<RulesSquare>"]" {
374 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
375 BEGIN(RulesPattern);
376 }
377<RulesRoundSquare>"]" {
378 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
379 BEGIN(RulesRound) ;
380 }
381<RulesSquare,RulesRoundSquare>"\\\\" {
382 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
383 }
384<RulesSquare,RulesRoundSquare>. {
385 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
386 }
387<RulesPattern>{StartRoundQuest} {
388 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
389 yyextra->lastContext = YY_START;
390 BEGIN(RulesRoundQuest);
391 }
392<RulesRoundQuest>{nl} {
393 yyextra->cCodeBuffer += "\n";
394 }
395<RulesRoundQuest>[^)] {
396 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
397 }
398<RulesRoundQuest>")" {
399 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
400 BEGIN(yyextra->lastContext);
401 }
402<RulesPattern>{StartRound} {
403 yyextra->roundCount++;
404 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
405 yyextra->lastContext = YY_START;
406 BEGIN(RulesRound);
407 }
408<RulesRound>{RulesCurly} {
409 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
410 }
411<RulesRound>{StartSquare} {
412 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
413 BEGIN(RulesRoundSquare);
414 }
415<RulesRound>{StartDouble} {
416 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
417 BEGIN(RulesRoundDouble);
418 }
419<RulesRound>{EscapeRulesChar} {
420 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
421 }
422<RulesRound>"(" {
423 yyextra->roundCount++;
424 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
425 }
426<RulesRound>")" {
427 yyextra->roundCount--;
428 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
429 if (!yyextra->roundCount) BEGIN( yyextra->lastContext ) ;
430 }
431<RulesRound>{nl} {
432 yyextra->cCodeBuffer += "\n";
433 }
434<RulesRound>{ws} {
435 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
436 }
437<RulesRound>. {
438 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
439 }
440<RulesPattern>{ws}+"|" {
441 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
442 yyextra->curlyCount = 0;
443 BEGIN(SkipCurly);
444 }
445<RulesPattern>^{ws}*{nl} {
446 yyextra->cCodeBuffer += "\n";
447 }
448<RulesPattern>^{ws}+ {
449 }
450
451<RulesPattern>({ws}|{nl}) {
452 unput(*yytext);
453 yyextra->curlyCount = 0;
454 BEGIN(SkipCurly);
455 }
456<RulesPattern>"\\\\" {
457 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
458 }
459<RulesPattern>{CCS} {
460 yyextra->cCodeBuffer += yytext;
461 yyextra->lastContext = YY_START;
462 BEGIN(COMMENT);
463 }
464<RulesPattern>. {
465 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
466 }
467<SkipCurly>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
468 yyextra->cCodeBuffer += yytext;
469 yyextra->lastPreLineCtrlContext = YY_START;
470 BEGIN( PreLineCtrl );
471 }
472<PreLineCtrl>"\""[^\n\"]*"\"" {
473 yyextra->cCodeBuffer += yytext;
474 }
475<PreLineCtrl>. {
476 yyextra->cCodeBuffer += yytext;
477 }
478<PreLineCtrl>\n {
479 yyextra->cCodeBuffer += yytext;
480 BEGIN( yyextra->lastPreLineCtrlContext );
481 }
482<SkipCurly>"{" {
483 yyextra->cCodeBuffer += yytext;
484 ++yyextra->curlyCount ;
485 }
486<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */
487<SkipCurly>"}" {
488 yyextra->cCodeBuffer += yytext;
489 if( yyextra->curlyCount )
490 {
491 --yyextra->curlyCount ;
492 }
493 }
494<SkipCurly>"}"{BN}*{DCOMM}"<" {
495 yyextra->cCodeBuffer += yytext;
496 if ( yyextra->curlyCount )
497 {
498 --yyextra->curlyCount ;
499 }
500 else
501 {
502 yyextra->docBlockContext = SkipCurlyEndDoc;
503 if (yytext[yyleng-3]=='/')
504 {
505 BEGIN( DocLine );
506 }
507 else
508 {
509 BEGIN( DocBlock );
510 }
511 }
512 }
513<SkipCurly>\" {
514 yyextra->cCodeBuffer += yytext;
515 yyextra->lastStringContext=SkipCurly;
516 BEGIN( SkipString );
517 }
518<SkipCurly>^{B}*"#" {
519 yyextra->cCodeBuffer += yytext;
520 yyextra->lastPreLineCtrlContext = YY_START;
521 BEGIN( PreLineCtrl );
522 }
523<SkipCurly>{B}*{RAWBEGIN} {
525 yyextra->delimiter = raw.
mid(2);
526 yyextra->delimiter=yyextra->delimiter.
left(yyextra->delimiter.length()-1);
527 yyextra->lastRawStringContext = YY_START;
528 yyextra->cCodeBuffer += yytext;
529 BEGIN(RawString);
530 }
This is an alternative implementation of QCString.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
QCString left(size_t len) const
531<SkipCurly>[^\n#"'@\\/{}<]+ {
532 yyextra->cCodeBuffer += yytext;
533 }
534<SkipCurly>{CCS} {
535 yyextra->cCodeBuffer += yytext;
536 yyextra->lastCContext = YY_START;
537 BEGIN(SkipComment);
538 }
539<SkipCurly>{CPPC} {
540 yyextra->cCodeBuffer += yytext;
541 yyextra->lastCContext = YY_START;
542 BEGIN(SkipCxxComment);
543 }
544<SkipCurly>{CHARLIT} {
545 yyextra->cCodeBuffer += yytext;
546 }
547<SkipCurly>\' {
548 yyextra->cCodeBuffer += yytext;
549 }
550<SkipCurly>. {
551 yyextra->cCodeBuffer += yytext;
552 }
553<SkipCurly>({CPPC}{B}*)?{CCS}"!" {
554 yyextra->cCodeBuffer += yytext;
555 yyextra->docBlockContext = YY_START;
556 BEGIN( DocBlock );
557 }
558<SkipCurly>{CCS}"*"[*]+{BL} {
560 yyextra->cCodeBuffer += yytext;
561 if( javadocBanner )
562 {
563 yyextra->docBlockContext = YY_START;
564 BEGIN( DocBlock );
565 }
566 else
567 {
568 BEGIN( Comment ) ;
569 }
570 }
#define Config_getBool(name)
571<SkipCurly>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
572 yyextra->cCodeBuffer += yytext;
573 yyextra->docBlockContext = YY_START;
574 BEGIN( DocBlock );
575 }
576<SkipCurly>{CPPC}"!" {
577 yyextra->cCodeBuffer += yytext;
578 yyextra->docBlockContext = YY_START;
579 BEGIN( DocLine );
580 }
581<SkipCurly>{CPPC}"/"/[^/] {
582 yyextra->cCodeBuffer += yytext;
583 yyextra->docBlockContext = YY_START;
584 BEGIN( DocLine );
585 }
586
587<SkipCurly>\n {
588 yyextra->cCodeBuffer += yytext;
589 if (yyextra->curlyCount<=0)
590 {
591 BEGIN(RulesPattern);
592 }
593 }
594<SkipString>\\. {
595 yyextra->cCodeBuffer += yytext;
596 }
597<SkipString>\" {
598 yyextra->cCodeBuffer += yytext;
599 BEGIN( yyextra->lastStringContext );
600 }
601<SkipString>{CCS}|{CCE}|{CPPC} {
602 yyextra->cCodeBuffer += yytext;
603 }
604<SkipString>\n {
605 yyextra->cCodeBuffer += yytext;
606 }
607<SkipString>. {
608 yyextra->cCodeBuffer += yytext;
609 }
610<SkipCxxComment>.*"\\\n" { // line continuation
611 yyextra->cCodeBuffer += yytext;
612 }
613<SkipCxxComment>{ANYopt}/\n {
614 yyextra->cCodeBuffer += yytext;
615 BEGIN( yyextra->lastCContext ) ;
616 }
617<Comment>{BN}+ {
618 yyextra->cCodeBuffer += yytext ;
619 }
620<Comment>{CCS} { yyextra->cCodeBuffer += yytext ; }
621<Comment>{CPPC} { yyextra->cCodeBuffer += yytext ; }
622<Comment>{CMD}("code"|"verbatim"|"iliteral") {
623 yyextra->insideCode=
TRUE;
624 yyextra->cCodeBuffer += yytext ;
625 }
626<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
627 yyextra->insideCode=
FALSE;
628 yyextra->cCodeBuffer += yytext ;
629 }
630<Comment>[^ \.\t\r\n\/\*]+ { yyextra->cCodeBuffer += yytext ; }
631<Comment>{CCE} { yyextra->cCodeBuffer += yytext ;
632 if (!yyextra->insideCode) BEGIN( yyextra->lastContext ) ;
633 }
634<Comment>. { yyextra->cCodeBuffer += *yytext ; }
635
636<SkipComment>{CPPC}|{CCS} {
637 yyextra->cCodeBuffer += yytext;
638 }
639<SkipComment>[^\*\n]+ {
640 yyextra->cCodeBuffer += yytext;
641 }
642<SkipComment>\n {
643 yyextra->cCodeBuffer += yytext;
644 }
645<SkipComment>{B}*{CCE} {
646 yyextra->cCodeBuffer += yytext;
647 BEGIN( yyextra->lastCContext );
648 }
649<SkipComment>"*" {
650 yyextra->cCodeBuffer += yytext;
651 }
652<RawString>{RAWEND} {
653 yyextra->cCodeBuffer += yytext;
655 delimiter=delimiter.
left(delimiter.
length()-1);
656 if (delimiter==yyextra->delimiter)
657 {
658 BEGIN(yyextra->lastRawStringContext);
659 }
660 }
size_t length() const
Returns the length of the string, not counting the 0-terminator.
661<RawString>[^)\n]+ {
662 yyextra->cCodeBuffer += yytext;
663 }
664<RawString>. {
665 yyextra->cCodeBuffer += yytext;
666 }
667<RawString>\n {
668 yyextra->cCodeBuffer += yytext;
669 }
670
671
672
673<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
674 yyextra->cCodeBuffer += yytext;
675 }
676<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
677 yyextra->cCodeBuffer += yytext;
678 BEGIN( yyextra->docBlockContext );
679 }
680<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
681 yyextra->cCodeBuffer += yytext;
682 BEGIN( yyextra->docBlockContext );
683 }
684<DocLine>{NONLopt}/"\n" { // whole line
685 yyextra->cCodeBuffer += yytext;
686 BEGIN( yyextra->docBlockContext );
687 }
688
689
690
691<DocBlock>"*"*{CCE} { // end of comment block
692 yyextra->cCodeBuffer += yytext;
693 BEGIN(yyextra->docBlockContext);
694 }
695<DocBlock>^{B}*"*"+/[^/] {
696 yyextra->cCodeBuffer += yytext;
697 }
698<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
699 yyextra->cCodeBuffer += yytext;
700 }
701<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
702 yyextra->cCodeBuffer += yytext;
703 }
704<DocBlock>{CPPC} { // slashes in the middle of a comment block
705 yyextra->cCodeBuffer += yytext;
706 }
707<DocBlock>{CCS} { // start of a new comment in the
708
709 yyextra->cCodeBuffer += yytext;
710 }
711<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
712 yyextra->cCodeBuffer += yytext;
713 }
714<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
715 yyextra->cCodeBuffer += yytext;
716 yyextra->docBlockName=&yytext[1];
717 if (yyextra->docBlockName.at(1)=='[')
718 {
719 yyextra->docBlockName.at(1)=']';
720 }
721 if (yyextra->docBlockName.at(1)=='{')
722 {
723 yyextra->docBlockName.at(1)='}';
724 }
725 if (yyextra->docBlockName.at(1)=='(')
726 {
727 yyextra->docBlockName.at(1)=')';
728 }
729 yyextra->fencedSize=0;
730 yyextra->nestedComment=
FALSE;
731 BEGIN(DocCopyBlock);
732 }
733<DocBlock>{B}*"<"{PRE}">" {
734 yyextra->cCodeBuffer += yytext;
735 yyextra->docBlockName="<pre>";
736 yyextra->fencedSize=0;
737 yyextra->nestedComment=
FALSE;
738 BEGIN(DocCopyBlock);
739 }
740<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim type command (which could contain nested comments!)
741 yyextra->cCodeBuffer += yytext;
742 yyextra->docBlockName="uml";
743 yyextra->fencedSize=0;
744 yyextra->nestedComment=
FALSE;
745 BEGIN(DocCopyBlock);
746 }
747<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
748 yyextra->cCodeBuffer += yytext;
749 yyextra->docBlockName=&yytext[1];
750 yyextra->fencedSize=0;
751 yyextra->nestedComment=
FALSE;
752 BEGIN(DocCopyBlock);
753 }
754<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
755 yyextra->cCodeBuffer += yytext;
757 yyextra->docBlockName="~~~";
759 yyextra->nestedComment=
FALSE;
760 BEGIN(DocCopyBlock);
761 }
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
762<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
763 yyextra->cCodeBuffer += yytext;
765 yyextra->docBlockName="```";
767 yyextra->nestedComment=
FALSE;
768 BEGIN(DocCopyBlock);
769 }
770<DocBlock>{B}*"<code>" {
771 REJECT;
772 }
773<DocBlock>[^@*~\/\\\n]+ { // any character that isn't special
774 yyextra->cCodeBuffer += yytext;
775 }
776<DocBlock>\n { // newline
777 yyextra->cCodeBuffer += yytext;
778 }
779<DocBlock>. { // command block
780 yyextra->cCodeBuffer += yytext;
781 }
782
783
784<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
785 yyextra->cCodeBuffer += yytext;
786 if (yyextra->docBlockName=="<pre>")
787 {
788 BEGIN(DocBlock);
789 }
790 }
791<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
792 yyextra->cCodeBuffer += yytext;
793 if (yyextra->docBlockName=="<code>")
794 {
795 BEGIN(DocBlock);
796 }
797 }
798<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
799 yyextra->cCodeBuffer += yytext;
800 if (yyextra->docBlockName==&yytext[1])
801 {
802 BEGIN(DocBlock);
803 }
804 }
805<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
806 yyextra->cCodeBuffer += yytext;
807 if (yyextra->docBlockName==&yytext[4])
808 {
809 BEGIN(DocBlock);
810 }
811 }
812<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
813 yyextra->cCodeBuffer += yytext;
814 if ((yyextra->docBlockName=="verbatim") || (yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
815 {
816 REJECT;
817 }
818 else
819 {
820 yyextra->cCodeBuffer += yytext;
821 }
822 }
823<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
824 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
825 {
826 yyextra->cCodeBuffer += yytext;
827 }
828 else
829 {
830 REJECT;
831 }
832 }
833<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
834 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
835 {
836 yyextra->cCodeBuffer += yytext;
837 }
838 else
839 {
840 REJECT;
841 }
842 }
843<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
844 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
845 {
846 if (yyextra->nestedComment)
847 {
848 yyextra->cCodeBuffer += yytext;
849 }
850 else
851 {
852 yyextra->cCodeBuffer += yytext;
853 }
854 }
855 else
856 {
857 REJECT;
858 }
859 }
860<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
861 yyextra->cCodeBuffer += yytext;
864 {
865 BEGIN(DocBlock);
866 }
867 }
868<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
869 yyextra->cCodeBuffer += yytext;
872 {
873 BEGIN(DocBlock);
874 }
875 }
876<DocCopyBlock>[^<@/\*\]~\$\\\n]+ { // any character that is not special
877 yyextra->cCodeBuffer += yytext;
878 }
879<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
880 if (yytext[1]=='*')
881 {
882 yyextra->nestedComment=
TRUE;
883 }
884 else if (yytext[0]=='*')
885 {
886 yyextra->nestedComment=
FALSE;
887 }
888 yyextra->cCodeBuffer += yytext;
889 }
890<DocCopyBlock>\n { // newline
891 yyextra->cCodeBuffer += yytext;
892 }
893<DocCopyBlock>. { // any other character
894 yyextra->cCodeBuffer += yytext;
895 }
896<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
897 yyextra->docBlockContext = SkipCurlyEndDoc;
898 yyextra->cCodeBuffer += yytext;
899 if (yytext[yyleng-3]=='/')
900 {
901 BEGIN( DocLine );
902 }
903 else
904 {
905 BEGIN( DocBlock );
906 }
907 }
908<SkipCurlyEndDoc>"}" {
909 yyextra->cCodeBuffer += yytext;
910 BEGIN(SkipCurly);
911 }
912
913<UserSection>.*{nl} {
914 yyextra->cCodeBuffer += yytext;
915 }
916
917
918
919<*>. { fprintf(stderr,"Lex scanner Def rule for %s: #%s#\n",stateToString(YY_START),yytext);}
920<*>{nl} { fprintf(stderr,"Lex scanner Def rule for newline %s: #%s#\n",stateToString(YY_START),yytext);}
921 */
922<*><<EOF>> {
925 }
static void handleCCode(yyscan_t yyscanner)
926%%