Internals: Restore AstNode naming property. #2133.

The intention was that all subclasses of AstNode which are
intermediate must be abstract as well and called AstNode*. This was
violated recently by 28b9db1903. This
patch restores that property by:
- Renaming AstFile to AstNodeFile
- Introducing AstNodeSimpleText as the common base of AstText and
  AstTextBlock, rather than AstTextBlock deriving from AstText.
This commit is contained in:
Geza Lore
2020-01-21 19:54:14 -05:00
committed by Wilson Snyder
parent d76b5b7823
commit 220daa5f33
8 changed files with 49 additions and 28 deletions
+9
View File
@@ -30,6 +30,15 @@ if (! GetOptions(
read_types("$Opt_I[0]/V3Ast.h");
read_types("$Opt_I[0]/V3AstNodes.h");
foreach my $type (sort (keys %Classes)) {
# Chekc all leafs are not AstNode* and non-leave are AstNode*
my @children = children_of($type);
if ($type =~ /^Node/) {
@children || die "Error: Final AstNode subclasses must not be named AstNode*: Ast$type"
} else {
!@children || die "Error: Non-final AstNode subclasses must be named AstNode*: Ast$type"
}
}
read_stages("$Opt_I[0]/Verilator.cpp");
read_refs(glob("$Opt_I[0]/*.y"), glob("$Opt_I[0]/*.h"), glob("$Opt_I[0]/*.cpp"));
if ($opt_report) {