Debian Codegraph @

include/fcml_gas_dialect.hpp

raw
1 /*
2 * FCML - Free Code Manipulation Library.
3 * Copyright (C) 2010-2020 Slawomir Wojtasiak
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 /** @file fcml_gas_dialect.hpp
21 * C++ wrapper for the AT&T dialect.
22 *
23 * @copyright Copyright (C) 2010-2020 Slawomir Wojtasiak. All rights reserved.
24 * This project is released under the GNU Lesser General Public License.
25 */
26
27 #ifndef FCML_GAS_DIALECT_HPP_
28 #define FCML_GAS_DIALECT_HPP_
29
30 #include "fcml_dialect.hpp"
31
32 #include "fcml_gas_dialect.h"
33
34 namespace fcml {
35
36 /** Wraps the AT&T dialect.
37 * @since 1.1.0
38 */
39 class GASDialect: public Dialect {
40 public:
41 /**
42 * Creates AT&T dialect.
43 *
44 * @param flags Optional flags.
45 * @since 1.1.0
46 */
47 GASDialect(fcml_uint32_t flags = FCML_GAS_DIALECT_CF_DEFAULT) {
48 fcml_st_dialect *dialect;
49 fcml_ceh_error error = ::fcml_fn_dialect_init_gas(flags, &dialect);
50 if (error) {
51 throw InitException(
52 FCML_TEXT("Can not initialize the AT&T dialect."), error);
53 }
54 setDialect(dialect);
55 }
56 /**
57 * Virtual destructor.
58 * @since 1.1.0
59 */
60 virtual ~GASDialect() {
61 }
62 };
63
64 }
65
66 #endif /* FCML_GAS_DIALECT_HPP_ */