40
40
41
41
#define YY_SKIP_YYWRAP
42
42
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
44
44
45
45
// Flex 2.5.35 has compile warning in ECHO, so we'll default our own rule
46
46
#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, ...) {
88
88
/* *********************************************************************/
89
89
%}
90
90
91
- %s V95 V01 V05 S05 S09 S12 S17
91
+ %s V95 V01 V05 S05 S09 S12 S17 S23
92
92
%s STRING ATTRMODE
93
93
%s CMTMODE PROTMODE
94
94
%s DUMMY_TO_AVOID_WARNING
@@ -114,7 +114,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
114
114
<INITIAL >. | \n {BEGIN STATE_VERILOG_RECENT; yyless (0 ); }
115
115
116
116
/* Verilog 1995 */
117
- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
117
+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
118
118
{ws} { StashPrefix; } /* otherwise ignore white-space */
119
119
{crnl} { StashPrefix; NEXTLINE (); } /* Count line numbers */
120
120
/* Keywords */
@@ -224,7 +224,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
224
224
}
225
225
226
226
/* Verilog 2001 */
227
- <V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
227
+ <V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
228
228
/* Keywords*/
229
229
"automatic" { FL; VALTEXT; CALLBACK (keywordCb); return yAUTOMATIC; }
230
230
"endgenerate" { FL; VALTEXT; CALLBACK (keywordCb); return yENDGENERATE; }
@@ -252,13 +252,13 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
252
252
}
253
253
254
254
/* Verilog 2005 */
255
- <V05 ,S05 ,S09 ,S12 ,S17 >{
255
+ <V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
256
256
/* Keywords */
257
257
"uwire" { FL; VALTEXT; CALLBACK (keywordCb); return yWIRE; }
258
258
}
259
259
260
260
/* System Verilog 2005 */
261
- <S05 ,S09 ,S12 ,S17 >{
261
+ <S05 ,S09 ,S12 ,S17 , S23 >{
262
262
/* System Tasks */
263
263
"$error" { FL; VALTEXT; CALLBACK (keywordCb); return yD_ERROR; }
264
264
"$fatal" { FL; VALTEXT; CALLBACK (keywordCb); return yD_FATAL; }
@@ -367,7 +367,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
367
367
}
368
368
369
369
/* System Verilog 2009 */
370
- <S09 ,S12 ,S17 >{
370
+ <S09 ,S12 ,S17 , S23 >{
371
371
/* Keywords */
372
372
"accept_on" { FL; VALTEXT; CALLBACK (keywordCb); return yACCEPT_ON; }
373
373
"checker" { FL; VALTEXT; CALLBACK (keywordCb); return yCHECKER; }
@@ -395,7 +395,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
395
395
}
396
396
397
397
/* System Verilog 2012 */
398
- <S12 ,S17 >{
398
+ <S12 ,S17 , S23 >{
399
399
/* Keywords */
400
400
"implements" { FL; VALTEXT; CALLBACK (keywordCb); return yIMPLEMENTS; }
401
401
"interconnect" { FL; VALTEXT; CALLBACK (keywordCb); return yINTERCONNECT; }
@@ -407,18 +407,18 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
407
407
/* No new keywords */
408
408
409
409
/* Default PLI rule */
410
- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
410
+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
411
411
"$"[a-zA-Z_$][a-zA-Z0-9_$]* { FL; VALTEXT; CALLBACK (sysfuncCb); return ygenSYSCALL; }
412
412
}
413
413
414
414
/************************************************************************/
415
415
416
416
/* Single character operator thingies */
417
- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
417
+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
418
418
"{" { FL; VALTEXT; CALLBACK(operatorCb); return yytext[0]; }
419
419
" }" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
420
420
}
421
- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
421
+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
422
422
"!" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
423
423
"#" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
424
424
"$" { FL; VALTEXT; CALLBACK (operatorCb); return yytext[0 ]; }
@@ -450,7 +450,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
450
450
/* Operators and multi-character symbols */
451
451
452
452
/* Verilog 1995 Operators */
453
- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
453
+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
454
454
"&&" { FL; VALTEXT; CALLBACK (operatorCb); return yP_ANDAND; }
455
455
"||" { FL; VALTEXT; CALLBACK (operatorCb); return yP_OROR; }
456
456
"<=" { FL; VALTEXT; CALLBACK (operatorCb); return yP_LTE; }
@@ -472,7 +472,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
472
472
}
473
473
474
474
/* Verilog 2001 Operators */
475
- <V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
475
+ <V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
476
476
"<<<" { FL; VALTEXT; CALLBACK (operatorCb); return yP_SLEFT; }
477
477
">>>" { FL; VALTEXT; CALLBACK (operatorCb); return yP_SSRIGHT; }
478
478
"**" { FL; VALTEXT; CALLBACK (operatorCb); return yP_POW; }
@@ -482,7 +482,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
482
482
}
483
483
484
484
/* SystemVerilog 2005 Operators */
485
- <S05 ,S09 ,S12 ,S17 >{
485
+ <S05 ,S09 ,S12 ,S17 , S23 >{
486
486
"'" { FL; VALTEXT; CALLBACK (operatorCb); return yP_TICK; }
487
487
"'{" { FL; VALTEXT; CALLBACK(operatorCb); return yP_TICKBRA; }
488
488
" ==?" { FL; VALTEXT; CALLBACK(operatorCb); return yP_WILDEQUAL; }
@@ -517,12 +517,12 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
517
517
}
518
518
519
519
/* SystemVerilog 2009 Operators */
520
- <S09,S12,S17>{
520
+ <S09,S12,S17,S23 >{
521
521
" <->" { FL; VALTEXT; CALLBACK(operatorCb); return yP_LTMINUSGT; }
522
522
}
523
523
524
524
/* Identifiers and numbers */
525
- <V95,V01,V05,S05,S09,S12,S17>{
525
+ <V95,V01,V05,S05,S09,S12,S17,S23 >{
526
526
/* Consume a following space, as we're going to add one to the symbol, we'd like to avoid inserting an extra */
527
527
{escid}{space} { if (VParseLex::symEscapeless(yytext+1,yyleng-1-1)) {
528
528
string sym = string(yytext+1,yyleng-1-1);
@@ -619,13 +619,13 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
619
619
/************************************************************************/
620
620
/* Attributes */
621
621
/* 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 >{
623
623
"(*"({ws}|{crnl})*({id}|{escid}) { yymore (); yy_push_state (ATTRMODE); } /* Doesn't match (*), but (* attr_spec */
624
624
}
625
625
626
626
/************************************************************************/
627
627
/* Preprocessor */
628
- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
628
+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
629
629
"`accelerate" { FL; VALTEXT; CALLBACK (preprocCb); } // Verilog-XL compatibility
630
630
"`autoexpand_vectornets" { FL; VALTEXT; CALLBACK (preprocCb); } // Verilog-XL compatibility
631
631
"`celldefine" { FL; VALTEXT; CALLBACK (preprocCb); LEXP->m_inCellDefine =true ; }
@@ -669,13 +669,14 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
669
669
"`begin_keywords"[ \t]*\"1800-2009\" { yy_push_state (S09); CALLBACK (preprocCb); }
670
670
"`begin_keywords"[ \t]*\"1800-2012\" { yy_push_state (S12); CALLBACK (preprocCb); }
671
671
"`begin_keywords"[ \t]*\"1800-2017\" { yy_push_state (S17); CALLBACK (preprocCb); }
672
+ "`begin_keywords"[ \t]*\"1800-2023\" { yy_push_state (S23); CALLBACK (preprocCb); }
672
673
"`end_keywords" { yy_pop_state (); CALLBACK (preprocCb); }
673
674
}
674
675
675
676
/************************************************************************/
676
677
/* Default rules - leave last */
677
678
678
- <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 >{
679
+ <V95 ,V01 ,V05 ,S05 ,S09 ,S12 ,S17 , S23 >{
679
680
"`"[a-zA-Z_0-9]+ { FL; VALTEXT;
680
681
if (LPARSEP->sigParser ()) { yyerrorf (" Define or directive not defined: %s" ,yytext); }
681
682
else { CALLBACK (preprocCb); } }
@@ -882,6 +883,7 @@ void VParseLex::language(const char* value) {
882
883
else if (0 ==strcmp (value," 1800-2009" )) { BEGIN S09; }
883
884
else if (0 ==strcmp (value," 1800-2012" )) { BEGIN S12; }
884
885
else if (0 ==strcmp (value," 1800-2017" )) { BEGIN S17; }
886
+ else if (0 ==strcmp (value," 1800-2023" )) { BEGIN S23; }
885
887
else yyerrorf (" Unknown setLanguage code: %s" , value);
886
888
}
887
889
0 commit comments