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