mirror of
https://github.com/verilator/verilator.git
synced 2026-09-04 08:33:38 +02:00
Internals: Minor parser reorgs in prep for future pull. No functional change intended.
This commit is contained in:
+15
-7
@@ -447,6 +447,20 @@ size_t V3ParseImp::tokenPipeScanTypeEq(size_t depth) {
|
||||
return depth;
|
||||
}
|
||||
|
||||
int V3ParseImp::tokenPipelineId(int token) {
|
||||
const V3ParseBisonYYSType* nexttokp = tokenPeekp(0); // First char after yaID
|
||||
const int nexttok = nexttokp->token;
|
||||
UASSERT(yylval.token == yaID__LEX, "Start with ID");
|
||||
if (nexttok == yP_COLONCOLON) { return yaID__CC; }
|
||||
VL_RESTORER(yylval); // Remember value, as about to read ahead
|
||||
if (nexttok == '#') {
|
||||
VL_RESTORER(yylval); // Remember value, as about to read ahead
|
||||
const size_t depth = tokenPipeScanParam(0);
|
||||
if (tokenPeekp(depth)->token == yP_COLONCOLON) return yaID__CC;
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
void V3ParseImp::tokenPipeline() {
|
||||
// called from bison's "yylex", has a "this"
|
||||
if (m_tokensAhead.empty()) tokenPull(); // corrupts yylval
|
||||
@@ -552,13 +566,7 @@ void V3ParseImp::tokenPipeline() {
|
||||
token = yWITH__ETC;
|
||||
}
|
||||
} else if (token == yaID__LEX) {
|
||||
if (nexttok == yP_COLONCOLON) {
|
||||
token = yaID__CC;
|
||||
} else if (nexttok == '#') {
|
||||
VL_RESTORER(yylval); // Remember value, as about to read ahead
|
||||
const size_t depth = tokenPipeScanParam(0);
|
||||
if (tokenPeekp(depth)->token == yP_COLONCOLON) token = yaID__CC;
|
||||
}
|
||||
token = tokenPipelineId(token);
|
||||
}
|
||||
// If add to above "else if", also add to "if (token" further above
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user