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