astgen: generate type specific addNext, remove astNextNull

Generate type specific static overloads of Ast<Node>::addNext, which
return the correct sub-type of the 'this' they were invoked on.

Also remove AstNode::addNextNull, which is now only used in the parser,
implement in verilog.y directly as a template function.
This commit is contained in:
Geza Lore 2022-09-17 13:48:51 +01:00
parent 79be097e34
commit 7d88e63bab
14 changed files with 142 additions and 160 deletions

View File

@ -272,12 +272,6 @@ AstNode* AstNode::addNext<AstNode, AstNode>(AstNode* nodep, AstNode* newp) {
return nodep; return nodep;
} }
template <>
AstNode* AstNode::addNextNull<AstNode, AstNode>(AstNode* nodep, AstNode* newp) {
if (!newp) return nodep;
return addNext(nodep, newp);
}
void AstNode::addNextHere(AstNode* newp) { void AstNode::addNextHere(AstNode* newp) {
// Add to m_nextp on exact node passed, not at the end. // Add to m_nextp on exact node passed, not at the end.
// This could be at head, tail, or both (single) // This could be at head, tail, or both (single)

View File

@ -1797,19 +1797,9 @@ public:
"'T_NodeNext' must be a subtype of 'T_NodeResult'"); "'T_NodeNext' must be a subtype of 'T_NodeResult'");
return static_cast<T_NodeResult*>(addNext<AstNode, AstNode>(nodep, newp)); return static_cast<T_NodeResult*>(addNext<AstNode, AstNode>(nodep, newp));
} }
// Returns nodep, adds newp (maybe nullptr) to end of nodep's list
template <typename T_NodeResult, typename T_NodeNext>
static T_NodeResult* addNextNull(T_NodeResult* nodep, T_NodeNext* newp) {
static_assert(std::is_base_of<AstNode, T_NodeResult>::value,
"'T_NodeResult' must be a subtype of AstNode");
static_assert(std::is_base_of<T_NodeResult, T_NodeNext>::value,
"'T_NodeNext' must be a subtype of 'T_NodeResult'");
return static_cast<T_NodeResult*>(addNextNull<AstNode, AstNode>(nodep, newp));
}
inline AstNode* addNext(AstNode* newp); inline AstNode* addNext(AstNode* newp);
inline AstNode* addNextNull(AstNode* newp);
void addNextHere(AstNode* newp); // Insert newp at this->nextp
inline void addPrev(AstNode* newp); inline void addPrev(AstNode* newp);
void addNextHere(AstNode* newp); // Insert newp at this->nextp
void addHereThisAsNext(AstNode* newp); // Adds at old place of this, this becomes next void addHereThisAsNext(AstNode* newp); // Adds at old place of this, this becomes next
void replaceWith(AstNode* newp); // Replace current node in tree with new node void replaceWith(AstNode* newp); // Replace current node in tree with new node
AstNode* unlinkFrBack(VNRelinker* linkerp AstNode* unlinkFrBack(VNRelinker* linkerp
@ -2100,8 +2090,13 @@ public:
// Forward declarations of specializations defined in V3Ast.cpp // Forward declarations of specializations defined in V3Ast.cpp
template <> template <>
AstNode* AstNode::addNext<AstNode, AstNode>(AstNode* nodep, AstNode* newp); AstNode* AstNode::addNext<AstNode, AstNode>(AstNode* nodep, AstNode* newp);
template <>
AstNode* AstNode::addNextNull<AstNode, AstNode>(AstNode* nodep, AstNode* newp); // Inline method implementations
AstNode* AstNode::addNext(AstNode* newp) { return addNext(this, newp); }
void AstNode::addPrev(AstNode* newp) {
replaceWith(newp);
newp->addNext(this);
}
// Specialisations of privateTypeTest // Specialisations of privateTypeTest
#include "V3Ast__gen_impl.h" // From ./astgen #include "V3Ast__gen_impl.h" // From ./astgen

View File

@ -25,13 +25,6 @@
//###################################################################### //######################################################################
// Inline METHODS // Inline METHODS
AstNode* AstNode::addNext(AstNode* newp) { return addNext(this, newp); }
AstNode* AstNode::addNextNull(AstNode* newp) { return addNextNull(this, newp); }
void AstNode::addPrev(AstNode* newp) {
replaceWith(newp);
newp->addNext(this);
}
int AstNode::width() const { return dtypep() ? dtypep()->width() : 0; } int AstNode::width() const { return dtypep() ? dtypep()->width() : 0; }
int AstNode::widthMin() const { return dtypep() ? dtypep()->widthMin() : 0; } int AstNode::widthMin() const { return dtypep() ? dtypep()->widthMin() : 0; }
bool AstNode::width1() const { // V3Const uses to know it can optimize bool AstNode::width1() const { // V3Const uses to know it can optimize

View File

@ -177,11 +177,7 @@ private:
AstNode* addsp = nullptr; AstNode* addsp = nullptr;
if (AstNode* const stmtsp = nodep->stmtsp()) { if (AstNode* const stmtsp = nodep->stmtsp()) {
stmtsp->unlinkFrBackWithNext(); stmtsp->unlinkFrBackWithNext();
if (addsp) { addsp = AstNode::addNext(addsp, stmtsp);
addsp = addsp->addNextNull(stmtsp);
} else {
addsp = stmtsp;
}
} }
if (addsp) { if (addsp) {
nodep->replaceWith(addsp); nodep->replaceWith(addsp);

View File

@ -134,7 +134,7 @@ private:
incp->fileline(), new AstVarRef(incp->fileline(), varp, VAccess::WRITE), incp->fileline(), new AstVarRef(incp->fileline(), varp, VAccess::WRITE),
new AstAdd(incp->fileline(), new AstVarRef(incp->fileline(), varp, VAccess::READ), new AstAdd(incp->fileline(), new AstVarRef(incp->fileline(), varp, VAccess::READ),
new AstConst(incp->fileline(), AstConst::WidthedValue(), 32, 1))); new AstConst(incp->fileline(), AstConst::WidthedValue(), 32, 1)));
incp->addNext(assp); AstNode::addNext<AstNode, AstNode>(incp, assp);
} }
return incp; return incp;
} }

View File

@ -139,14 +139,14 @@ private:
UINFO(6, UINFO(6,
" at " << newfuncp->argTypes() << " und " << funcp->argTypes() << endl); " at " << newfuncp->argTypes() << " und " << funcp->argTypes() << endl);
funcp->declPrivate(true); funcp->declPrivate(true);
AstNode* argsp = nullptr; AstVarRef* argsp = nullptr;
for (AstNode* stmtp = newfuncp->argsp(); stmtp; stmtp = stmtp->nextp()) { for (AstNode* stmtp = newfuncp->argsp(); stmtp; stmtp = stmtp->nextp()) {
if (AstVar* const portp = VN_CAST(stmtp, Var)) { if (AstVar* const portp = VN_CAST(stmtp, Var)) {
if (portp->isIO() && !portp->isFuncReturn()) { if (portp->isIO() && !portp->isFuncReturn()) {
AstNode* const newp = new AstVarRef( AstVarRef* const newp = new AstVarRef(
portp->fileline(), portp, portp->fileline(), portp,
portp->isWritable() ? VAccess::WRITE : VAccess::READ); portp->isWritable() ? VAccess::WRITE : VAccess::READ);
argsp = argsp ? argsp->addNextNull(newp) : newp; argsp = AstNode::addNext(argsp, newp);
} }
} }
} }

View File

@ -177,21 +177,17 @@ private:
const int right = nodep->rangep()->rightConst(); const int right = nodep->rangep()->rightConst();
const int increment = (left > right) ? -1 : 1; const int increment = (left > right) ? -1 : 1;
int offset_from_init = 0; int offset_from_init = 0;
AstNode* addp = nullptr; AstEnumItem* addp = nullptr;
FileLine* const flp = nodep->fileline();
for (int i = left; i != (right + increment); i += increment, offset_from_init++) { for (int i = left; i != (right + increment); i += increment, offset_from_init++) {
const string name = nodep->name() + cvtToStr(i); const string name = nodep->name() + cvtToStr(i);
AstNode* valuep = nullptr; AstNode* valuep = nullptr;
if (nodep->valuep()) { if (nodep->valuep()) {
valuep = new AstAdd( valuep
nodep->fileline(), nodep->valuep()->cloneTree(true), = new AstAdd(flp, nodep->valuep()->cloneTree(true),
new AstConst(nodep->fileline(), AstConst::Unsized32(), offset_from_init)); new AstConst(flp, AstConst::Unsized32(), offset_from_init));
}
AstNode* const newp = new AstEnumItem(nodep->fileline(), name, nullptr, valuep);
if (addp) {
addp = addp->addNextNull(newp);
} else {
addp = newp;
} }
addp = AstNode::addNext(addp, new AstEnumItem{flp, name, nullptr, valuep});
} }
nodep->replaceWith(addp); nodep->replaceWith(addp);
VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(nodep->deleteTree(), nodep);
@ -372,7 +368,7 @@ private:
iterateChildren(nodep); iterateChildren(nodep);
if (m_varp) { if (m_varp) {
nodep->unlinkFrBack(); nodep->unlinkFrBack();
m_varp->addNext(nodep); AstNode::addNext<AstNode, AstNode>(m_varp, nodep);
// lvalue is true, because we know we have a verilator public_flat_rw // lvalue is true, because we know we have a verilator public_flat_rw
// but someday we may be more general // but someday we may be more general
const bool lvalue = m_varp->isSigUserRWPublic(); const bool lvalue = m_varp->isSigUserRWPublic();

View File

@ -76,7 +76,6 @@ AstArg* V3ParseGrammar::argWrapList(AstNode* nodep) {
AstNode* const nextp = nodep->nextp(); AstNode* const nextp = nodep->nextp();
AstNode* const exprp = nodep->unlinkFrBack(); AstNode* const exprp = nodep->unlinkFrBack();
nodep = nextp; nodep = nextp;
// addNext can handle nulls:
outp = AstNode::addNext(outp, new AstArg(exprp->fileline(), "", exprp)); outp = AstNode::addNext(outp, new AstArg(exprp->fileline(), "", exprp));
} }
VL_DO_DANGLING(tempp->deleteTree(), tempp); VL_DO_DANGLING(tempp->deleteTree(), tempp);
@ -204,15 +203,17 @@ AstVar* V3ParseGrammar::createVariable(FileLine* fileline, const string& name,
} }
if (GRAMMARP->m_varDecl == VVarType::SUPPLY0) { if (GRAMMARP->m_varDecl == VVarType::SUPPLY0) {
nodep->addNext(V3ParseGrammar::createSupplyExpr(fileline, nodep->name(), 0)); AstNode::addNext<AstNode, AstNode>(
nodep, V3ParseGrammar::createSupplyExpr(fileline, nodep->name(), 0));
} }
if (GRAMMARP->m_varDecl == VVarType::SUPPLY1) { if (GRAMMARP->m_varDecl == VVarType::SUPPLY1) {
nodep->addNext(V3ParseGrammar::createSupplyExpr(fileline, nodep->name(), 1)); AstNode::addNext<AstNode, AstNode>(
nodep, V3ParseGrammar::createSupplyExpr(fileline, nodep->name(), 1));
} }
if (VN_IS(dtypep, ParseTypeDType)) { if (VN_IS(dtypep, ParseTypeDType)) {
// Parser needs to know what is a type // Parser needs to know what is a type
AstNode* const newp = new AstTypedefFwd(fileline, name); AstNode* const newp = new AstTypedefFwd(fileline, name);
nodep->addNext(newp); AstNode::addNext<AstNode, AstNode>(nodep, newp);
SYMP->reinsert(newp); SYMP->reinsert(newp);
} }
// Don't set dtypep in the ranging; // Don't set dtypep in the ranging;

