LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
subcommand.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 "pch.h"
23
24namespace lilac
25{
30 {
31 llvm::cl::SubCommand m_SubCommand;
32
33 public:
39 SubCommand(const char* command, const char* desc);
40
45 virtual int Run() = 0;
46
47 virtual ~SubCommand() = default;
48
49 operator llvm::cl::SubCommand&();
50
51 operator bool() const;
52
57 static llvm::cl::OptionCategory& GetCategory();
58 };
59}
An abstraction class of llvm::cl::SubCommand
Definition subcommand.h:30
static llvm::cl::OptionCategory & GetCategory()
Gets default category of all sub-commands registered by LILAC.
virtual ~SubCommand()=default
SubCommand(const char *command, const char *desc)
Creates a sub-command with given name and description.
virtual int Run()=0
Runs a subcommand.