space_constitution_get.cc
Go to the documentation of this file.
// input space_constitution files:
// idiststream& operator >> (idiststream&, space_constitution&);
//
// author: Pierre.Saramito@imag.fr
//
// date: 19 dec 2011
//
#include "space_constitution_get.icc"
// ================================================================================
// part 1 : read from idiststeam and build as tree_type* result_ptr
// ================================================================================
/* AIX requires this to be the first thing in the file. */
#ifndef __GNUC__
# if _RHEOLEF_HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
# endif
# endif
# endif
#endif
namespace rheolef {
using namespace std;
typedef size_t size_type;
static size_type space_constitution_line_no = 1;
static size_type space_constitution_n_error = 0;
extern int space_constitution_lex();
void space_constitution_error (const char* msg) {
std::string near;
error_macro("space constitution input:" << space_constitution_line_no << ": " << msg);
space_constitution_n_error++;
}
int space_constitution_wrap () { return 1; }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#define YYMALLOC ::malloc
#define YYFREE ::free
#include "space_constitution_yacc.cc"
// avoid re-definition of YY_NULL within flex
#ifdef YY_NULL
#undef YY_NULL
#endif
#include "space_constitution_lex.cc"
#pragma GCC diagnostic pop
static yyFlexLexer input_space_constitution;
int space_constitution_lex() { return input_space_constitution.yylex(); }
// ================================================================================
// part 2 : main call
// ================================================================================
template<class T, class M>
idiststream&
operator>> (idiststream& ids, space_constitution<T,M>& constit)
{
space_constitution_get_pass_1_2 (ids, space_constitution_parse,
input_space_constitution, space_constitution_line_no, space_constitution_n_error);
// convert tree_type result_ptr to space_constitution
const tree_type* ptr = result_ptr;
constit = build_from_tree<T,M> (*ptr);
delete_macro (result_ptr); result_ptr = 0;
return ids;
}
// ----------------------------------------------------------------------------
// instanciation in library
// ----------------------------------------------------------------------------
template idiststream& operator>> (idiststream&, space_constitution<Float,sequential>&);
#ifdef _RHEOLEF_HAVE_MPI
template idiststream& operator>> (idiststream&, space_constitution<Float,distributed>&);
#endif // _RHEOLEF_HAVE_MPI
} // namespace rheolef
space_constitution_get.icc
rheolef::space_constitution_error
void space_constitution_error(const char *msg)
Definition: space_constitution_get.cc:58
rheolef::space_constitution_line_no
static size_type space_constitution_line_no
Definition: space_constitution_get.cc:54
rheolef::result_ptr
static tree_type * result_ptr
Definition: space_constitution_get.icc:100
rheolef::tree_type
Definition: space_constitution_get.icc:67
rheolef::size_type
size_t size_type
Definition: space_constitution_get.cc:52
rheolef::space_constitution_n_error
static size_type space_constitution_n_error
Definition: space_constitution_get.cc:55
rheolef::space_constitution_lex
int space_constitution_lex()
Definition: space_constitution_get.cc:79
rheolef::space_constitution_wrap
int space_constitution_wrap()
Definition: space_constitution_get.cc:63
rheolef::operator>>
std::istream & operator>>(std::istream &is, const catchmark &m)
Definition: catchmark.h:88
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
error_macro
#define error_macro(message)
Definition: dis_macros.h:49
rheolef::input_space_constitution
static yyFlexLexer input_space_constitution
Definition: space_constitution_get.cc:77
rheolef::space_constitution
Definition: space_constitution.h:32