mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
JSSpecCompiler: Add infrastructure to run compiler passes on AST
This commit is contained in:
parent
cd8f4aaa7d
commit
198591cc20
6 changed files with 243 additions and 0 deletions
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Dan Klishch <danilklishch@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/RecursionDecision.h>
|
||||
|
||||
#include "Forward.h"
|
||||
|
||||
namespace JSSpecCompiler {
|
||||
|
||||
class CompilerPass {
|
||||
public:
|
||||
CompilerPass(FunctionRef function)
|
||||
: m_function(function)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~CompilerPass() = default;
|
||||
|
||||
virtual void run() = 0;
|
||||
|
||||
protected:
|
||||
FunctionRef m_function;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue