4040
4141#define YY_SKIP_YYWRAP
4242
43- #define STATE_VERILOG_RECENT S17 // State name for most recent Verilog Version
43+ #define STATE_VERILOG_RECENT S23 // State name for most recent Verilog Version
4444
4545// Flex 2.5.35 has compile warning in ECHO, so we'll default our own rule
4646#define ECHO yyerrorf (" Missing VParseLex.l rule: ECHO rule invoked in state %d: %s" , YY_START, yytext);
@@ -88,7 +88,7 @@ void yyerrorf(const char* format, ...) {
8888/* *********************************************************************/
8989%}
9090
91- %s V95 V01 V05 S05 S09 S12 S17
91+ %s V95 V01 V05 S05 S09 S12 S17 S23
9292%s STRING ATTRMODE
9393%s CMTMODE PROTMODE
9494%s DUMMY_TO_AVOID_WARNING
@@ -114,7 +114,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
114114<INITIAL >. | \n {BEGIN STATE_VERILOG_RECENT; yyless (0 ); }
115115
116116 /* Verilog 1995 */
117- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
117+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
118118 {ws} { StashPrefix; } /* otherwise ignore white-space */
119119 {crnl} { StashPrefix; NEXTLINE (); } /* Count line numbers */
120120 /* Keywords */
@@ -224,7 +224,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
224224}
225225
226226 /* Verilog 2001 */
227- <V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
227+ <V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
228228 /* Keywords*/
229229 "automatic" { FL; VALTEXT; CALLBACK (keywordCb); return yAUTOMATIC; }
230230 "endgenerate" { FL; VALTEXT; CALLBACK (keywordCb); return yENDGENERATE; }
@@ -252,13 +252,13 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
252252}
253253
254254 /* Verilog 2005 */
255- <V05 ,S05 ,S09 ,S12 ,S17 >{
255+ <V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
256256 /* Keywords */
257257 "uwire" { FL; VALTEXT; CALLBACK (keywordCb); return yWIRE; }
258258}
259259
260260 /* System Verilog 2005 */
261- <S05 ,S09 ,S12 ,S17 >{
261+ <S05 ,S09 ,S12 ,S17 , S23 >{
262262 /* System Tasks */
263263 "$error" { FL; VALTEXT; CALLBACK (keywordCb); return yD_ERROR; }
264264 "$fatal" { FL; VALTEXT; CALLBACK (keywordCb); return yD_FATAL; }
@@ -367,7 +367,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
367367}
368368
369369 /* System Verilog 2009 */
370- <S09 ,S12 ,S17 >{
370+ <S09 ,S12 ,S17 , S23 >{
371371 /* Keywords */
372372 "accept_on" { FL; VALTEXT; CALLBACK (keywordCb); return yACCEPT_ON; }
373373 "checker" { FL; VALTEXT; CALLBACK (keywordCb); return yCHECKER; }
@@ -395,7 +395,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
395395}
396396
397397 /* System Verilog 2012 */
398- <S12 ,S17 >{
398+ <S12 ,S17 , S23 >{
399399 /* Keywords */
400400 "implements" { FL; VALTEXT; CALLBACK (keywordCb); return yIMPLEMENTS; }
401401 "interconnect" { FL; VALTEXT; CALLBACK (keywordCb); return yINTERCONNECT; }
@@ -407,18 +407,18 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
407407 /* No new keywords */
408408
409409 /* Default PLI rule */
410- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
410+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
411411 "$"[a-zA-Z_$][a-zA-Z0-9_$]* { FL; VALTEXT; CALLBACK (sysfuncCb); return ygenSYSCALL; }
412412}
413413
414414 /************************************************************************/
415415
416416 /* Single character operator thingies */
417- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
417+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
418418 "{" { FL; VALTEXT; CALLBACK(operatorCb); return yytext[0]; }
419419 " }" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
420420}
421- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
421+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
422422 "!" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
423423 "#" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
424424 "$" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
@@ -450,7 +450,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
450450 /* Operators and multi-character symbols */
451451
452452 /* Verilog 1995 Operators */
453- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
453+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
454454 "&&" { FL; VALTEXT; CALLBACK (operatorCb); return yP_ANDAND; }
455455 "||" { FL; VALTEXT; CALLBACK (operatorCb); return yP_OROR; }
456456 "<=" { FL; VALTEXT; CALLBACK (operatorCb); return yP_LTE; }
@@ -472,7 +472,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
472472}
473473
474474 /* Verilog 2001 Operators */
475- <V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
475+ <V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
476476 "<<<" { FL; VALTEXT; CALLBACK (operatorCb); return yP_SLEFT; }
477477 ">>>" { FL; VALTEXT; CALLBACK (operatorCb); return yP_SSRIGHT; }
478478 "**" { FL; VALTEXT; CALLBACK (operatorCb); return yP_POW; }
@@ -482,7 +482,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
482482}
483483
484484 /* SystemVerilog 2005 Operators */
485- <S05 ,S09 ,S12 ,S17 >{
485+ <S05 ,S09 ,S12 ,S17 , S23 >{
486486 "'" { FL; VALTEXT; CALLBACK (operatorCb); return yP_TICK; }
487487 "'{" { FL; VALTEXT; CALLBACK(operatorCb); return yP_TICKBRA; }
488488 " ==?" { FL; VALTEXT; CALLBACK(operatorCb); return yP_WILDEQUAL; }
@@ -517,12 +517,12 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
517517}
518518
519519 /* SystemVerilog 2009 Operators */
520- <S09,S12,S17>{
520+ <S09,S12,S17,S23 >{
521521 " <->" { FL; VALTEXT; CALLBACK(operatorCb); return yP_LTMINUSGT; }
522522}
523523
524524 /* Identifiers and numbers */
525- <V95,V01,V05,S05,S09,S12,S17>{
525+ <V95,V01,V05,S05,S09,S12,S17,S23 >{
526526 /* Consume a following space, as we're going to add one to the symbol, we'd like to avoid inserting an extra */
527527 {escid}{space} { if (VParseLex::symEscapeless(yytext+1,yyleng-1-1)) {
528528 string sym = string(yytext+1,yyleng-1-1);
@@ -619,13 +619,13 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
619619 /************************************************************************/
620620 /* Attributes */
621621 /* Note simulators vary in support for "(* /_*something*_/ foo*)" where _ doesn't exist */
622- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
622+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
623623 "(*"({ws}|{crnl})*({id}|{escid}) { yymore (); yy_push_state (ATTRMODE); } /* Doesn't match (*), but (* attr_spec */
624624}
625625
626626 /************************************************************************/
627627 /* Preprocessor */
628- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
628+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
629629 "`accelerate" { FL; VALTEXT; CALLBACK (preprocCb); } // Verilog-XL compatibility
630630 "`autoexpand_vectornets" { FL; VALTEXT; CALLBACK (preprocCb); } // Verilog-XL compatibility
631631 "`celldefine" { FL; VALTEXT; CALLBACK (preprocCb); LEXP->m_inCellDefine =true ; }
@@ -669,13 +669,14 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
669669 "`begin_keywords"[ \t]*\"1800-2009\" { yy_push_state (S09); CALLBACK (preprocCb); }
670670 "`begin_keywords"[ \t]*\"1800-2012\" { yy_push_state (S12); CALLBACK (preprocCb); }
671671 "`begin_keywords"[ \t]*\"1800-2017\" { yy_push_state (S17); CALLBACK (preprocCb); }
672+ "`begin_keywords"[ \t]*\"1800-2023\" { yy_push_state (S23); CALLBACK (preprocCb); }
672673 "`end_keywords" { yy_pop_state (); CALLBACK (preprocCb); }
673674}
674675
675676 /************************************************************************/
676677 /* Default rules - leave last */
677678
678- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
679+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
679680 "`"[a-zA-Z_0-9]+ { FL; VALTEXT;
680681 if (LPARSEP->sigParser ()) { yyerrorf (" Define or directive not defined: %s" ,yytext); }
681682 else { CALLBACK (preprocCb); } }
@@ -882,6 +883,7 @@ void VParseLex::language(const char* value) {
882883 else if (0 ==strcmp (value," 1800-2009" )) { BEGIN S09; }
883884 else if (0 ==strcmp (value," 1800-2012" )) { BEGIN S12; }
884885 else if (0 ==strcmp (value," 1800-2017" )) { BEGIN S17; }
886+ else if (0 ==strcmp (value," 1800-2023" )) { BEGIN S23; }
885887 else yyerrorf (" Unknown setLanguage code: %s" , value);
886888}
887889
0 commit comments