View File

@ -147,7 +147,7 @@ class SliceVisitor final : public VNVisitor {
cloneAndSel(nodep->rhsp(), elements, offset)), cloneAndSel(nodep->rhsp(), elements, offset)),
NodeAssign); NodeAssign);
if (debug() >= 9) newp->dumpTree(cout, "-new "); if (debug() >= 9) newp->dumpTree(cout, "-new ");
newlistp = AstNode::addNextNull(newlistp, newp); newlistp = AstNode::addNext(newlistp, newp);
} }
if (debug() >= 9) nodep->dumpTree(cout, " Deslice-Dn: "); if (debug() >= 9) nodep->dumpTree(cout, " Deslice-Dn: ");
nodep->replaceWith(newlistp); nodep->replaceWith(newlistp);

View File

@ -496,7 +496,7 @@ private:
// Put assignment in FRONT of all other statements // Put assignment in FRONT of all other statements
if (AstNode* const afterp = beginp->nextp()) { if (AstNode* const afterp = beginp->nextp()) {
afterp->unlinkFrBackWithNext(); afterp->unlinkFrBackWithNext();
assp->addNext(afterp); AstNode::addNext<AstNode, AstNode>(assp, afterp);
} }
beginp->addNext(assp); beginp->addNext(assp);
} }
@ -819,7 +819,7 @@ private:
AstVarRef* const refp AstVarRef* const refp
= new AstVarRef(portp->fileline(), outvscp, = new AstVarRef(portp->fileline(), outvscp,
portp->isWritable() ? VAccess::WRITE : VAccess::READ); portp->isWritable() ? VAccess::WRITE : VAccess::READ);
argnodesp = argnodesp->addNextNull(refp); argnodesp = argnodesp->addNext(refp);
if (portp->isNonOutput()) { if (portp->isNonOutput()) {
std::string frName std::string frName
@ -847,7 +847,7 @@ private:
outvscp->varp()->protect(false); outvscp->varp()->protect(false);
AstVarRef* const refp = new AstVarRef( AstVarRef* const refp = new AstVarRef(
portp->fileline(), outvscp, portp->isWritable() ? VAccess::WRITE : VAccess::READ); portp->fileline(), outvscp, portp->isWritable() ? VAccess::WRITE : VAccess::READ);
argnodesp = argnodesp->addNextNull(refp); argnodesp = argnodesp->addNext(refp);
} }
{ // Call the user function { // Call the user function

View File

@ -279,15 +279,15 @@ private:
} }
if (precondsp) { if (precondsp) {
precondsp->unlinkFrBackWithNext(); precondsp->unlinkFrBackWithNext();
stmtsp = AstNode::addNextNull(stmtsp, precondsp); stmtsp = AstNode::addNext(stmtsp, precondsp);
} }
if (bodysp) { if (bodysp) {
bodysp->unlinkFrBackWithNext(); bodysp->unlinkFrBackWithNext();
stmtsp = AstNode::addNextNull(stmtsp, bodysp); // Maybe null if no body stmtsp = AstNode::addNext(stmtsp, bodysp); // Maybe null if no body
} }
if (incp && !VN_IS(nodep, GenFor)) { // Generates don't need to increment loop index if (incp && !VN_IS(nodep, GenFor)) { // Generates don't need to increment loop index
incp->unlinkFrBackWithNext(); incp->unlinkFrBackWithNext();
stmtsp = AstNode::addNextNull(stmtsp, incp); // Maybe null if no body stmtsp = AstNode::addNext(stmtsp, incp); // Maybe null if no body
} }
// Mark variable to disable some later warnings // Mark variable to disable some later warnings
m_forVarp->usedLoopIdx(true); m_forVarp->usedLoopIdx(true);

View File

@ -186,7 +186,7 @@ class VariableOrder final {
for (; it != varps.cend(); ++it) firstp->addNext(*it); for (; it != varps.cend(); ++it) firstp->addNext(*it);
if (AstNode* const stmtsp = modp->stmtsp()) { if (AstNode* const stmtsp = modp->stmtsp()) {
stmtsp->unlinkFrBackWithNext(); stmtsp->unlinkFrBackWithNext();
firstp->addNext(stmtsp); AstNode::addNext<AstNode, AstNode>(firstp, stmtsp);
} }
modp->addStmtp(firstp); modp->addStmtp(firstp);
} }

View File

@ -748,6 +748,7 @@ def write_macros(filename):
return static_cast<Ast{t}*>(AstNode::cloneTree(cloneNext)); return static_cast<Ast{t}*>(AstNode::cloneTree(cloneNext));
}} }}
Ast{t}* clonep() const {{ return static_cast<Ast{t}*>(AstNode::clonep()); }} Ast{t}* clonep() const {{ return static_cast<Ast{t}*>(AstNode::clonep()); }}
Ast{t}* addNext(Ast{t}* nodep) {{ return static_cast<Ast{t}*>(AstNode::addNext(this, nodep)); }}
''', ''',
t=node.name) t=node.name)

View File

