220 {
221 "def"{BB} {
225 BEGIN( FunctionDec );
226 }
227 "async"{BB}"def"{BB} {
231 BEGIN( FunctionDec );
232 }
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
233
234 "class"{BB} {
238 BEGIN( ClassDec );
239 }
240 "None" {
244 }
245 "self."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER}"(" {
246 codify(yyscanner,
"self.");
248 }
249 "self."{IDENTIFIER}/"(" {
250 codify(yyscanner,
"self.");
252 }
253 "self."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER} {
254 codify(yyscanner,
"self.");
256 }
257 "self."{IDENTIFIER} {
258 codify(yyscanner,
"self.");
260 }
261 "cls."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER}"(" {
264 }
265 "cls."{IDENTIFIER}/"(" {
268 }
269 "cls."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER} {
272 }
273 "cls."{IDENTIFIER} {
276 }
277 "@"{SCOPE}{CALLANY}? {
281 }
282}
283
284<ClassDec>{IDENTIFIER} {
286
287 yyextra->curClassName = yytext;
288 yyextra->curClassBases.clear();
289 BEGIN( ClassInheritance );
290 }
291
292<ClassInheritance>{
293 ({BB}|[(,)]) {
295 }
296
297 ({IDENTIFIER}".")*{IDENTIFIER} {
298
299
300
301
302
303
304
305
306
307
308
309
310
311 yyextra->curClassBases.emplace_back(yytext);
312 yyextra->insideBody = true;
314 yyextra->insideBody = false;
315
316 }
317
318 ":" {
320
321
322
323
324
325
326
328 for (const auto &s : yyextra->curClassBases)
329 {
330 const ClassDef *baseDefToAdd =
nullptr;
331
332 auto it = yyextra->codeClassMap.find(s);
333 if (it != yyextra->codeClassMap.end())
334 {
335 baseDefToAdd =
toClassDef(it->second.globalDef());
336 }
337
338 if (baseDefToAdd==nullptr)
339 {
340 baseDefToAdd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,s,true);
341 }
342
343 if (baseDefToAdd && baseDefToAdd->
name()!=yyextra->curClassName)
344 {
345 var.localDef()->insertBaseClass(baseDefToAdd->
name());
346 }
347 }
348 yyextra->codeClassMap.emplace(yyextra->curClassName.str(),std::move(var));
349
350
351 yyextra->curClassName.clear();
352 yyextra->curClassBases.clear();
353
354 yyextra->noSuiteFound =
TRUE;
355 BEGIN( SuiteStart );
356 }
357}
358
359
360<FunctionDec>{
361 {IDENTIFIER} {
363 }
static void generateFunctionLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &funcName)
364
365 {B}"(" {
367 BEGIN( FunctionParams );
368 }
369}
370
371<FunctionParams>{
372 ({BB}|",") {
373
375 }
376
377 ({IDENTIFIER}|{PARAMNONEMPTY}+) {
379 }
380
381 ")" {
383 }
384
385 "\n" {
387 }
388
389 ":" {
391
392
393
394
395
396 yyextra->noSuiteFound =
TRUE;
397 BEGIN( SuiteStart );
398 }
399}
400
401<Body,Suite>{
402
403 {KEYWORD} {
404
405
406
407
408
412 }
413
414 {FLOWKW} {
419 }
420 ({IDENTIFIER}".")*{IDENTIFIER}/"(" {
421 yyextra->insideBody = true;
423 yyextra->insideBody = false;
424 }
425 ({IDENTIFIER}".")+{IDENTIFIER} {
426 yyextra->insideBody = true;
428 yyextra->insideBody = false;
429 }
430 {IDENTIFIER} {
codify(yyscanner,yytext); }
static void incrementFlowKeyWordCount(yyscan_t yyscanner)
431
432}
433
434
435
436<SuiteStart>{
437
438 {BB} {
440 }
441 "pass" {
445 BEGIN(Body);
446 }
447 {KEYWORD} {
451
452
453 yyextra->noSuiteFound =
FALSE;
454 }
455
456 {FLOWKW} {
461
462
463 yyextra->noSuiteFound =
FALSE;
464 }
465 {IDENTIFIER} {
467 }
468
469
470 {POUNDCOMMENT} {
471 if (YY_START==SingleQuoteString ||
472 YY_START==DoubleQuoteString ||
473 YY_START==TripleString
474 )
475 {
476 REJECT;
477 }
478 yy_push_state(YY_START,yyscanner);
479 BEGIN(DocBlock);
480 yyextra->docBlock=yytext;
481 }
482
483 {NEWLINE} {
485 if ( yyextra->noSuiteFound )
486 {
487
488 BEGIN ( SuiteCaptureIndent );
489 }
490 }
491}
492
493<SuiteCaptureIndent>{
494 "\n"|({BB}"\n") {
495
497 }
498
499 {BB} {
500
501
502
503
505 yyextra->indents.push(yyleng);
506
507 BEGIN( Suite );
508 }
509}
510
511<SuiteMaintain>{
512
513 {BB}/({NONEMPTY}|{EXPCHAR}) {
514
515
516
517
520 }
static void adjustScopesAndSuites(yyscan_t yyscanner, unsigned indentLength)
521
522 "\n"|({BB}"\n") {
523
524
525
526
528 }
529
530 ""/({NONEMPTY}|{EXPCHAR}) {
531
532
533
534
536 }
537}
538
539
540<Suite>{NEWLINE} {
542 BEGIN( SuiteMaintain );
543 }
544<Body>{IDENTIFIER} {
546 }
547<Body>{NEWLINE} {
549 }
550
551<SingleQuoteString>{ // Single quoted string like 'That\'s a """nice""" string!'
552 \\{B}\n {
554 }
555 \\. {
557 }
558 {STRINGPREFIX}?{TRIDOUBLEQUOTE} {
560 }
561 "'" {
564 BEGIN(yyextra->stringContext);
565 }
566 [^"'\n\\]+ { // normal chars
567 codify(yyscanner,yytext);
568 }
569 . { // normal char
570 codify(yyscanner,yytext);
571 }
572}
573
574<DoubleQuoteString>{ // Double quoted string like "That's \"a '''nice'''\" string!"
575 \\{B}\n {
577 }
578 \\. {
580 }
581 {STRINGPREFIX}?{TRISINGLEQUOTE} {
583 }
584 "\"" {
587 BEGIN(yyextra->stringContext);
588 }
589 [^"'\n\\]+ { // normal chars
590 codify(yyscanner,yytext);
591 }
592 . { // normal char
593 codify(yyscanner,yytext);
594 }
595}
596
597<TripleString>{
598 {TRIDOUBLEQUOTE} |
599 {TRISINGLEQUOTE} {
601 if (yyextra->doubleQuote==(yytext[0]=='"'))
602 {
604 BEGIN(yyextra->stringContext);
605 }
606 }
607 {LONGSTRINGBLOCK} {
609 }
610 \n {
612 }
613 [ \t]+ {
615 }
616 . {
618 }
619}
620
621
622<*>{STRINGPREFIX}?{TRISINGLEQUOTE} {
623 if (YY_START==SingleQuoteString) REJECT;
625 yyextra->stringContext=YY_START;
626 yyextra->doubleQuote=yytext[yyleng-1]=='"';
628 BEGIN(TripleString);
629 }
630<*>{STRINGPREFIX}?{TRIDOUBLEQUOTE} {
631 if (YY_START==DoubleQuoteString) REJECT;
633 yyextra->stringContext=YY_START;
634 yyextra->doubleQuote=yytext[yyleng-1]=='"';
636 BEGIN(TripleString);
637 }
638<*>{STRINGPREFIX}?"'" { // single quoted string
639 if (YY_START==SingleQuoteString ||
640 YY_START==DoubleQuoteString ||
641 YY_START==TripleString)
642 {
643 REJECT;
644 }
646 yyextra->stringContext=YY_START;
648 BEGIN(SingleQuoteString);
649 }
650<*>{STRINGPREFIX}?"\"" { // double quoted string
651 if (YY_START==SingleQuoteString ||
652 YY_START==DoubleQuoteString ||
653 YY_START==TripleString)
654 {
655 REJECT;
656 }
658 yyextra->stringContext=YY_START;
660 BEGIN(DoubleQuoteString);
661 }
662<DocBlock>.* { // contents of current comment line
663 yyextra->docBlock+=yytext;
664 }
665<DocBlock>"\n"{B}("#") { // comment block (next line is also comment line)
666 yyextra->docBlock+=yytext;
667 }
668<DocBlock>{NEWLINE} { // comment block ends at the end of this line
669
673 unput(*yytext);
675 }
static void pop_state(yyscan_t yyscanner)
676<*>{POUNDCOMMENT}.* {
677 if (YY_START==SingleQuoteString ||
678 YY_START==DoubleQuoteString ||
679 YY_START==TripleString)
680 {
681 REJECT;
682 }
683 yy_push_state(YY_START,yyscanner);
684 BEGIN(DocBlock);
685 yyextra->docBlock=yytext;
686 }
687<*>"#".* { // normal comment
688 if (YY_START==SingleQuoteString ||
689 YY_START==DoubleQuoteString ||
690 YY_START==TripleString)
691 {
692 REJECT;
693 }
697 }
698<*>{NEWLINE} {
699 if (yyextra->endComment)
700 {
701 yyextra->endComment=
FALSE;
702 }
703 else
704 {
706 }
707
708
709
710 BEGIN(Body);
711 }
712
713<*>[ \t]+ {
715 BEGIN(Body);
716 }
717<*>. {
719
720
721
722 BEGIN(Body);
723 }
724
725<*><<EOF>> {
726 if (YY_START==DocBlock)
727 {
731 }
733 }
734%%