Internals: separate AST class for program (#2467)

This commit is contained in:
Piotr Binkowski 2020-07-15 13:39:58 +02:00 committed by GitHub
parent d55c233427
commit a02c420064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -48,6 +48,7 @@ Peter Horvath
Peter Monsson
Philipp Wagner
Pieter Kapsenberg
Piotr Binkowski
Qingyao Sun
Richard Myers
Sean Cross

View File

@ -2448,6 +2448,15 @@ public:
virtual string verilogKwd() const { return "module"; }
};
class AstProgram : public AstNodeModule {
// A program declaration
public:
AstProgram(FileLine* fl, const string& name)
: ASTGEN_SUPER(fl, name) {}
ASTNODE_NODE_FUNCS(Program)
virtual string verilogKwd() const { return "program"; }
};
class AstNotFoundModule : public AstNodeModule {
// A missing module declaration
public:

View File

@ -1465,7 +1465,7 @@ program_declaration: // IEEE: program_declaration + program_nonansi_header + pr
pgmFront<modulep>:
yPROGRAM lifetimeE idAny/*new_program*/
{ $$ = new AstModule($<fl>3,*$3);
{ $$ = new AstProgram($<fl>3,*$3);
$$->lifetime($2);
$$->inLibrary(PARSEP->inLibrary() || $$->fileline()->celldefineOn());
$$->modTrace(GRAMMARP->allTracingOn($$->fileline()));