LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
frontend.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Yeong-won Seo
3 *
4 * This file is part of LILAC.
5 *
6 * LILAC is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3, or (at your option) any later
9 * version.
10 *
11 * LILAC is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <string>
23#include <vector>
24
25namespace lilac::shared
26{
28 {
29 F_CXX
30 };
31
36 {
37 const std::string m_Name;
38 const std::string m_Desc;
39 FrontendKind m_Kind;
40
41 public:
42 FrontendAction(FrontendKind kind, std::string name, std::string desc);
43
44 virtual ~FrontendAction() = default;
45
50 [[nodiscard]]
51 const std::string& Name() const;
52
57 [[nodiscard]]
58 const std::string& Desc() const;
59
64 [[nodiscard]]
65 FrontendKind Kind() const;
66
73 [[nodiscard]]
74 virtual int Run(
75 std::string output,
76 std::vector<std::string> argv) const = 0;
77
82 static const std::vector<FrontendAction*>& GetRegistered();
83 };
84}
An action that generates interface representation from codes.
Definition frontend.h:36
FrontendKind Kind() const
Gets the kind of this action.
Definition frontend.cxx:41
const std::string & Name() const
Gets the name of this action.
Definition frontend.cxx:31
FrontendAction(FrontendKind kind, std::string name, std::string desc)
Definition frontend.cxx:25
static const std::vector< FrontendAction * > & GetRegistered()
Gets all registered actions.
Definition frontend.cxx:46
virtual ~FrontendAction()=default
virtual int Run(std::string output, std::vector< std::string > argv) const =0
const std::string & Desc() const
Gets the description of this action.
Definition frontend.cxx:36