@ -139,7 +139,7 @@ public:
} }
AstDisplay* createDisplayError(FileLine* fileline) { AstDisplay* createDisplayError(FileLine* fileline) {
AstDisplay* nodep = new AstDisplay(fileline, VDisplayType::DT_ERROR, "", nullptr, nullptr); AstDisplay* nodep = new AstDisplay(fileline, VDisplayType::DT_ERROR, "", nullptr, nullptr);
nodep->addNext(new AstStop(fileline, true)); AstNode::addNext<AstNode, AstNode>(nodep, new AstStop(fileline, true));
return nodep; return nodep;
} }
AstNode* createGatePin(AstNode* exprp) { AstNode* createGatePin(AstNode* exprp) {
@ -330,6 +330,12 @@ static void UNSUPREAL(FileLine* fileline) {
void yyerror(const char* errmsg) { PARSEP->bisonLastFileline()->v3error(errmsg); } void yyerror(const char* errmsg) { PARSEP->bisonLastFileline()->v3error(errmsg); }
template <typename T_Node, typename T_Next>
static T_Node* addNextNull(T_Node* nodep, T_Next* nextp) {
if (!nextp) return nodep;
return AstNode::addNext<T_Node, T_Next>(nodep, nextp);
}
//====================================================================== //======================================================================
class AstSenTree; class AstSenTree;
@ -1138,7 +1144,7 @@ package_itemListE<nodep>: // IEEE: [{ package_item }]
package_itemList<nodep>: // IEEE: { package_item } package_itemList<nodep>: // IEEE: { package_item }
package_item { $$ = $1; } package_item { $$ = $1; }
| package_itemList package_item { $$ = $1->addNextNull($2); } | package_itemList package_item { $$ = addNextNull($1, $2); }
; ;
package_item<nodep>: // ==IEEE: package_item package_item<nodep>: // ==IEEE: package_item
@ -1167,7 +1173,7 @@ package_or_generate_item_declaration<nodep>: // ==IEEE: package_or_generate_i
package_import_declarationList<nodep>: package_import_declarationList<nodep>:
package_import_declaration { $$ = $1; } package_import_declaration { $$ = $1; }
| package_import_declarationList package_import_declaration { $$ = $1->addNextNull($2); } | package_import_declarationList package_import_declaration { $$ = addNextNull($1, $2); }
; ;
package_import_declaration<nodep>: // ==IEEE: package_import_declaration package_import_declaration<nodep>: // ==IEEE: package_import_declaration
@ -1176,7 +1182,7 @@ package_import_declaration<nodep>: // ==IEEE: package_import_declaration
package_import_itemList<nodep>: package_import_itemList<nodep>:
package_import_item { $$ = $1; } package_import_item { $$ = $1; }
| package_import_itemList ',' package_import_item { $$ = $1->addNextNull($3); } | package_import_itemList ',' package_import_item { $$ = addNextNull($1, $3); }
; ;
package_import_item<nodep>: // ==IEEE: package_import_item package_import_item<nodep>: // ==IEEE: package_import_item
@ -1204,7 +1210,7 @@ package_export_declaration<nodep>: // IEEE: package_export_declaration
package_export_itemList<nodep>: package_export_itemList<nodep>:
package_export_item { $$ = $1; } package_export_item { $$ = $1; }
| package_export_itemList ',' package_export_item { $$ = $1->addNextNull($3); } | package_export_itemList ',' package_export_item { $$ = addNextNull($1, $3); }
; ;
package_export_item<nodep>: // ==IEEE: package_export_item package_export_item<nodep>: // ==IEEE: package_export_item
@ -1261,7 +1267,7 @@ modFront<nodeModulep>:
importsAndParametersE<nodep>: // IEEE: common part of module_declaration, interface_declaration, program_declaration importsAndParametersE<nodep>: // IEEE: common part of module_declaration, interface_declaration, program_declaration
// // { package_import_declaration } [ parameter_port_list ] // // { package_import_declaration } [ parameter_port_list ]
parameter_port_listE { $$ = $1; } parameter_port_listE { $$ = $1; }
| package_import_declarationList parameter_port_listE { $$ = $1->addNextNull($2); } | package_import_declarationList parameter_port_listE { $$ = addNextNull($1, $2); }
; ;
udpFront<nodeModulep>: udpFront<nodeModulep>:
@ -1332,12 +1338,12 @@ portsStarE<nodep>: // IEEE: .* + list_of_ports + list_of_port_decla
list_of_portsE<nodep>: // IEEE: list_of_ports + list_of_port_declarations list_of_portsE<nodep>: // IEEE: list_of_ports + list_of_port_declarations
portAndTagE { $$ = $1; } portAndTagE { $$ = $1; }
| list_of_portsE ',' portAndTagE { $$ = $1->addNextNull($3); } | list_of_portsE ',' portAndTagE { $$ = addNextNull($1, $3); }
; ;
list_of_ports<nodep>: // IEEE: list_of_ports + list_of_port_declarations list_of_ports<nodep>: // IEEE: list_of_ports + list_of_port_declarations
portAndTag { $$ = $1; } portAndTag { $$ = $1; }
| list_of_portsE ',' portAndTagE { $$ = $1->addNextNull($3); } | list_of_portsE ',' portAndTagE { $$ = addNextNull($1, $3); }
; ;
portAndTagE<nodep>: portAndTagE<nodep>:
@ -1375,11 +1381,11 @@ port<nodep>: // ==IEEE: port
portDirNetE id/*interface*/ portSig variable_dimensionListE sigAttrListE portDirNetE id/*interface*/ portSig variable_dimensionListE sigAttrListE
{ $$ = $3; VARDECL(IFACEREF); VARIO(NONE); { $$ = $3; VARDECL(IFACEREF); VARIO(NONE);
VARDTYPE(new AstIfaceRefDType($<fl>2,"",*$2)); VARDTYPE(new AstIfaceRefDType($<fl>2,"",*$2));
$$->addNextNull(VARDONEP($$,$4,$5)); } addNextNull($$, VARDONEP($$,$4,$5)); }
| portDirNetE id/*interface*/ '.' idAny/*modport*/ portSig variable_dimensionListE sigAttrListE | portDirNetE id/*interface*/ '.' idAny/*modport*/ portSig variable_dimensionListE sigAttrListE
{ $$ = $5; VARDECL(IFACEREF); VARIO(NONE); { $$ = $5; VARDECL(IFACEREF); VARIO(NONE);
VARDTYPE(new AstIfaceRefDType($<fl>2, $<fl>4, "", *$2, *$4)); VARDTYPE(new AstIfaceRefDType($<fl>2, $<fl>4, "", *$2, *$4));
$$->addNextNull(VARDONEP($$,$6,$7)); } addNextNull($$, VARDONEP($$,$6,$7)); }
| portDirNetE yINTERFACE portSig rangeListE sigAttrListE | portDirNetE yINTERFACE portSig rangeListE sigAttrListE
{ $$ = nullptr; BBUNSUP($<fl>2, "Unsupported: virtual or generic interfaces"); } { $$ = nullptr; BBUNSUP($<fl>2, "Unsupported: virtual or generic interfaces"); }
| portDirNetE yINTERFACE '.' idAny/*modport*/ portSig rangeListE sigAttrListE | portDirNetE yINTERFACE '.' idAny/*modport*/ portSig rangeListE sigAttrListE
@ -1430,29 +1436,29 @@ port<nodep>: // ==IEEE: port
//UNSUP { UNSUP } //UNSUP { UNSUP }
// //
| portDirNetE data_type portSig variable_dimensionListE sigAttrListE | portDirNetE data_type portSig variable_dimensionListE sigAttrListE
{ $$=$3; VARDTYPE($2); $$->addNextNull(VARDONEP($$,$4,$5)); } { $$=$3; VARDTYPE($2); addNextNull($$, VARDONEP($$,$4,$5)); }
| portDirNetE yVAR data_type portSig variable_dimensionListE sigAttrListE | portDirNetE yVAR data_type portSig variable_dimensionListE sigAttrListE
{ $$=$4; VARDTYPE($3); $$->addNextNull(VARDONEP($$,$5,$6)); } { $$=$4; VARDTYPE($3); addNextNull($$, VARDONEP($$,$5,$6)); }
| portDirNetE yVAR implicit_typeE portSig variable_dimensionListE sigAttrListE | portDirNetE yVAR implicit_typeE portSig variable_dimensionListE sigAttrListE
{ $$=$4; VARDTYPE($3); $$->addNextNull(VARDONEP($$,$5,$6)); } { $$=$4; VARDTYPE($3); addNextNull($$, VARDONEP($$,$5,$6)); }
| portDirNetE signing portSig variable_dimensionListE sigAttrListE | portDirNetE signing portSig variable_dimensionListE sigAttrListE
{ $$=$3; VARDTYPE_NDECL(new AstBasicDType($3->fileline(), LOGIC_IMPLICIT, $2)); { $$=$3; VARDTYPE_NDECL(new AstBasicDType($3->fileline(), LOGIC_IMPLICIT, $2));
$$->addNextNull(VARDONEP($$, $4, $5)); } addNextNull($$, VARDONEP($$, $4, $5)); }
| portDirNetE signingE rangeList portSig variable_dimensionListE sigAttrListE | portDirNetE signingE rangeList portSig variable_dimensionListE sigAttrListE
{ $$=$4; VARDTYPE_NDECL(GRAMMARP->addRange( { $$=$4; VARDTYPE_NDECL(GRAMMARP->addRange(
new AstBasicDType{$3->fileline(), LOGIC_IMPLICIT, $2}, $3, true)); new AstBasicDType{$3->fileline(), LOGIC_IMPLICIT, $2}, $3, true));
$$->addNextNull(VARDONEP($$, $5, $6)); } addNextNull($$, VARDONEP($$, $5, $6)); }
| portDirNetE /*implicit*/ portSig variable_dimensionListE sigAttrListE | portDirNetE /*implicit*/ portSig variable_dimensionListE sigAttrListE
{ $$=$2; /*VARDTYPE-same*/ $$->addNextNull(VARDONEP($$,$3,$4)); } { $$=$2; /*VARDTYPE-same*/ addNextNull($$, VARDONEP($$,$3,$4)); }
// //
| portDirNetE data_type portSig variable_dimensionListE sigAttrListE '=' constExpr | portDirNetE data_type portSig variable_dimensionListE sigAttrListE '=' constExpr
{ $$=$3; VARDTYPE($2); if (AstVar* vp = VARDONEP($$, $4, $5)) { $$->addNextNull(vp); vp->valuep($7); } } { $$=$3; VARDTYPE($2); if (AstVar* vp = VARDONEP($$, $4, $5)) { addNextNull($$, vp); vp->valuep($7); } }
| portDirNetE yVAR data_type portSig variable_dimensionListE sigAttrListE '=' constExpr | portDirNetE yVAR data_type portSig variable_dimensionListE sigAttrListE '=' constExpr
{ $$=$4; VARDTYPE($3); if (AstVar* vp = VARDONEP($$, $5, $6)) { $$->addNextNull(vp); vp->valuep($8); } } { $$=$4; VARDTYPE($3); if (AstVar* vp = VARDONEP($$, $5, $6)) { addNextNull($$, vp); vp->valuep($8); } }
| portDirNetE yVAR implicit_typeE portSig variable_dimensionListE sigAttrListE '=' constExpr | portDirNetE yVAR implicit_typeE portSig variable_dimensionListE sigAttrListE '=' constExpr
{ $$=$4; VARDTYPE($3); if (AstVar* vp = VARDONEP($$, $5, $6)) { $$->addNextNull(vp); vp->valuep($8); } } { $$=$4; VARDTYPE($3); if (AstVar* vp = VARDONEP($$, $5, $6)) { addNextNull($$, vp); vp->valuep($8); } }
| portDirNetE /*implicit*/ portSig variable_dimensionListE sigAttrListE '=' constExpr | portDirNetE /*implicit*/ portSig variable_dimensionListE sigAttrListE '=' constExpr
{ $$=$2; /*VARDTYPE-same*/ if (AstVar* vp = VARDONEP($$, $3, $4)) { $$->addNextNull(vp); vp->valuep($6); } } { $$=$2; /*VARDTYPE-same*/ if (AstVar* vp = VARDONEP($$, $3, $4)) { addNextNull($$, vp); vp->valuep($6); } }
; ;
portDirNetE: // IEEE: part of port, optional net type and/or direction portDirNetE: // IEEE: part of port, optional net type and/or direction
@ -1507,7 +1513,7 @@ interface_itemListE<nodep>:
interface_itemList<nodep>: interface_itemList<nodep>:
interface_item { $$ = $1; } interface_item { $$ = $1; }
| interface_itemList interface_item { $$ = $1->addNextNull($2); } | interface_itemList interface_item { $$ = addNextNull($1, $2); }
; ;
interface_item<nodep>: // IEEE: interface_item + non_port_interface_item interface_item<nodep>: // IEEE: interface_item + non_port_interface_item
@ -1555,7 +1561,7 @@ anonymous_program_itemListE<nodep>: // IEEE: { anonymous_program_item }
anonymous_program_itemList<nodep>: // IEEE: { anonymous_program_item } anonymous_program_itemList<nodep>: // IEEE: { anonymous_program_item }
anonymous_program_item { $$ = $1; } anonymous_program_item { $$ = $1; }
| anonymous_program_itemList anonymous_program_item { $$ = $1->addNextNull($2); } | anonymous_program_itemList anonymous_program_item { $$ = addNextNull($1, $2); }
; ;
anonymous_program_item<nodep>: // ==IEEE: anonymous_program_item anonymous_program_item<nodep>: // ==IEEE: anonymous_program_item
@ -1602,7 +1608,7 @@ program_itemListE<nodep>: // ==IEEE: [{ program_item }]
program_itemList<nodep>: // ==IEEE: { program_item } program_itemList<nodep>: // ==IEEE: { program_item }
program_item { $$ = $1; } program_item { $$ = $1; }
| program_itemList program_item { $$ = $1->addNextNull($2); } | program_itemList program_item { $$ = addNextNull($1, $2); }
; ;
program_item<nodep>: // ==IEEE: program_item program_item<nodep>: // ==IEEE: program_item
@ -1642,7 +1648,7 @@ modport_declaration<nodep>: // ==IEEE: modport_declaration
modport_itemList<nodep>: // IEEE: part of modport_declaration modport_itemList<nodep>: // IEEE: part of modport_declaration
modport_item { $$ = $1; } modport_item { $$ = $1; }
| modport_itemList ',' modport_item { $$ = $1->addNextNull($3); } | modport_itemList ',' modport_item { $$ = addNextNull($1, $3); }
; ;
modport_item<nodep>: // ==IEEE: modport_item modport_item<nodep>: // ==IEEE: modport_item
@ -1653,7 +1659,7 @@ modport_item<nodep>: // ==IEEE: modport_item
modportPortsDeclList<nodep>: modportPortsDeclList<nodep>:
modportPortsDecl { $$ = $1; } modportPortsDecl { $$ = $1; }
| modportPortsDeclList ',' modportPortsDecl { $$ = $1->addNextNull($3); } | modportPortsDeclList ',' modportPortsDecl { $$ = addNextNull($1, $3); }
; ;
// IEEE: modport_ports_declaration + modport_simple_ports_declaration // IEEE: modport_ports_declaration + modport_simple_ports_declaration
@ -2004,7 +2010,7 @@ struct_unionDecl<nodeUOrStructDTypep>: // IEEE: part of data_type
struct_union_memberList<nodep>: // IEEE: { struct_union_member } struct_union_memberList<nodep>: // IEEE: { struct_union_member }
struct_union_member { $$ = $1; } struct_union_member { $$ = $1; }
| struct_union_memberList struct_union_member { $$ = $1->addNextNull($2); } | struct_union_memberList struct_union_member { $$ = addNextNull($1, $2); }
; ;
struct_union_member<nodep>: // ==IEEE: struct_union_member struct_union_member<nodep>: // ==IEEE: struct_union_member
@ -2017,7 +2023,7 @@ struct_union_member<nodep>: // ==IEEE: struct_union_member
list_of_member_decl_assignments<nodep>: // Derived from IEEE: list_of_variable_decl_assignments list_of_member_decl_assignments<nodep>: // Derived from IEEE: list_of_variable_decl_assignments
member_decl_assignment { $$ = $1; } member_decl_assignment { $$ = $1; }
| list_of_member_decl_assignments ',' member_decl_assignment { $$ = $1->addNextNull($3); } | list_of_member_decl_assignments ',' member_decl_assignment { $$ = addNextNull($1, $3); }
; ;
member_decl_assignment<memberDTypep>: // Derived from IEEE: variable_decl_assignment member_decl_assignment<memberDTypep>: // Derived from IEEE: variable_decl_assignment
@ -2050,7 +2056,7 @@ member_decl_assignment<memberDTypep>: // Derived from IEEE: variable_decl_assi
list_of_variable_decl_assignments<varp>: // ==IEEE: list_of_variable_decl_assignments list_of_variable_decl_assignments<varp>: // ==IEEE: list_of_variable_decl_assignments
variable_decl_assignment { $$ = $1; } variable_decl_assignment { $$ = $1; }
| list_of_variable_decl_assignments ',' variable_decl_assignment { $$ = VN_CAST($1->addNextNull($3), Var); } | list_of_variable_decl_assignments ',' variable_decl_assignment { $$ = addNextNull($1, $3); }
; ;
variable_decl_assignment<varp>: // ==IEEE: variable_decl_assignment variable_decl_assignment<varp>: // ==IEEE: variable_decl_assignment
@ -2080,7 +2086,7 @@ list_of_tf_variable_identifiers<nodep>: // ==IEEE: list_of_tf_variable_identifie
tf_variable_identifier<varp>: // IEEE: part of list_of_tf_variable_identifiers tf_variable_identifier<varp>: // IEEE: part of list_of_tf_variable_identifiers
id variable_dimensionListE sigAttrListE exprEqE id variable_dimensionListE sigAttrListE exprEqE
{ $$ = VARDONEA($<fl>1,*$1, $2, $3); { $$ = VARDONEA($<fl>1,*$1, $2, $3);
if ($4) $$->addNext(new AstAssign($4->fileline(), new AstVarRef($<fl>1, *$1, VAccess::WRITE), $4)); } if ($4) AstNode::addNext<AstNode, AstNode>($$, new AstAssign($4->fileline(), new AstVarRef($<fl>1, *$1, VAccess::WRITE), $4)); }
; ;
variable_declExpr<nodep>: // IEEE: part of variable_decl_assignment - rhs of expr variable_declExpr<nodep>: // IEEE: part of variable_decl_assignment - rhs of expr
@ -2096,7 +2102,7 @@ variable_dimensionListE<nodeRangep>: // IEEE: variable_dimension + empty
variable_dimensionList<nodeRangep>: // IEEE: variable_dimension + empty variable_dimensionList<nodeRangep>: // IEEE: variable_dimension + empty
variable_dimension { $$ = $1; } variable_dimension { $$ = $1; }
| variable_dimensionList variable_dimension { $$ = VN_CAST($1->addNext($2), NodeRange); } | variable_dimensionList variable_dimension { $$ = $1->addNext($2); }
; ;
variable_dimension<nodeRangep>: // ==IEEE: variable_dimension variable_dimension<nodeRangep>: // ==IEEE: variable_dimension
@ -2173,7 +2179,7 @@ enum_base_typeE<nodeDTypep>: // IEEE: enum_base_type
enum_nameList<nodep>: enum_nameList<nodep>:
enum_name_declaration { $$ = $1; } enum_name_declaration { $$ = $1; }
| enum_nameList ',' enum_name_declaration { $$ = $1->addNextNull($3); } | enum_nameList ',' enum_name_declaration { $$ = addNextNull($1, $3); }
; ;
enum_name_declaration<nodep>: // ==IEEE: enum_name_declaration enum_name_declaration<nodep>: // ==IEEE: enum_name_declaration
@ -2364,7 +2370,7 @@ dtypeAttrListE<nodep>:
dtypeAttrList<nodep>: dtypeAttrList<nodep>:
dtypeAttr { $$ = $1; } dtypeAttr { $$ = $1; }
| dtypeAttrList dtypeAttr { $$ = $1->addNextNull($2); } | dtypeAttrList dtypeAttr { $$ = addNextNull($1, $2); }
; ;
dtypeAttr<nodep>: dtypeAttr<nodep>:
@ -2385,7 +2391,7 @@ module_itemListE<nodep>: // IEEE: Part of module_declaration
module_itemList<nodep>: // IEEE: Part of module_declaration module_itemList<nodep>: // IEEE: Part of module_declaration
module_item { $$ = $1; } module_item { $$ = $1; }
| module_itemList module_item { $$ = $1->addNextNull($2); } | module_itemList module_item { $$ = addNextNull($1, $2); }
; ;
module_item<nodep>: // ==IEEE: module_item module_item<nodep>: // ==IEEE: module_item
@ -2573,7 +2579,7 @@ genItemOrBegin<nodep>: // Not in IEEE, but our begin isn't under genera
genItemList<nodep>: genItemList<nodep>:
~c~genItemOrBegin { $$ = $1; } ~c~genItemOrBegin { $$ = $1; }
| ~c~genItemList ~c~genItemOrBegin { $$ = $1->addNextNull($2); } | ~c~genItemList ~c~genItemOrBegin { $$ = addNextNull($1, $2); }
; ;
//UNSUPc_genItemList<nodep>: // (for checkers) //UNSUPc_genItemList<nodep>: // (for checkers)
@ -2641,7 +2647,7 @@ loop_generate_construct<nodep>: // ==IEEE: loop_generate_construct
genvar_initialization<nodep>: // ==IEEE: genvar_initialization genvar_initialization<nodep>: // ==IEEE: genvar_initialization
varRefBase '=' expr { $$ = new AstAssign($2,$1,$3); } varRefBase '=' expr { $$ = new AstAssign($2,$1,$3); }
| yGENVAR genvar_identifierDecl '=' constExpr | yGENVAR genvar_identifierDecl '=' constExpr
{ $$ = $2; $2->addNext(new AstAssign($3, new AstVarRef($2->fileline(), $2, VAccess::WRITE), $4)); } { $$ = $2; AstNode::addNext<AstNode, AstNode>($$, new AstAssign($3, new AstVarRef($2->fileline(), $2, VAccess::WRITE), $4)); }
; ;
genvar_iteration<nodep>: // ==IEEE: genvar_iteration genvar_iteration<nodep>: // ==IEEE: genvar_iteration
@ -2763,7 +2769,7 @@ netSig<varp>: // IEEE: net_decl_assignment - one element from
auto* const assignp = new AstAssignW{$3, new AstVarRef{$<fl>1, *$1, VAccess::WRITE}, $4}; auto* const assignp = new AstAssignW{$3, new AstVarRef{$<fl>1, *$1, VAccess::WRITE}, $4};
if (GRAMMARP->m_netStrengthp) assignp->strengthSpecp(GRAMMARP->m_netStrengthp->cloneTree(false)); if (GRAMMARP->m_netStrengthp) assignp->strengthSpecp(GRAMMARP->m_netStrengthp->cloneTree(false));
if ($$->delayp()) assignp->addTimingControlp($$->delayp()->unlinkFrBack()); // IEEE 1800-2017 10.3.3 if ($$->delayp()) assignp->addTimingControlp($$->delayp()->unlinkFrBack()); // IEEE 1800-2017 10.3.3
$$->addNext(assignp); } | netId variable_dimensionList sigAttrListE AstNode::addNext<AstNode, AstNode>($$, assignp); } | netId variable_dimensionList sigAttrListE
{ $$ = VARDONEA($<fl>1,*$1, $2, $3); } { $$ = VARDONEA($<fl>1,*$1, $2, $3); }
; ;
@ -2779,7 +2785,7 @@ sigAttrListE<nodep>:
sigAttrList<nodep>: sigAttrList<nodep>:
sigAttr { $$ = $1; } sigAttr { $$ = $1; }
| sigAttrList sigAttr { $$ = $1->addNextNull($2); } | sigAttrList sigAttr { $$ = addNextNull($1, $2); }
; ;
sigAttr<nodep>: sigAttr<nodep>:
@ -2806,7 +2812,7 @@ rangeListE<nodeRangep>: // IEEE: [{packed_dimension}]
rangeList<nodeRangep>: // IEEE: {packed_dimension} rangeList<nodeRangep>: // IEEE: {packed_dimension}
anyrange { $$ = $1; } anyrange { $$ = $1; }
| rangeList anyrange { $$ = $1; $1->addNext($2); } | rangeList anyrange { $$ = $1->addNext($2); }
; ;
//UNSUPbit_selectE<fl>: // IEEE: constant_bit_select (IEEE included empty) //UNSUPbit_selectE<fl>: // IEEE: constant_bit_select (IEEE included empty)
@ -2828,7 +2834,7 @@ packed_dimensionListE<nodeRangep>: // IEEE: [{ packed_dimension }]
packed_dimensionList<nodeRangep>: // IEEE: { packed_dimension } packed_dimensionList<nodeRangep>: // IEEE: { packed_dimension }
packed_dimension { $$ = $1; } packed_dimension { $$ = $1; }
| packed_dimensionList packed_dimension { $$ = VN_CAST($1->addNext($2), NodeRange); } | packed_dimensionList packed_dimension { $$ = $1->addNext($2); }
; ;
packed_dimension<nodeRangep>: // ==IEEE: packed_dimension packed_dimension<nodeRangep>: // ==IEEE: packed_dimension
@ -2857,7 +2863,7 @@ param_assignment<varp>: // ==IEEE: param_assignment
list_of_param_assignments<varp>: // ==IEEE: list_of_param_assignments list_of_param_assignments<varp>: // ==IEEE: list_of_param_assignments
param_assignment { $$ = $1; } param_assignment { $$ = $1; }
| list_of_param_assignments ',' param_assignment { $$ = $1; $1->addNext($3); } | list_of_param_assignments ',' param_assignment { $$ = $1->addNext($3); }
; ;
type_assignment<varp>: // ==IEEE: type_assignment type_assignment<varp>: // ==IEEE: type_assignment
@ -2868,7 +2874,7 @@ type_assignment<varp>: // ==IEEE: type_assignment
list_of_type_assignments<varp>: // ==IEEE: list_of_type_assignments list_of_type_assignments<varp>: // ==IEEE: list_of_type_assignments
type_assignment { $$ = $1; } type_assignment { $$ = $1; }
| list_of_type_assignments ',' type_assignment { $$ = $1; $1->addNext($3); } | list_of_type_assignments ',' type_assignment { $$ = $1->addNext($3); }
; ;
list_of_defparam_assignments<nodep>: //== IEEE: list_of_defparam_assignments list_of_defparam_assignments<nodep>: //== IEEE: list_of_defparam_assignments
@ -2948,7 +2954,7 @@ instRangeListE<nodeRangep>:
instRangeList<nodeRangep>: instRangeList<nodeRangep>:
instRange { $$ = $1; } instRange { $$ = $1; }
| instRangeList instRange { $$ = VN_CAST($1->addNextNull($2), Range); } | instRangeList instRange { $$ = addNextNull($1, $2); }
; ;
instRange<nodeRangep>: instRange<nodeRangep>:
@ -2968,12 +2974,12 @@ cellpinList<pinp>:
cellparamItList<pinp>: // IEEE: list_of_parameter_assignmente cellparamItList<pinp>: // IEEE: list_of_parameter_assignmente
cellparamItemE { $$ = $1; } cellparamItemE { $$ = $1; }
| cellparamItList ',' cellparamItemE { $$ = VN_CAST($1->addNextNull($3), Pin); } | cellparamItList ',' cellparamItemE { $$ = addNextNull($1, $3); }
; ;
cellpinItList<pinp>: // IEEE: list_of_port_connections cellpinItList<pinp>: // IEEE: list_of_port_connections
cellpinItemE { $$ = $1; } cellpinItemE { $$ = $1; }
| cellpinItList ',' cellpinItemE { $$ = VN_CAST($1->addNextNull($3), Pin); } | cellpinItList ',' cellpinItemE { $$ = addNextNull($1, $3); }
; ;
cellparamItemE<pinp>: // IEEE: named_parameter_assignment + empty cellparamItemE<pinp>: // IEEE: named_parameter_assignment + empty
@ -3051,11 +3057,11 @@ event_control<senTreep>: // ==IEEE: event_control
event_expression<senItemp>: // IEEE: event_expression - split over several event_expression<senItemp>: // IEEE: event_expression - split over several
//UNSUP // Below are all removed //UNSUP // Below are all removed
senitem { $$ = $1; } senitem { $$ = $1; }
| event_expression yOR senitem { $$ = VN_CAST($1->addNextNull($3), SenItem); } | event_expression yOR senitem { $$ = addNextNull($1, $3); }
| event_expression ',' senitem { $$ = VN_CAST($1->addNextNull($3), SenItem); } /* Verilog 2001 */ | event_expression ',' senitem { $$ = addNextNull($1, $3); } /* Verilog 2001 */
//UNSUP // Above are all removed, replace with: //UNSUP // Above are all removed, replace with:
//UNSUP ev_expr { $$ = $1; } //UNSUP ev_expr { $$ = $1; }
//UNSUP event_expression ',' ev_expr %prec yOR { $$ = VN_CAST($1->addNextNull($3), SenItem); } //UNSUP event_expression ',' ev_expr %prec yOR { $$ = addNextNull($1, $3); }
; ;
senitem<senItemp>: // IEEE: part of event_expression, non-'OR' ',' terms senitem<senItemp>: // IEEE: part of event_expression, non-'OR' ',' terms
@ -3167,7 +3173,7 @@ par_blockFrontPreId<forkp>: // IEEE: part of par_block/stmt with leading id
blockDeclStmtList<nodep>: // IEEE: { block_item_declaration } { statement or null } blockDeclStmtList<nodep>: // IEEE: { block_item_declaration } { statement or null }
// // The spec seems to suggest a empty declaration isn't ok, but most simulators take it // // The spec seems to suggest a empty declaration isn't ok, but most simulators take it
block_item_declarationList { $$ = $1; } block_item_declarationList { $$ = $1; }
| block_item_declarationList stmtList { $$ = $1->addNextNull($2); } | block_item_declarationList stmtList { $$ = addNextNull($1, $2); }
| stmtList { $$ = $1; } | stmtList { $$ = $1; }
; ;
@ -3178,7 +3184,7 @@ blockDeclStmtListE<nodep>: // IEEE: [ { block_item_declaration } { statemen
block_item_declarationList<nodep>: // IEEE: [ block_item_declaration ] block_item_declarationList<nodep>: // IEEE: [ block_item_declaration ]
block_item_declaration { $$ = $1; } block_item_declaration { $$ = $1; }
| block_item_declarationList block_item_declaration { $$ = $1->addNextNull($2); } | block_item_declarationList block_item_declaration { $$ = addNextNull($1, $2); }
; ;
block_item_declaration<nodep>: // ==IEEE: block_item_declaration block_item_declaration<nodep>: // ==IEEE: block_item_declaration
@ -3189,7 +3195,7 @@ block_item_declaration<nodep>: // ==IEEE: block_item_declaration
stmtList<nodep>: stmtList<nodep>:
stmtBlock { $$ = $1; } stmtBlock { $$ = $1; }
| stmtList stmtBlock { $$ = $2 ? $1->addNext($2) : $1; } | stmtList stmtBlock { $$ = addNextNull($1, $2); }
; ;
stmt<nodep>: // IEEE: statement_or_null == function_statement_or_null stmt<nodep>: // IEEE: statement_or_null == function_statement_or_null
@ -3488,23 +3494,23 @@ case_itemList<caseItemp>: // IEEE: { case_item + ... }
caseCondList colon stmtBlock { $$ = new AstCaseItem{$2, $1, $3}; } caseCondList colon stmtBlock { $$ = new AstCaseItem{$2, $1, $3}; }
| yDEFAULT colon stmtBlock { $$ = new AstCaseItem{$1, nullptr, $3}; } | yDEFAULT colon stmtBlock { $$ = new AstCaseItem{$1, nullptr, $3}; }
| yDEFAULT stmtBlock { $$ = new AstCaseItem{$1, nullptr, $2}; } | yDEFAULT stmtBlock { $$ = new AstCaseItem{$1, nullptr, $2}; }
| case_itemList caseCondList colon stmtBlock { $$ = $1; $1->addNext(new AstCaseItem{$3, $2, $4}); } | case_itemList caseCondList colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$3, $2, $4}); }
| case_itemList yDEFAULT stmtBlock { $$ = $1; $1->addNext(new AstCaseItem{$2, nullptr, $3}); } | case_itemList yDEFAULT stmtBlock { $$ = $1->addNext(new AstCaseItem{$2, nullptr, $3}); }
| case_itemList yDEFAULT colon stmtBlock { $$ = $1; $1->addNext(new AstCaseItem{$2, nullptr, $4}); } | case_itemList yDEFAULT colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$2, nullptr, $4}); }
; ;
case_inside_itemList<caseItemp>: // IEEE: { case_inside_item + open_range_list ... } case_inside_itemList<caseItemp>: // IEEE: { case_inside_item + open_range_list ... }
open_range_list colon stmtBlock { $$ = new AstCaseItem{$2, $1, $3}; } open_range_list colon stmtBlock { $$ = new AstCaseItem{$2, $1, $3}; }
| yDEFAULT colon stmtBlock { $$ = new AstCaseItem{$1, nullptr, $3}; } | yDEFAULT colon stmtBlock { $$ = new AstCaseItem{$1, nullptr, $3}; }
| yDEFAULT stmtBlock { $$ = new AstCaseItem{$1, nullptr, $2}; } | yDEFAULT stmtBlock { $$ = new AstCaseItem{$1, nullptr, $2}; }
| case_inside_itemList open_range_list colon stmtBlock { $$ = $1; $1->addNext(new AstCaseItem{$3, $2, $4}); } | case_inside_itemList open_range_list colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$3, $2, $4}); }
| case_inside_itemList yDEFAULT stmtBlock { $$ = $1; $1->addNext(new AstCaseItem{$2, nullptr, $3}); } | case_inside_itemList yDEFAULT stmtBlock { $$ = $1->addNext(new AstCaseItem{$2, nullptr, $3}); }
| case_inside_itemList yDEFAULT colon stmtBlock { $$ = $1; $1->addNext(new AstCaseItem{$2, nullptr, $4}); } | case_inside_itemList yDEFAULT colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$2, nullptr, $4}); }
; ;
open_range_list<nodep>: // ==IEEE: open_range_list + open_value_range open_range_list<nodep>: // ==IEEE: open_range_list + open_value_range
open_value_range { $$ = $1; } open_value_range { $$ = $1; }
| open_range_list ',' open_value_range { $$ = $1; $1->addNext($3); } | open_range_list ',' open_value_range { $$ = $1->addNext($3); }
; ;
open_value_range<nodep>: // ==IEEE: open_value_range open_value_range<nodep>: // ==IEEE: open_value_range
@ -3523,7 +3529,7 @@ value_range<nodep>: // ==IEEE: value_range
caseCondList<nodep>: // IEEE: part of case_item caseCondList<nodep>: // IEEE: part of case_item
expr { $$ = $1; } expr { $$ = $1; }
| caseCondList ',' expr { $$ = $1; $1->addNext($3); } | caseCondList ',' expr { $$ = $1->addNext($3); }
; ;
patternNoExpr<nodep>: // IEEE: pattern **Excluding Expr* patternNoExpr<nodep>: // IEEE: pattern **Excluding Expr*
@ -3540,7 +3546,7 @@ patternNoExpr<nodep>: // IEEE: pattern **Excluding Expr*
patternList<nodep>: // IEEE: part of pattern patternList<nodep>: // IEEE: part of pattern
patternOne { $$ = $1; } patternOne { $$ = $1; }
| patternList ',' patternOne { $$ = $1->addNextNull($3); } | patternList ',' patternOne { $$ = addNextNull($1, $3); }
; ;
patternOne<nodep>: // IEEE: part of pattern patternOne<nodep>: // IEEE: part of pattern
@ -3552,7 +3558,7 @@ patternOne<nodep>: // IEEE: part of pattern
patternMemberList<nodep>: // IEEE: part of pattern and assignment_pattern patternMemberList<nodep>: // IEEE: part of pattern and assignment_pattern
patternMemberOne { $$ = $1; } patternMemberOne { $$ = $1; }
| patternMemberList ',' patternMemberOne { $$ = $1->addNextNull($3); } | patternMemberList ',' patternMemberOne { $$ = addNextNull($1, $3); }
; ;
patternMemberOne<patMemberp>: // IEEE: part of pattern and assignment_pattern patternMemberOne<patMemberp>: // IEEE: part of pattern and assignment_pattern
@ -3634,7 +3640,7 @@ for_stepE<nodep>: // IEEE: for_step + empty
for_step<nodep>: // IEEE: for_step for_step<nodep>: // IEEE: for_step
for_step_assignment { $$ = $1; } for_step_assignment { $$ = $1; }
| for_step ',' for_step_assignment { $$ = AstNode::addNextNull($1, $3); } | for_step ',' for_step_assignment { $$ = addNextNull($1, $3); }
; ;
for_step_assignment<nodep>: // ==IEEE: for_step_assignment for_step_assignment<nodep>: // ==IEEE: for_step_assignment
@ -3653,7 +3659,7 @@ for_step_assignment<nodep>: // ==IEEE: for_step_assignment
loop_variables<nodep>: // IEEE: loop_variables loop_variables<nodep>: // IEEE: loop_variables
parseRefBase { $$ = $1; } parseRefBase { $$ = $1; }
| loop_variables ',' parseRefBase { $$ = $1; $$->addNext($3); } | loop_variables ',' parseRefBase { $$ = $1->addNext($3); }
| ',' parseRefBase { $$ = new AstEmpty{$1}; $$->addNext($2); } | ',' parseRefBase { $$ = new AstEmpty{$1}; $$->addNext($2); }
; ;
@ -4009,7 +4015,7 @@ exprOrDataType<nodep>: // expr | data_type: combined to prevent conflic
//UNSUPexprOrDataTypeList<nodep>: //UNSUPexprOrDataTypeList<nodep>:
//UNSUP exprOrDataType { $$ = $1; } //UNSUP exprOrDataType { $$ = $1; }
//UNSUP | exprOrDataTypeList ',' exprOrDataType { $$ = AstNode::addNextNull($1, $3); } //UNSUP | exprOrDataTypeList ',' exprOrDataType { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
list_of_argumentsE<nodep>: // IEEE: [list_of_arguments] list_of_argumentsE<nodep>: // IEEE: [list_of_arguments]
@ -4018,7 +4024,7 @@ list_of_argumentsE<nodep>: // IEEE: [list_of_arguments]
{ if (VN_IS($1, Arg) && VN_CAST($1, Arg)->emptyConnectNoNext()) { { if (VN_IS($1, Arg) && VN_CAST($1, Arg)->emptyConnectNoNext()) {
$1->deleteTree(); $$ = nullptr; // Mis-created when have 'func()' $1->deleteTree(); $$ = nullptr; // Mis-created when have 'func()'
} else { $$ = $1; } } } else { $$ = $1; } }
| argsExprListE ',' argsDottedList { $$ = $1->addNextNull($3); } | argsExprListE ',' argsDottedList { $$ = addNextNull($1, $3); }
; ;
task_declaration<nodeFTaskp>: // ==IEEE: task_declaration task_declaration<nodeFTaskp>: // ==IEEE: task_declaration
@ -4160,20 +4166,20 @@ fIdScoped<funcp>: // IEEE: part of function_body_declaration/task_
; ;
tfGuts<nodep>: tfGuts<nodep>:
'(' tf_port_listE ')' ';' tfBodyE { $$ = $2->addNextNull($5); } '(' tf_port_listE ')' ';' tfBodyE { $$ = addNextNull($2, $5); }
| ';' tfBodyE { $$ = $2; } | ';' tfBodyE { $$ = $2; }
; ;
tfBodyE<nodep>: // IEEE: part of function_body_declaration/task_body_declaration tfBodyE<nodep>: // IEEE: part of function_body_declaration/task_body_declaration
/* empty */ { $$ = nullptr; } /* empty */ { $$ = nullptr; }
| tf_item_declarationList { $$ = $1; } | tf_item_declarationList { $$ = $1; }
| tf_item_declarationList stmtList { $$ = $1->addNextNull($2); } | tf_item_declarationList stmtList { $$ = addNextNull($1, $2); }
| stmtList { $$ = $1; } | stmtList { $$ = $1; }
; ;
tf_item_declarationList<nodep>: tf_item_declarationList<nodep>:
tf_item_declaration { $$ = $1; } tf_item_declaration { $$ = $1; }
| tf_item_declarationList tf_item_declaration { $$ = $1->addNextNull($2); } | tf_item_declarationList tf_item_declaration { $$ = addNextNull($1, $2); }
; ;
tf_item_declaration<nodep>: // ==IEEE: tf_item_declaration tf_item_declaration<nodep>: // ==IEEE: tf_item_declaration
@ -4196,7 +4202,7 @@ tf_port_listE<nodep>: // IEEE: tf_port_list + empty
tf_port_listList<nodep>: // IEEE: part of tf_port_list tf_port_listList<nodep>: // IEEE: part of tf_port_list
tf_port_item { $$ = $1; } tf_port_item { $$ = $1; }
| tf_port_listList ',' tf_port_item { $$ = $1->addNextNull($3); } | tf_port_listList ',' tf_port_item { $$ = addNextNull($1, $3); }
; ;
tf_port_item<nodep>: // ==IEEE: tf_port_item tf_port_item<nodep>: // ==IEEE: tf_port_item
@ -4629,7 +4635,7 @@ exprStrText<nodep>:
cStrList<nodep>: cStrList<nodep>:
exprStrText { $$ = $1; } exprStrText { $$ = $1; }
| exprStrText ',' cStrList { $$ = $1; $1->addNext($3); } | exprStrText ',' cStrList { $$ = $1->addNext($3); }
; ;
cateList<nodep>: cateList<nodep>:
@ -4645,20 +4651,20 @@ exprListE<nodep>:
exprList<nodep>: exprList<nodep>:
expr { $$ = $1; } expr { $$ = $1; }
| exprList ',' expr { $$ = $1; $1->addNext($3); } | exprList ',' expr { $$ = $1->addNext($3); }
; ;
exprDispList<nodep>: // exprList for within $display exprDispList<nodep>: // exprList for within $display
expr { $$ = $1; } expr { $$ = $1; }
| exprDispList ',' expr { $$ = $1; $1->addNext($3); } | exprDispList ',' expr { $$ = $1->addNext($3); }
// // ,, creates a space in $display // // ,, creates a space in $display
| exprDispList ',' /*empty*/ | exprDispList ',' /*empty*/
{ $$ = $1; $1->addNext(new AstConst($<fl>2, AstConst::VerilogStringLiteral(), " ")); } { $$ = $1->addNext(new AstConst($<fl>2, AstConst::VerilogStringLiteral(), " ")); }
; ;
vrdList<nodep>: vrdList<nodep>:
idClassSel { $$ = $1; } idClassSel { $$ = $1; }
| vrdList ',' idClassSel { $$ = $1; $1->addNext($3); } | vrdList ',' idClassSel { $$ = $1->addNext($3); }
; ;
commaVRDListE<nodep>: commaVRDListE<nodep>:
@ -4678,7 +4684,7 @@ argsExprListE<nodep>: // IEEE: part of list_of_arguments
//UNSUPpev_argsExprListE<nodep>: // IEEE: part of list_of_arguments - pev_expr at bottom //UNSUPpev_argsExprListE<nodep>: // IEEE: part of list_of_arguments - pev_expr at bottom
//UNSUP pev_argsExprOneE { $$ = $1; } //UNSUP pev_argsExprOneE { $$ = $1; }
//UNSUP | pev_argsExprListE ',' pev_argsExprOneE { $$ = AstNode::addNextNull($1, $3); } //UNSUP | pev_argsExprListE ',' pev_argsExprOneE { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
argsExprOneE<nodep>: // IEEE: part of list_of_arguments argsExprOneE<nodep>: // IEEE: part of list_of_arguments
@ -4693,12 +4699,12 @@ argsExprOneE<nodep>: // IEEE: part of list_of_arguments
argsDottedList<nodep>: // IEEE: part of list_of_arguments argsDottedList<nodep>: // IEEE: part of list_of_arguments
argsDotted { $$ = $1; } argsDotted { $$ = $1; }
| argsDottedList ',' argsDotted { $$ = $1->addNextNull($3); } | argsDottedList ',' argsDotted { $$ = addNextNull($1, $3); }
; ;
//UNSUPpev_argsDottedList<nodep>: // IEEE: part of list_of_arguments - pev_expr at bottom //UNSUPpev_argsDottedList<nodep>: // IEEE: part of list_of_arguments - pev_expr at bottom
//UNSUP pev_argsDotted { $$ = $1; } //UNSUP pev_argsDotted { $$ = $1; }
//UNSUP | pev_argsDottedList ',' pev_argsDotted { $$ = AstNode::addNextNull($1, $3); } //UNSUP | pev_argsDottedList ',' pev_argsDotted { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
argsDotted<nodep>: // IEEE: part of list_of_arguments argsDotted<nodep>: // IEEE: part of list_of_arguments
@ -4988,7 +4994,7 @@ combinational_body<nodep>: // IEEE: combinational_body + sequential_body
tableEntryList<nodep>: // IEEE: { combinational_entry | sequential_entry } tableEntryList<nodep>: // IEEE: { combinational_entry | sequential_entry }
tableEntry { $$ = $1; } tableEntry { $$ = $1; }
| tableEntryList tableEntry { $$ = $1->addNextNull($2); } | tableEntryList tableEntry { $$ = addNextNull($1, $2); }
; ;
tableEntry<nodep>: // IEEE: combinational_entry + sequential_entry tableEntry<nodep>: // IEEE: combinational_entry + sequential_entry
@ -5084,7 +5090,7 @@ variable_lvalueConcList<nodep>: // IEEE: part of variable_lvalue: '{' variable_l
//UNSUPvariable_lvalueList<nodep>: // IEEE: part of variable_lvalue: variable_lvalue { ',' variable_lvalue } //UNSUPvariable_lvalueList<nodep>: // IEEE: part of variable_lvalue: variable_lvalue { ',' variable_lvalue }
//UNSUP variable_lvalue { $$ = $1; } //UNSUP variable_lvalue { $$ = $1; }
//UNSUP | variable_lvalueList ',' variable_lvalue { $$ = AstNode::addNextNull($1, $3); } //UNSUP | variable_lvalueList ',' variable_lvalue { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
// VarRef to dotted, and/or arrayed, and/or bit-ranged variable // VarRef to dotted, and/or arrayed, and/or bit-ranged variable
@ -5162,9 +5168,9 @@ idArrayedForeach<nodep>: // IEEE: id + select (under foreach expression)
// // IEEE: loop_variables (under foreach expression) // // IEEE: loop_variables (under foreach expression)
// // To avoid conflicts we allow expr as first element, must post-check // // To avoid conflicts we allow expr as first element, must post-check
| idArrayed '[' expr ',' loop_variables ']' | idArrayed '[' expr ',' loop_variables ']'
{ $3 = AstNode::addNextNull($3, $5); $$ = new AstSelLoopVars($2, $1, $3); } { $3 = addNextNull($3, $5); $$ = new AstSelLoopVars($2, $1, $3); }
| idArrayed '[' ',' loop_variables ']' | idArrayed '[' ',' loop_variables ']'
{ $4 = AstNode::addNextNull(static_cast<AstNode*>(new AstEmpty{$3}), $4); $$ = new AstSelLoopVars($2, $1, $4); } { $4 = addNextNull(static_cast<AstNode*>(new AstEmpty{$3}), $4); $$ = new AstSelLoopVars($2, $1, $4); }
; ;
// VarRef without any dots or vectorizaion // VarRef without any dots or vectorizaion
@ -5243,7 +5249,7 @@ clocking_declaration<nodep>: // IEEE: clocking_declaration (INCOMPLE
//UNSUPclocking_itemList: // IEEE: [ clocking_item ] //UNSUPclocking_itemList: // IEEE: [ clocking_item ]
//UNSUP clocking_item { $$ = $1; } //UNSUP clocking_item { $$ = $1; }
//UNSUP | clocking_itemList clocking_item { $$ = AstNode::addNextNull($1, $2); } //UNSUP | clocking_itemList clocking_item { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPclocking_item: // ==IEEE: clocking_item //UNSUPclocking_item: // ==IEEE: clocking_item
@ -5548,7 +5554,7 @@ property_spec<nodep>: // IEEE: property_spec
//UNSUPproperty_case_itemList<nodep>: // IEEE: {property_case_item} //UNSUPproperty_case_itemList<nodep>: // IEEE: {property_case_item}
//UNSUP property_case_item { $$ = $1; } //UNSUP property_case_item { $$ = $1; }
//UNSUP | property_case_itemList ',' property_case_item { $$ = AstNode::addNextNull($1, $3); } //UNSUP | property_case_itemList ',' property_case_item { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
//UNSUPproperty_case_item<nodep>: // ==IEEE: property_case_item //UNSUPproperty_case_item<nodep>: // ==IEEE: property_case_item
@ -5805,7 +5811,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPcoverage_spec_or_optionList<nodep>: // IEEE: {coverage_spec_or_option} //UNSUPcoverage_spec_or_optionList<nodep>: // IEEE: {coverage_spec_or_option}
//UNSUP coverage_spec_or_option { $$ = $1; } //UNSUP coverage_spec_or_option { $$ = $1; }
//UNSUP | coverage_spec_or_optionList coverage_spec_or_option { $$ = AstNode::addNextNull($1, $2); } //UNSUP | coverage_spec_or_optionList coverage_spec_or_option { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPcoverage_spec_or_option<nodep>: // ==IEEE: coverage_spec_or_option //UNSUPcoverage_spec_or_option<nodep>: // ==IEEE: coverage_spec_or_option
@ -5846,7 +5852,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPbins_or_optionsList<nodep>: // IEEE: { bins_or_options ';' } //UNSUPbins_or_optionsList<nodep>: // IEEE: { bins_or_options ';' }
//UNSUP bins_or_options ';' { $$ = $1; } //UNSUP bins_or_options ';' { $$ = $1; }
//UNSUP | bins_or_optionsList bins_or_options ';' { $$ = AstNode::addNextNull($1, $2); } //UNSUP | bins_or_optionsList bins_or_options ';' { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPbins_or_options<nodep>: // ==IEEE: bins_or_options //UNSUPbins_or_options<nodep>: // ==IEEE: bins_or_options
@ -5882,7 +5888,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPcovergroup_range_list: // ==IEEE: covergroup_range_list //UNSUPcovergroup_range_list: // ==IEEE: covergroup_range_list
//UNSUP covergroup_value_range { $$ = $1; } //UNSUP covergroup_value_range { $$ = $1; }
//UNSUP | covergroup_range_list ',' covergroup_value_range { $$ = AstNode::addNextNull($1, $3); } //UNSUP | covergroup_range_list ',' covergroup_value_range { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
//UNSUPtrans_list: // ==IEEE: trans_list //UNSUPtrans_list: // ==IEEE: trans_list
@ -5909,7 +5915,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPrepeat_range: // ==IEEE: repeat_range //UNSUPrepeat_range: // ==IEEE: repeat_range
//UNSUP cgexpr { $$ = $1; } //UNSUP cgexpr { $$ = $1; }
//UNSUP | cgexpr ':' cgexpr { $$ = AstNode::addNextNull($1, $3); } //UNSUP | cgexpr ':' cgexpr { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
//UNSUPcover_cross: // ==IEEE: cover_cross //UNSUPcover_cross: // ==IEEE: cover_cross
@ -5918,13 +5924,13 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUP ; //UNSUP ;
//UNSUPlist_of_cross_items<nodep>: // ==IEEE: list_of_cross_items //UNSUPlist_of_cross_items<nodep>: // ==IEEE: list_of_cross_items
//UNSUP cross_item ',' cross_item { $$ = AstNode::addNextNull($1, $3); } //UNSUP cross_item ',' cross_item { $$ = addNextNull($1, $3); }
//UNSUP | cross_item ',' cross_item ',' cross_itemList { } //UNSUP | cross_item ',' cross_item ',' cross_itemList { }
//UNSUP ; //UNSUP ;
//UNSUPcross_itemList<nodep>: // IEEE: part of list_of_cross_items //UNSUPcross_itemList<nodep>: // IEEE: part of list_of_cross_items
//UNSUP cross_item { $$ = nullptr; } //UNSUP cross_item { $$ = nullptr; }
//UNSUP | cross_itemList ',' cross_item { $$ = AstNode::addNextNull($1, $3); } //UNSUP | cross_itemList ',' cross_item { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
//UNSUPcross_item<nodep>: // ==IEEE: cross_item //UNSUPcross_item<nodep>: // ==IEEE: cross_item
@ -5940,7 +5946,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPcross_body_itemSemiList: // IEEE: part of cross_body //UNSUPcross_body_itemSemiList: // IEEE: part of cross_body
//UNSUP cross_body_item ';' { $$ = $1; } //UNSUP cross_body_item ';' { $$ = $1; }
//UNSUP | cross_body_itemSemiList cross_body_item ';' { $$ = AstNode::addNextNull($1, $2); } //UNSUP | cross_body_itemSemiList cross_body_item ';' { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPcross_body_item<nodep>: // ==IEEE: cross_body_item //UNSUPcross_body_item<nodep>: // ==IEEE: cross_body_item
@ -6020,7 +6026,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPproductionList<nodep>: // IEEE: production+ //UNSUPproductionList<nodep>: // IEEE: production+
//UNSUP production { $$ = $1; } //UNSUP production { $$ = $1; }
//UNSUP | productionList production { $$ = AstNode::addNextNull($1, $2); } //UNSUP | productionList production { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPproduction<nodep>: // ==IEEE: production //UNSUPproduction<nodep>: // ==IEEE: production
@ -6036,7 +6042,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPrs_ruleList<nodep>: // IEEE: rs_rule+ part of production //UNSUPrs_ruleList<nodep>: // IEEE: rs_rule+ part of production
//UNSUP rs_rule { $$ = $1; } //UNSUP rs_rule { $$ = $1; }
//UNSUP | rs_ruleList '|' rs_rule { $$ = AstNode::addNextNull($1, $3); } //UNSUP | rs_ruleList '|' rs_rule { $$ = addNextNull($1, $3); }
//UNSUP ; //UNSUP ;
//UNSUPrs_rule<nodep>: // ==IEEE: rs_rule //UNSUPrs_rule<nodep>: // ==IEEE: rs_rule
@ -6064,7 +6070,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPrs_code_blockItemList<nodep>: // IEEE: part of rs_code_block //UNSUPrs_code_blockItemList<nodep>: // IEEE: part of rs_code_block
//UNSUP rs_code_blockItem { $$ = $1; } //UNSUP rs_code_blockItem { $$ = $1; }
//UNSUP | rs_code_blockItemList rs_code_blockItem { $$ = AstNode::addNextNull($1, $2); } //UNSUP | rs_code_blockItemList rs_code_blockItem { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPrs_code_blockItem<nodep>: // IEEE: part of rs_code_block //UNSUPrs_code_blockItem<nodep>: // IEEE: part of rs_code_block
@ -6074,7 +6080,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPrs_prodList<nodep>: // IEEE: rs_prod+ //UNSUPrs_prodList<nodep>: // IEEE: rs_prod+
//UNSUP rs_prod { $$ = $1; } //UNSUP rs_prod { $$ = $1; }
//UNSUP | rs_prodList rs_prod { $$ = AstNode::addNextNull($1, $2); } //UNSUP | rs_prodList rs_prod { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPrs_prod<nodep>: // ==IEEE: rs_prod //UNSUPrs_prod<nodep>: // ==IEEE: rs_prod
@ -6091,7 +6097,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPproduction_itemList<nodep>: // IEEE: production_item+ //UNSUPproduction_itemList<nodep>: // IEEE: production_item+
//UNSUP production_item { $$ = $1; } //UNSUP production_item { $$ = $1; }
//UNSUP | production_itemList production_item { $$ = AstNode::addNextNull($1, $2); } //UNSUP | production_itemList production_item { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPproduction_item<nodep>: // ==IEEE: production_item //UNSUPproduction_item<nodep>: // ==IEEE: production_item
@ -6101,7 +6107,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPrs_case_itemList<nodep>: // IEEE: rs_case_item+ //UNSUPrs_case_itemList<nodep>: // IEEE: rs_case_item+
//UNSUP rs_case_item { $$ = $1; } //UNSUP rs_case_item { $$ = $1; }
//UNSUP | rs_case_itemList rs_case_item { $$ = AstNode::addNextNull($1, $2); } //UNSUP | rs_case_itemList rs_case_item { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPrs_case_item<nodep>: // ==IEEE: rs_case_item //UNSUPrs_case_item<nodep>: // ==IEEE: rs_case_item
@ -6137,7 +6143,7 @@ complex_pexpr<nodep>: // IEEE: part of property_expr, see comments there
//UNSUPchecker_or_generate_itemList<nodep>: // IEEE: { checker_or_generate_itemList } //UNSUPchecker_or_generate_itemList<nodep>: // IEEE: { checker_or_generate_itemList }
//UNSUP checker_or_generate_item { $$ = $1; } //UNSUP checker_or_generate_item { $$ = $1; }
//UNSUP | checker_or_generate_itemList checker_or_generate_item { $$ = AstNode::addNextNull($1, $2); } //UNSUP | checker_or_generate_itemList checker_or_generate_item { $$ = addNextNull($1, $2); }
//UNSUP ; //UNSUP ;
//UNSUPchecker_or_generate_item<nodep>: // ==IEEE: checker_or_generate_item //UNSUPchecker_or_generate_item<nodep>: // ==IEEE: checker_or_generate_item
@ -6256,7 +6262,7 @@ classImplementsE<nodep>: // IEEE: part of class_declaration
classImplementsList<nodep>: // IEEE: part of class_declaration classImplementsList<nodep>: // IEEE: part of class_declaration
// // All 1800-2012 // // All 1800-2012
class_typeExtImpList { $$ = nullptr; BBUNSUP($1, "Unsupported: implements class"); } class_typeExtImpList { $$ = nullptr; BBUNSUP($1, "Unsupported: implements class"); }
| classImplementsList ',' class_typeExtImpList { $$ = AstNode::addNextNull($1, $3); } | classImplementsList ',' class_typeExtImpList { $$ = addNextNull($1, $3); }
; ;
class_typeExtImpList<nodep>: // IEEE: class_type: "[package_scope] id [ parameter_value_assignment ]" class_typeExtImpList<nodep>: // IEEE: class_type: "[package_scope] id [ parameter_value_assignment ]"
@ -6383,7 +6389,7 @@ class_itemListE<nodep>:
class_itemList<nodep>: class_itemList<nodep>:
class_item { $$ = $1; } class_item { $$ = $1; }
| class_itemList class_item { $$ = AstNode::addNextNull($1, $2); } | class_itemList class_item { $$ = addNextNull($1, $2); }
; ;
class_item<nodep>: // ==IEEE: class_item class_item<nodep>: // ==IEEE: class_item
@ -6468,7 +6474,7 @@ constraint_block<nodep>: // ==IEEE: constraint_block
constraint_block_itemList<nodep>: // IEEE: { constraint_block_item } constraint_block_itemList<nodep>: // IEEE: { constraint_block_item }
constraint_block_item { $$ = $1; } constraint_block_item { $$ = $1; }
| constraint_block_itemList constraint_block_item { $$ = AstNode::addNextNull($1, $2); } | constraint_block_itemList constraint_block_item { $$ = addNextNull($1, $2); }
; ;
constraint_block_item<nodep>: // ==IEEE: constraint_block_item constraint_block_item<nodep>: // ==IEEE: constraint_block_item
@ -6479,7 +6485,7 @@ constraint_block_item<nodep>: // ==IEEE: constraint_block_item
solve_before_list<nodep>: // ==IEEE: solve_before_list solve_before_list<nodep>: // ==IEEE: solve_before_list
constraint_primary { $$ = $1; } constraint_primary { $$ = $1; }
| solve_before_list ',' constraint_primary { $$ = AstNode::addNextNull($1, $3); } | solve_before_list ',' constraint_primary { $$ = addNextNull($1, $3); }
; ;
constraint_primary<nodep>: // ==IEEE: constraint_primary constraint_primary<nodep>: // ==IEEE: constraint_primary
@ -6490,7 +6496,7 @@ constraint_primary<nodep>: // ==IEEE: constraint_primary
constraint_expressionList<nodep>: // ==IEEE: { constraint_expression } constraint_expressionList<nodep>: // ==IEEE: { constraint_expression }
constraint_expression { $$ = $1; } constraint_expression { $$ = $1; }
| constraint_expressionList constraint_expression { $$ = AstNode::addNextNull($1, $2); } | constraint_expressionList constraint_expression { $$ = addNextNull($1, $2); }
; ;
constraint_expression<nodep>: // ==IEEE: constraint_expression constraint_expression<nodep>: // ==IEEE: constraint_expression
@ -6518,7 +6524,7 @@ constraint_set<nodep>: // ==IEEE: constraint_set
dist_list<nodep>: // ==IEEE: dist_list dist_list<nodep>: // ==IEEE: dist_list
dist_item { $$ = $1; } dist_item { $$ = $1; }
| dist_list ',' dist_item { $$ = AstNode::addNextNull($1, $3); } | dist_list ',' dist_item { $$ = addNextNull($1, $3); }
; ;
dist_item<nodep>: // ==IEEE: dist_item + dist_weight dist_item<nodep>: // ==IEEE: dist_item + dist_weight