1
Fork 0
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:
Dan Klishch 2023-08-18 13:12:20 -04:00 committed by Andrew Kaster
parent cd8f4aaa7d
commit 198591cc20
6 changed files with 243 additions and 0 deletions

View file

@ -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;
};
}