fcml  1.2.2
fcml_gas_dialect.hpp
Go to the documentation of this file.
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 
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 
39 class GASDialect: public Dialect {
40 public:
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  }
60  virtual ~GASDialect() {
61  }
62 };
63 
64 }
65 
66 #endif /* FCML_GAS_DIALECT_HPP_ */
void setDialect(fcml_st_dialect *dialect)
Sets a new dialect for the wrapper.
Definition: fcml_dialect.hpp:83
AT&T dialect implementation.
virtual ~GASDialect()
Virtual destructor.
Definition: fcml_gas_dialect.hpp:60
#define FCML_TEXT(x)
Used to code literal strings.
Definition: fcml_types.h:61
struct fcml_st_dialect fcml_st_dialect
Assembler dialect.
Definition: fcml_dialect.h:36
Definition: fcml_assembler.hpp:39
GASDialect(fcml_uint32_t flags=FCML_GAS_DIALECT_CF_DEFAULT)
Creates AT&T dialect.
Definition: fcml_gas_dialect.hpp:47
LIB_EXPORT fcml_ceh_error LIB_CALL fcml_fn_dialect_init_gas(fcml_uint32_t config_flags, fcml_st_dialect **dialect)
Initializes AT&T dialect.
C++ wrapper for the base dialect.
#define FCML_GAS_DIALECT_CF_DEFAULT
Default combination of configuration flags.
Definition: fcml_gas_dialect.h:43
Wraps the AT&T dialect.
Definition: fcml_gas_dialect.hpp:39
An abstract dialect.
Definition: fcml_dialect.hpp:41
Component can not be initialized correctly.
Definition: fcml_common.hpp:231
fcml_uint16_t fcml_ceh_error
All error codes should be held in variables of this type.
Definition: fcml_errors.h:156