ARB
Classes | Macros | Typedefs | Enumerations | Functions
arb_proto_2_xsub.cxx File Reference
#include <arbdb.h>
#include <arb_strbuf.h>
#include <BufferedFileReader.h>
#include <string>
#include <vector>
#include <set>
#include <cctype>
#include <unistd.h>
#include <arb_str.h>
#include <arb_diff.h>
Include dependency graph for arb_proto_2_xsub.cxx:

Go to the source code of this file.

Classes

struct  Error
 
class  ProgramError
 
class  InputFileError
 
class  CommentSkippingFileBuffer
 
class  TypeMap
 
class  Type
 
class  Parameter
 
class  Prototype
 
class  Package
 
class  xsubGenerator
 

Macros

#define CHAR_PTR   "char *"
 
#define CONST_CHAR_PTR   "const char *"
 

Typedefs

typedef vector< ParameterArguments
 
typedef Arguments::const_iterator ArgumentIter
 

Enumerations

enum  TypeClass {
  INVALID_TYPE, VOID, SIMPLE_TYPE, CONST_CHAR,
  HEAP_COPY, CONVERSION_FUNCTION, TYPEMAPPED, CANT_HANDLE,
  FORBIDDEN
}
 

Functions

bool is_empty_code (const char *code)
 
bool contains_preprozessorCode (const char *code)
 
bool contains_braces (const char *code)
 
bool is_typedef (const char *code)
 
bool is_forward_decl (const char *code)
 
bool is_prototype (const char *code)
 
void trace_over_braces (const char *code, int &brace_counter)
 
charget_token_and_incr_lineno (const char *&code, const char *separator, size_t *lineno)
 
charget_token (const char *&code, const char *separator)
 
bool is_ID_char (char c)
 
const charnext_closing_paren (const char *code)
 
const charnext_comma_outside_parens (const char *code)
 
bool find_open_close_paren (const char *code, size_t &opening_paren_pos, size_t &closing_paren_pos)
 
string concat_type_and_name (const string &type, const string &name)
 
string type2id (const string &type)
 
string conversion_function_name (const string &fromType, const string &toType)
 
string constCastTo (const string &expr, const string &targetType)
 
void trim (string &text)
 
string prefix_before (const string &name, char separator)
 
void GBS_spaces (GBS_strstruct *out, int space_count)
 
static void print_prototype_parse_error (LineReader &prototype_reader, const char *err, const char *prototype)
 
static void print_xs_default (BufferedFileReader &xs_default, const char *proto_filename, FILE *out)
 
static BufferedFileReadercreateFileBuffer (const char *filename)
 
static BufferedFileReadercreateCommentSkippingFileBuffer (const char *filename)
 
static void loadTypemap (const char *typemap_filename)
 
int ARB_main (int argc, char **argv)
 

Macro Definition Documentation

#define CHAR_PTR   "char *"
#define CONST_CHAR_PTR   "const char *"

Typedef Documentation

typedef vector<Parameter> Arguments

Definition at line 523 of file arb_proto_2_xsub.cxx.

typedef Arguments::const_iterator ArgumentIter

Definition at line 524 of file arb_proto_2_xsub.cxx.

Enumeration Type Documentation

enum TypeClass
Enumerator
INVALID_TYPE 
VOID 
SIMPLE_TYPE 
CONST_CHAR 
HEAP_COPY 
CONVERSION_FUNCTION 
TYPEMAPPED 
CANT_HANDLE 
FORBIDDEN 

Definition at line 270 of file arb_proto_2_xsub.cxx.

Function Documentation

bool is_empty_code ( const char code)
inline

Definition at line 138 of file arb_proto_2_xsub.cxx.

Referenced by is_prototype().

bool contains_preprozessorCode ( const char code)
inline

Definition at line 139 of file arb_proto_2_xsub.cxx.

Referenced by is_prototype().

bool contains_braces ( const char code)
inline

Definition at line 140 of file arb_proto_2_xsub.cxx.

Referenced by is_prototype().

bool is_typedef ( const char code)
inline

Definition at line 141 of file arb_proto_2_xsub.cxx.

References ARB_strBeginsWith().

Referenced by is_prototype().

bool is_forward_decl ( const char code)
inline

Definition at line 142 of file arb_proto_2_xsub.cxx.

References ARB_strBeginsWith().

Referenced by is_prototype().

bool is_prototype ( const char code)
inline
void trace_over_braces ( const char code,
int brace_counter 
)
inline

Definition at line 153 of file arb_proto_2_xsub.cxx.

References arb_assert.

Referenced by xsubGenerator::generate_all_xsubs().

char* get_token_and_incr_lineno ( const char *&  code,
const char separator,
size_t *  lineno 
)
inline

Definition at line 171 of file arb_proto_2_xsub.cxx.

References ARB_strdup(), ARB_strpartdup(), and NULp.

Referenced by get_token().

char* get_token ( const char *&  code,
const char separator 
)
inline

Definition at line 204 of file arb_proto_2_xsub.cxx.

References get_token_and_incr_lineno(), and NULp.

bool is_ID_char ( char  c)
inline

Definition at line 208 of file arb_proto_2_xsub.cxx.

Referenced by Parameter::Parameter().

const char* next_closing_paren ( const char code)
inline

Definition at line 210 of file arb_proto_2_xsub.cxx.

Referenced by find_open_close_paren(), and next_comma_outside_parens().

const char* next_comma_outside_parens ( const char code)
inline

Definition at line 220 of file arb_proto_2_xsub.cxx.

References next_closing_paren().

bool find_open_close_paren ( const char code,
size_t &  opening_paren_pos,
size_t &  closing_paren_pos 
)
inline

Definition at line 233 of file arb_proto_2_xsub.cxx.

References next_closing_paren().

Referenced by Prototype::Prototype().

string concat_type_and_name ( const string type,
const string name 
)
inline

Definition at line 246 of file arb_proto_2_xsub.cxx.

Referenced by Parameter::c_typed_param(), and Parameter::perl_typed_param().

string type2id ( const string type)
inline

Definition at line 303 of file arb_proto_2_xsub.cxx.

References GBS_string_eval(), id, and s.

Referenced by conversion_function_name().

string conversion_function_name ( const string fromType,
const string toType 
)
inline

Definition at line 313 of file arb_proto_2_xsub.cxx.

References string(), and type2id().

string constCastTo ( const string expr,
const string targetType 
)
inline

Definition at line 318 of file arb_proto_2_xsub.cxx.

References string().

Referenced by Type::convert_argument_for_C(), and Type::convert_result_for_PERL().

void trim ( string text)
inline

Definition at line 621 of file arb_proto_2_xsub.cxx.

Referenced by TypeMap::load().

string prefix_before ( const string name,
char  separator 
)
inline

Definition at line 733 of file arb_proto_2_xsub.cxx.

void GBS_spaces ( GBS_strstruct out,
int  space_count 
)
inline

Definition at line 741 of file arb_proto_2_xsub.cxx.

References arb_assert, and GBS_strncat().

static void print_prototype_parse_error ( LineReader prototype_reader,
const char err,
const char prototype 
)
static
static void print_xs_default ( BufferedFileReader xs_default,
const char proto_filename,
FILE *  out 
)
static
static BufferedFileReader* createFileBuffer ( const char filename)
static

Definition at line 904 of file arb_proto_2_xsub.cxx.

References GB_await_error(), and GB_export_IO_error().

Referenced by ARB_main(), and loadTypemap().

static BufferedFileReader* createCommentSkippingFileBuffer ( const char filename)
static

Definition at line 912 of file arb_proto_2_xsub.cxx.

References GB_await_error(), and GB_export_IO_error().

Referenced by ARB_main().

static void loadTypemap ( const char typemap_filename)
static

Definition at line 923 of file arb_proto_2_xsub.cxx.

References createFileBuffer(), and TypeMap::load().

Referenced by ARB_main().

int ARB_main ( int  argc,
char **  argv 
)