ctrump/io/pretty-printer.c File Reference

Cソースプリンタ. More...

#include "ctrump/ast/ast.h"
#include "ctrump/io/pretty-printer.h"
#include "ctrump/common/abort.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "pprint-format.h"
#include <ctype.h>
#include "ctrump/parser/error.h"
#include "ctrump/parser/cfront.h"

Include dependency graph for pretty-printer.c:

Go to the source code of this file.

Data Structures

struct  printer
 プリンタの状態 More...

Defines

#define PRINT_STR_CONST(p, s)   print_str(p, s, sizeof(s)-1)
#define PRINT_STR_CONST_LOC(p, s, l)   goto_loc(p,l); print_str(p, s, sizeof(s)-1)
#define BIN_EXPR_STR(code, str)
#define PRINT_EXPR_STR(code, str)
#define PRINT_EXPR_STR_ENCLOSED_IN_SPACE(code, str)
#define BIN_EXPR_ASSIGN_OP(code, str)
#define BIN_EXPR_LOGICAL_OP(code, str)
#define BIN_EXPR_RELATIONAL_OP(code, str)
#define BIN_EXPR_BITWISE_OP(code, str)
#define BIN_EXPR_MATH_OP(code, str)
#define BIN_EXPR_SHIFT_OP(code, str)
#define UNA_PRE_EXPR_STR(code, str)
#define UNA_POST_EXPR_STR(code, str)
#define DECL_POINTER_PREC   1
#define DECL_QUALIFIY_PREC   1
#define DECL_ARRAY_PREC   2
#define DECL_TYPELIST_PREC   3
#define READ_VAL_FOR_LABEL(label)
#define INIT_LABEL(label)   fmt->label = -1;
#define WRITE_VAL_FOR_LABEL(label)

Functions

static void print_str (struct printer *p, const char *str, int strlen)
 文字列出力
static void print_declspec (struct printer *p, const struct ctrump_decl_specifier *spec)
static void print_declarator (struct printer *p, const struct ctrump_declarator *d)
static void print_initializer_list (struct printer *p, const struct ctrump_initializer_list *il)
static void print_initializer (struct printer *p, const struct ctrump_initializer *i)
static void print_stmt (struct printer *p, const struct ctrump_stmt *stmt)
static void print_decl (struct printer *p, const struct ctrump_decl *def)
static void print_struct_decl (struct printer *p, const struct ctrump_struct_decl *decl)
static void print_typespec (struct printer *p, const struct ctrump_typespec *spec)
static void print_texpr (struct printer *p, const struct ctrump_texpr *texpr, int is_typename)
static void print_enum_list (struct printer *p, const struct ctrump_enum_list *el)
static void print_decl_with_init (struct printer *p, const struct ctrump_decl_with_init *d)
static void buf_reserve (struct printer *p, int len)
 バッファサイズの確保
static void buf_putc (char c, struct printer *p)
 一文字出力
static void print_newline (struct printer *p)
 改行出力
static void print_newline_if_not_use_column (struct printer *p)
static void goto_bol (struct printer *p)
 goto beginning of line
static void goto_loc (struct printer *p, const struct ctrump_location *loc)
 loc の示す位置までカーソルを進める
static void print_sint (struct printer *p, int val)
 整数出力
static void print_source (struct printer *p, const struct ctrump_source_string *source)
 ctrump_source_string出力
static void print_sym (struct printer *p, const struct ctrump_symbol *sym)
 シンボル出力
static void delete_extra_space (struct printer *p)
 最後の空白を削除
static void print_typename (struct printer *p, const struct ctrump_typename *typename)
 typenameを出力
static __attribute__ ((unused))
 for debug(don't remove)
static void indent (struct printer *p)
 インデント
static void dedent (struct printer *p)
 インデントひとつ戻す
static void print_comma (struct printer *p)
 コンマ出力
static void print_space_before_statement_parens (struct printer *p)
static void print_space_before_braces (struct printer *p)
static void print_space_before_brackets (struct printer *p)
static void print_space_around_assignment_op (struct printer *p)
static void print_padding_around_statement_parens (struct printer *p)
static void print_padding_around_braces (struct printer *p)
static void print_padding_around_brackets (struct printer *p)
static void print_statement_lpar_loc (struct printer *p, const struct ctrump_location *loc)
static void print_statement_rpar_loc (struct printer *p, const struct ctrump_location *loc)
static void print_lbracket_loc (struct printer *p, const struct ctrump_location *loc)
static void print_rbracket_loc (struct printer *p, const struct ctrump_location *loc)
static void print_expr (struct printer *p, const struct ctrump_expr *e)
static void print_semicolon (struct printer *p)
static void print_brace_open (struct printer *p)
static void print_brace_close (struct printer *p)
static void print_compound_stmt (struct printer *p, const struct ctrump_compound_stmt *c, char *context)
static void print_ext_fundef (struct printer *p, const struct ctrump_fundef *def)
static void print_qual_flags (struct printer *p, int flags)
static void print_attr (struct printer *p, const struct ctrump_gccext_attribute *attr)
static void print_record (struct printer *p, const struct ctrump_record_definition *def)
static void print_decl_left (struct printer *p, const struct ctrump_declarator_node *n)
static void print_decl_right (struct printer *p, const struct ctrump_declarator_node *n)
static void print_ctrump_designator (struct printer *p, const struct ctrump_designator *d)
static void print_struct_declarator (struct printer *p, const struct ctrump_struct_declarator *declarator)
static void pprint_tree (struct printer *p, const struct ctrump_translation_unit *t)
static void init_printer (struct printer *p, int is_use_column, int print_internal_info, const struct ctrump_translation_unit *t)
static void init_printer_with_format (struct printer *p, int print_internal_info, const struct ctrump_pprint_format *fmt, const struct ctrump_translation_unit *t)
void ctrump_print_translation_unit (char **ret, int *ret_length, int print_internal_info, const struct ctrump_translation_unit *t)
 ctrump_translation_unit を文字列に変換する
void ctrump_print_translation_unit_format (char **ret, int *ret_length, int print_internal_info, const struct ctrump_pprint_format *fmt, const struct ctrump_translation_unit *t)
 フォーマットを指定して ctrump_translation_unit を文字列に変換する
void ctrump_print_stmt (char **ret, int *ret_length, int print_ssa_node, const struct ctrump_stmt *stmt)
 フォーマットを指定して ctrump_stmt を文字列に変換する
void ctrump_print_stmt_format (char **ret, int *ret_length, int print_ssa_node, const struct ctrump_pprint_format *fmt, const struct ctrump_stmt *stmt)
 フォーマットを指定して ctrump_stmt を文字列に変換する
void ctrump_print_expr (char **ret, int *ret_length, int print_ssa_node, const struct ctrump_expr *expr)
 フォーマットを指定して ctrump_expr を文字列に変換する
void ctrump_print_expr_format (char **ret, int *ret_length, int print_ssa_node, const struct ctrump_pprint_format *fmt, const struct ctrump_expr *expr)
 フォーマットを指定して ctrump_expr を文字列に変換する
static struct
ctrump_gccext_attribute 
attr_empty (void)
static void print_texpr_record (struct printer *p, const struct ctrump_record_type *record, int is_typename)
static void print_texpr_spec (struct printer *p, const struct ctrump_texpr *texpr, int flags, struct ctrump_gccext_attribute *attr, int is_typename)
static void print_texpr_abstract_declarator (struct printer *p, const struct ctrump_texpr *texpr, int prec, int flags, struct ctrump_gccext_attribute *attr, int is_typename)
void ctrump_print_texpr_as_typename (char **ret, int *ret_length, const struct ctrump_texpr *texpr)
 型情報をtypenameで表現される文字列に変換する
void ctrump_print_texpr_as_internal (char **ret, int *ret_length, const struct ctrump_texpr *texpr)
 型情報を文字列に変換する
int ctrump_print_expr_stderr (struct ctrump_expr *e, int is_print_internal)
 print expr to stdout (for debug)
int ctrump_print_translation_unit_stderr (struct ctrump_translation_unit *u)
 print translation unit (for debug)
int ctrump_print_texpr_stderr (const struct ctrump_texpr *texpr)
 型情報を文字列に変換してstderrに変換する(for debug)
static int is_empty_line (char *buf)
static int is_slasla_comment_line (char *buf)
static int is_preprocessor_exp_line (char *buf)
static void remove_comment_preprocessor (char *file_in, char *file_out)
void ctrump_format_file2pprint_format (char *file_name, struct ctrump_pprint_format *fmt)
 ファイルから出力フォーマットを読み出す
struct ctrump_pprint_format ctrump_generate_pprint_format (char *file_name)
 ファイルから出力フォーマットを読み出す
static void call_preprocessor (const char *prog_file, const char *cpp_file)
void ctrump_indent (struct ctrump_translation_unit *tree, const struct ctrump_pprint_format *fmt, char *file_tmp)
 treeの中のlocationをfmtによるインデントに設定しなおす
static char * column_begin_with (char *buf, char *key)
static char * column_begin_with_forifwhileswitch (char *buf)
static void set_indentation_size (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_indentation_before_left_brace (FILE *fp, struct ctrump_pprint_format *fmt)
static void ctrump_translation_unit2pprint_format (const struct ctrump_translation_unit *t, struct ctrump_pprint_format *fmt)
static void set_newline_before_left_brace (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_newline_after_right_brace (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_space_before_statement_parens (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_space_before_braces (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_space_before_brackets (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_space_after_comma (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_space_after_semicolon (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_space_after_type_cast (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_space_after_negation (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_spaces_around_op (FILE *fp, struct ctrump_pprint_format *fmt)
static void set_padding_around_parens (FILE *fp, struct ctrump_pprint_format *fmt)
static void init_pprint_format (struct ctrump_pprint_format *fmt)
void ctrump_prog_file2pprint_format (char *prog_file, struct ctrump_pprint_format *fmt)
 Cソースからフォーマットを推測する.
void ctrump_pprint_format2format_file (const struct ctrump_pprint_format *fmt, char *fname)
 フォーマットをファイルに保存する
void ctrump_prog_file2format_file (char *prog_fname, char *format_fname)
 Cソースからフォーマットを推測してファイルに保存する.


Detailed Description

Cソースプリンタ.

かなり context-sensitive な処理がありますが、 仕方ないので、状態を追加したり更新したりを恐れないで改変していってください!!

Definition in file pretty-printer.c.


Define Documentation

#define BIN_EXPR_ASSIGN_OP ( code,
str   ) 

Value:

case code:                                                         \
        if (!p->use_column && p->fmt->spaces_around_assignment_op) {   \
            PRINT_EXPR_STR_ENCLOSED_IN_SPACE(code,str);                \
        } else {                                                       \
            PRINT_EXPR_STR(code,str);                                  \
        }                                                              \
        break

Referenced by print_expr().

#define BIN_EXPR_BITWISE_OP ( code,
str   ) 

Value:

case code:                                                         \
        if (!p->use_column && p->fmt->spaces_around_bitwise_op) {      \
            PRINT_EXPR_STR_ENCLOSED_IN_SPACE(code,str);                \
        } else {                                                       \
            PRINT_EXPR_STR(code,str);                                  \
        }                                                              \
        break

Referenced by print_expr().

#define BIN_EXPR_LOGICAL_OP ( code,
str   ) 

Value:

case code:                                                         \
        if (!p->use_column && p->fmt->spaces_around_logical_op) {      \
            PRINT_EXPR_STR_ENCLOSED_IN_SPACE(code,str);                \
        } else {                                                       \
            PRINT_EXPR_STR(code,str);                                  \
        }                                                              \
        break

Referenced by print_expr().

#define BIN_EXPR_MATH_OP ( code,
str   ) 

Value:

case code:                                                         \
        if (!p->use_column && p->fmt->spaces_around_math_op) {         \
            PRINT_EXPR_STR_ENCLOSED_IN_SPACE(code,str);                \
        } else {                                                       \
            PRINT_EXPR_STR(code,str);                                  \
        }                                                              \
        break

Referenced by print_expr().

#define BIN_EXPR_RELATIONAL_OP ( code,
str   ) 

Value:

case code:                                                         \
        if (!p->use_column && p->fmt->spaces_around_relational_op) {   \
            PRINT_EXPR_STR_ENCLOSED_IN_SPACE(code,str);                \
        } else {                                                       \
            PRINT_EXPR_STR(code,str);                                  \
        }                                                              \
        break

Referenced by print_expr().

#define BIN_EXPR_SHIFT_OP ( code,
str   ) 

Value:

case code:                                                         \
        if (!p->use_column && p->fmt->spaces_around_shift_op) {        \
            PRINT_EXPR_STR_ENCLOSED_IN_SPACE(code,str);                \
        } else {                                                       \
            PRINT_EXPR_STR(code,str);                                  \
        }                                                              \
        break

Referenced by print_expr().

#define BIN_EXPR_STR ( code,
str   ) 

Value:

case code:                                  \
        print_expr(p, e->u.binary.lhs);         \
        goto_loc(p, &e->u.binary.op_loc);       \
        PRINT_STR_CONST(p, str);                \
        print_expr(p, e->u.binary.rhs);         \
        break

Referenced by print_expr().

#define DECL_ARRAY_PREC   2

Definition at line 1401 of file pretty-printer.c.

Referenced by print_texpr_abstract_declarator().

#define DECL_POINTER_PREC   1

Definition at line 1399 of file pretty-printer.c.

Referenced by print_texpr_abstract_declarator().

#define DECL_QUALIFIY_PREC   1

Definition at line 1400 of file pretty-printer.c.

#define DECL_TYPELIST_PREC   3

Definition at line 1402 of file pretty-printer.c.

Referenced by print_texpr_abstract_declarator().

#define INIT_LABEL ( label   )     fmt->label = -1;

Referenced by init_pprint_format().

#define PRINT_EXPR_STR ( code,
str   ) 

Value:

print_expr(p, e->u.binary.lhs);                   \
        goto_loc(p, &e->u.binary.op_loc);                 \
        PRINT_STR_CONST(p, str);                          \
        print_expr(p, e->u.binary.rhs);

#define PRINT_EXPR_STR_ENCLOSED_IN_SPACE ( code,
str   ) 

Value:

print_expr(p, e->u.binary.lhs);                   \
        PRINT_STR_CONST(p, " ");                          \
        goto_loc(p, &e->u.binary.op_loc);                 \
        PRINT_STR_CONST(p, str);                          \
        PRINT_STR_CONST(p, " ");                          \
        print_expr(p, e->u.binary.rhs);

#define PRINT_STR_CONST ( p,
 )     print_str(p, s, sizeof(s)-1)

#define PRINT_STR_CONST_LOC ( p,
s,
 )     goto_loc(p,l); print_str(p, s, sizeof(s)-1)

#define READ_VAL_FOR_LABEL ( label   ) 

Value:

if (strcmp(fmt_in, #label) == 0) {         \
            fmt->label = val;                      \
        } else

Referenced by ctrump_format_file2pprint_format().

#define UNA_POST_EXPR_STR ( code,
str   ) 

Value:

case code:                                            \
        print_expr(p, e->u.unary.expr);                   \
        PRINT_STR_CONST_LOC(p, str, &e->u.unary.op_loc);  \
        break;

Referenced by print_expr().

#define UNA_PRE_EXPR_STR ( code,
str   ) 

Value:

case code:                                            \
        PRINT_STR_CONST_LOC(p, str, &e->u.unary.op_loc);  \
        print_expr(p, e->u.unary.expr);                   \
        break;

Referenced by print_expr().

#define WRITE_VAL_FOR_LABEL ( label   ) 

Value:

if (fmt->label != -1) {                           \
        fprintf(fp, "%-40s%d\n", #label, fmt->label); \
    }

Referenced by ctrump_pprint_format2format_file().


Function Documentation

static __attribute__ ( (unused)   )  [static]

for debug(don't remove)

Definition at line 298 of file pretty-printer.c.

Referenced by ctrump_spe_fini(), and main().

static struct ctrump_gccext_attribute attr_empty ( void   )  [static, read]

static void buf_putc ( char  c,
struct printer p 
) [static]

一文字出力

Definition at line 119 of file pretty-printer.c.

References buf_reserve(), printer::buffer, and printer::content_len.

Referenced by goto_loc(), print_newline(), and print_str().

static void buf_reserve ( struct printer p,
int  len 
) [static]

バッファサイズの確保

Definition at line 106 of file pretty-printer.c.

References printer::buf_len, and printer::buffer.

Referenced by buf_putc().

static void call_preprocessor ( const char *  prog_file,
const char *  cpp_file 
) [static]

Definition at line 2539 of file pretty-printer.c.

Referenced by ctrump_indent(), and ctrump_prog_file2pprint_format().

static char* column_begin_with ( char *  buf,
char *  key 
) [static]

static char* column_begin_with_forifwhileswitch ( char *  buf  )  [static]

void ctrump_format_file2pprint_format ( char *  file_name,
struct ctrump_pprint_format fmt 
)

ファイルから出力フォーマットを読み出す

Parameters:
file_name パス文字列 : NULLだとデフォルト値
fmt フォーマット

Definition at line 2442 of file pretty-printer.c.

References is_empty_line(), is_slasla_comment_line(), and READ_VAL_FOR_LABEL.

Referenced by ctrump_generate_pprint_format().

struct ctrump_pprint_format ctrump_generate_pprint_format ( char *  file_name  )  [read]

ファイルから出力フォーマットを読み出す

Parameters:
fmt フォーマット

Definition at line 2522 of file pretty-printer.c.

References ctrump_format_file2pprint_format().

Referenced by error_get_error_token(), pprint0(), pprint_expr0(), and pprint_stmt().

void ctrump_indent ( struct ctrump_translation_unit tree,
const struct ctrump_pprint_format fmt,
char *  file_tmp 
)

treeの中のlocationをfmtによるインデントに設定しなおす

Parameters:
tree translation unit
fmt フォーマット
file_tmp 一時ファイル名

Definition at line 2556 of file pretty-printer.c.

References call_preprocessor(), ctrump_loginfo::code, ctrump_fixme, ctrump_get_default_parser_option(), ctrump_mempool_init(), ctrump_parse(), ctrump_ppc32_abi, ctrump_print_translation_unit_format(), and ctrump_type_env_init().

void ctrump_pprint_format2format_file ( const struct ctrump_pprint_format fmt,
char *  fname 
)

フォーマットをファイルに保存する

Parameters:
fmt フォーマット
file_name 出力するパス文字列

Definition at line 3438 of file pretty-printer.c.

References WRITE_VAL_FOR_LABEL.

Referenced by ctrump_prog_file2format_file().

void ctrump_print_expr ( char **  ret,
int *  ret_length,
int  print_ssa_node,
const struct ctrump_expr expr 
)

フォーマットを指定して ctrump_expr を文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
print_ssa_node 内部情報を出力するかどうか
expr 出力するツリー
Note:
return value should free()

Definition at line 1966 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer(), print_expr(), and PRINT_STR_CONST.

Referenced by ctrump_print_expr_stderr().

void ctrump_print_expr_format ( char **  ret,
int *  ret_length,
int  print_ssa_node,
const struct ctrump_pprint_format fmt,
const struct ctrump_expr expr 
)

フォーマットを指定して ctrump_expr を文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
print_ssa_node 内部情報を出力するかどうか
fmt フォーマット
expr 出力するツリー
Note:
return value should free()

Definition at line 1982 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer_with_format(), print_expr(), and PRINT_STR_CONST.

Referenced by pprint_expr0().

int ctrump_print_expr_stderr ( struct ctrump_expr e,
int  is_print_internal 
)

print expr to stdout (for debug)

Definition at line 2260 of file pretty-printer.c.

References ctrump_print_expr().

void ctrump_print_stmt ( char **  ret,
int *  ret_length,
int  print_ssa_node,
const struct ctrump_stmt stmt 
)

フォーマットを指定して ctrump_stmt を文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
print_ssa_node 内部情報を出力するかどうか
stmt 出力するツリー
Note:
return value should free()

Definition at line 1934 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer(), print_stmt(), and PRINT_STR_CONST.

void ctrump_print_stmt_format ( char **  ret,
int *  ret_length,
int  print_ssa_node,
const struct ctrump_pprint_format fmt,
const struct ctrump_stmt stmt 
)

フォーマットを指定して ctrump_stmt を文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
print_ssa_node 内部情報を出力するかどうか
fmt フォーマット
stmt 出力するツリー
Note:
return value should free()

Definition at line 1949 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer_with_format(), print_stmt(), and PRINT_STR_CONST.

Referenced by error_get_error_token(), and pprint_stmt().

void ctrump_print_texpr_as_internal ( char **  ret,
int *  ret_length,
const struct ctrump_texpr texpr 
)

型情報を文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
texpr 出力するツリー
Note:
return value should free()

Definition at line 2245 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer(), PRINT_STR_CONST, and print_texpr().

Referenced by ctrump_print_texpr_stderr(), and texpr_str().

void ctrump_print_texpr_as_typename ( char **  ret,
int *  ret_length,
const struct ctrump_texpr texpr 
)

型情報をtypenameで表現される文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
texpr 出力するツリー
Note:
return value should free()

Definition at line 2230 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer(), PRINT_STR_CONST, and print_texpr().

int ctrump_print_texpr_stderr ( const struct ctrump_texpr texpr  ) 

型情報を文字列に変換してstderrに変換する(for debug)

Parameters:
texpr 出力するツリー

Definition at line 2294 of file pretty-printer.c.

References ctrump_print_texpr_as_internal().

void ctrump_print_translation_unit ( char **  ret,
int *  ret_length,
int  print_ssa_node,
const struct ctrump_translation_unit trans_unit 
)

ctrump_translation_unit を文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
print_ssa_node 内部情報を出力するかどうか
trans_unit 出力するツリー
Note:
return value should free()

Definition at line 1901 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer(), pprint_tree(), and PRINT_STR_CONST.

Referenced by ctrump_print_translation_unit_stderr().

void ctrump_print_translation_unit_format ( char **  ret,
int *  ret_length,
int  print_ssa_node,
const struct ctrump_pprint_format fmt,
const struct ctrump_translation_unit trans_unit 
)

フォーマットを指定して ctrump_translation_unit を文字列に変換する

Parameters:
ret 文字列を入れるポインタ 使用後はfree()すること ''終端される
ret_length ''を含まない ret の長さ
print_ssa_node 内部情報を出力するかどうか
fmt フォーマット
trans_unit 出力するツリー
Note:
return value should free()

Definition at line 1917 of file pretty-printer.c.

References printer::buffer, printer::content_len, init_printer_with_format(), pprint_tree(), and PRINT_STR_CONST.

Referenced by ctrump_indent(), and pprint0().

int ctrump_print_translation_unit_stderr ( struct ctrump_translation_unit u  ) 

print translation unit (for debug)

Definition at line 2277 of file pretty-printer.c.

References ctrump_print_translation_unit().

void ctrump_prog_file2format_file ( char *  prog_fname,
char *  format_fname 
)

Cソースからフォーマットを推測してファイルに保存する.

Parameters:
prog_fname Cソースのパス文字列
format_fname フォーマットパス文字列

Definition at line 3480 of file pretty-printer.c.

References ctrump_pprint_format2format_file(), and ctrump_prog_file2pprint_format().

void ctrump_prog_file2pprint_format ( char *  file_name,
struct ctrump_pprint_format fmt 
)

static void ctrump_translation_unit2pprint_format ( const struct ctrump_translation_unit t,
struct ctrump_pprint_format fmt 
) [static]

static void dedent ( struct printer p  )  [static]

static void delete_extra_space ( struct printer p  )  [static]

最後の空白を削除

Definition at line 260 of file pretty-printer.c.

References printer::buffer, printer::content_len, and printer::cur_column.

Referenced by print_decl_right(), and print_typename().

static void goto_bol ( struct printer p  )  [static]

goto beginning of line

Definition at line 154 of file pretty-printer.c.

References printer::line_begin, and print_newline().

Referenced by pprint_tree().

static void goto_loc ( struct printer p,
const struct ctrump_location loc 
) [static]

static void indent ( struct printer p  )  [static]

static void init_pprint_format ( struct ctrump_pprint_format fmt  )  [static]

Definition at line 3321 of file pretty-printer.c.

References INIT_LABEL.

Referenced by ctrump_prog_file2pprint_format().

static void init_printer ( struct printer p,
int  is_use_column,
int  print_internal_info,
const struct ctrump_translation_unit t 
) [static]

static void init_printer_with_format ( struct printer p,
int  print_internal_info,
const struct ctrump_pprint_format fmt,
const struct ctrump_translation_unit t 
) [static]

static int is_empty_line ( char *  buf  )  [static]

Definition at line 2353 of file pretty-printer.c.

Referenced by ctrump_format_file2pprint_format().

static int is_preprocessor_exp_line ( char *  buf  )  [static]

Definition at line 2373 of file pretty-printer.c.

Referenced by remove_comment_preprocessor().

static int is_slasla_comment_line ( char *  buf  )  [static]

static void pprint_tree ( struct printer p,
const struct ctrump_translation_unit t 
) [static]

static void print_attr ( struct printer p,
const struct ctrump_gccext_attribute attr 
) [static]

static void print_brace_close ( struct printer p  )  [static]

static void print_brace_open ( struct printer p  )  [static]

static void print_comma ( struct printer p  )  [static]

static void print_compound_stmt ( struct printer p,
const struct ctrump_compound_stmt c,
char *  context 
) [static]

static void print_ctrump_designator ( struct printer p,
const struct ctrump_designator d 
) [static]

static void print_decl ( struct printer p,
const struct ctrump_decl def 
) [static]

static void print_decl_left ( struct printer p,
const struct ctrump_declarator_node n 
) [static]

static void print_decl_right ( struct printer p,
const struct ctrump_declarator_node n 
) [static]

Definition at line 1459 of file pretty-printer.c.

References ctrump_declarator_param_typelist::args, ctrump_declarator_node::array, ctrump_declarator_node::code, ctrump_declarator_idlist_param::comma_loc, CTRUMP_DECLARATOR_ARRAY, CTRUMP_DECLARATOR_EMPTY, CTRUMP_DECLARATOR_IDENTIFIER, CTRUMP_DECLARATOR_INCOMPLETE_ARRAY, CTRUMP_DECLARATOR_PARAM_IDENTIFIER_LIST, CTRUMP_DECLARATOR_PARAM_TYPELIST, CTRUMP_DECLARATOR_PAREN, CTRUMP_DECLARATOR_POINTER, CTRUMP_DECLARATOR_VARLEN_ARRAY, ctrump_unreachable, printer::cur_column, ctrump_declarator_paren::decl, ctrump_declarator_param::decl, ctrump_declarator_param_typelist::decl, ctrump_declarator_incomplete_array::decl, ctrump_declarator_varlen_array::decl, ctrump_declarator_array::decl, ctrump_declarator_pointer::decl, ctrump_declarator_param::decl_spec, delete_extra_space(), printer::fmt, goto_loc(), ctrump_declarator_param_typelist::has_unspecified_arg, ctrump_declarator_idlist_param::id_loc, ctrump_declarator_param_idlist::identifiers, ctrump_declarator_node::incomplete_array, printer::indent, ctrump_declarator_incomplete_array::lbr_loc, ctrump_declarator_varlen_array::lbr_loc, ctrump_declarator_array::lbr_loc, ctrump_declarator_param::left_comma_loc, ctrump_declarator_param_idlist::lpar_loc, ctrump_declarator_param_typelist::lpar_loc, ctrump_declarator_idlist_param::name, ctrump_pprint_format::newline_after_decl_params, ctrump_declarator_param_idlist::num_args, ctrump_declarator_param_typelist::num_args, ctrump_declarator_node::param_id_list, ctrump_declarator_node::param_typelist, ctrump_declarator_node::paren, ctrump_declarator_node::pointer, print_comma(), print_declarator(), print_declspec(), print_expr(), print_lbracket_loc(), print_newline(), print_qual_flags(), print_rbracket_loc(), PRINT_STR_CONST, PRINT_STR_CONST_LOC, print_sym(), ctrump_declarator_incomplete_array::qual_flags, ctrump_declarator_varlen_array::qual_flags, ctrump_declarator_array::qual_flags, ctrump_declarator_incomplete_array::rbr_loc, ctrump_declarator_varlen_array::rbr_loc, ctrump_declarator_array::rbr_loc, ctrump_declarator_param_idlist::rpar_loc, ctrump_declarator_paren::rpar_loc, ctrump_declarator_param_typelist::rpar_loc, ctrump_declarator_array::size, ctrump_declarator_varlen_array::star_loc, ctrump_declarator_node::u, ctrump_declarator_param_typelist::unspec_arg_loc, ctrump_declarator_param_typelist::unspec_comma_loc, printer::use_column, and ctrump_declarator_node::varlen_array.

Referenced by print_declarator().

static void print_decl_with_init ( struct printer p,
const struct ctrump_decl_with_init d 
) [static]

static void print_declarator ( struct printer p,
const struct ctrump_declarator d 
) [static]

static void print_declspec ( struct printer p,
const struct ctrump_decl_specifier spec 
) [static]

static void print_enum_list ( struct printer p,
const struct ctrump_enum_list el 
) [static]

static void print_expr ( struct printer p,
const struct ctrump_expr e 
) [static]

Definition at line 441 of file pretty-printer.c.

References ctrump_call_expr::args, ctrump_expr::arr_ref, ctrump_arr_ref_expr::array, BIN_EXPR_ASSIGN_OP, BIN_EXPR_BITWISE_OP, BIN_EXPR_LOGICAL_OP, BIN_EXPR_MATH_OP, BIN_EXPR_RELATIONAL_OP, BIN_EXPR_SHIFT_OP, BIN_EXPR_STR, ctrump_expr::call, ctrump_expr::cast, ctrump_implicit_cast_expr::cast_to, ctrump_expr::code, ctrump_cond_expr::colon_loc, ctrump_cond_expr::cond, ctrump_expr::cond, CTRUMP_EXPR_ARRREF, CTRUMP_EXPR_BIN_ADD, CTRUMP_EXPR_BIN_ADD_ASSIGN, CTRUMP_EXPR_BIN_ASSIGN, CTRUMP_EXPR_BIN_BAND, CTRUMP_EXPR_BIN_BAND_ASSIGN, CTRUMP_EXPR_BIN_BOR, CTRUMP_EXPR_BIN_BOR_ASSIGN, CTRUMP_EXPR_BIN_BXOR, CTRUMP_EXPR_BIN_BXOR_ASSIGN, CTRUMP_EXPR_BIN_COMMA, CTRUMP_EXPR_BIN_DIV, CTRUMP_EXPR_BIN_DIV_ASSIGN, CTRUMP_EXPR_BIN_EQ, CTRUMP_EXPR_BIN_GE, CTRUMP_EXPR_BIN_GT, CTRUMP_EXPR_BIN_LAND, CTRUMP_EXPR_BIN_LE, CTRUMP_EXPR_BIN_LOR, CTRUMP_EXPR_BIN_LSHIFT, CTRUMP_EXPR_BIN_LSHIFT_ASSIGN, CTRUMP_EXPR_BIN_LT, CTRUMP_EXPR_BIN_MOD, CTRUMP_EXPR_BIN_MOD_ASSIGN, CTRUMP_EXPR_BIN_MUL, CTRUMP_EXPR_BIN_MUL_ASSIGN, CTRUMP_EXPR_BIN_NE, CTRUMP_EXPR_BIN_RSHIFT, CTRUMP_EXPR_BIN_RSHIFT_ASSIGN, CTRUMP_EXPR_BIN_SUB, CTRUMP_EXPR_BIN_SUB_ASSIGN, CTRUMP_EXPR_CALL, CTRUMP_EXPR_CAST, CTRUMP_EXPR_CONDITIONAL, CTRUMP_EXPR_DOUBLE_LITERAL, CTRUMP_EXPR_EMPTY, CTRUMP_EXPR_FLOAT_LITERAL, CTRUMP_EXPR_IMPLICIT_CAST, CTRUMP_EXPR_INITIALIZER, CTRUMP_EXPR_IVTMP, CTRUMP_EXPR_LONG_DOUBLE_LITERAL, CTRUMP_EXPR_MACRO_EXPAND, CTRUMP_EXPR_MEMBER_REF, CTRUMP_EXPR_PAREN, CTRUMP_EXPR_PTR_MEMBER_REF, CTRUMP_EXPR_SINT_LITERAL, CTRUMP_EXPR_SIZEOF_TYPE, CTRUMP_EXPR_SLLONG_LITERAL, CTRUMP_EXPR_SLONG_LITERAL, CTRUMP_EXPR_STR_LITERAL, CTRUMP_EXPR_TEXT, CTRUMP_EXPR_UINT_LITERAL, CTRUMP_EXPR_ULLONG_LITERAL, CTRUMP_EXPR_ULONG_LITERAL, CTRUMP_EXPR_UNA_ADDR, CTRUMP_EXPR_UNA_BCMPL, CTRUMP_EXPR_UNA_LNEG, CTRUMP_EXPR_UNA_NEG, CTRUMP_EXPR_UNA_POS, CTRUMP_EXPR_UNA_POST_DEC, CTRUMP_EXPR_UNA_POST_INC, CTRUMP_EXPR_UNA_PRE_DEC, CTRUMP_EXPR_UNA_PRE_INC, CTRUMP_EXPR_UNA_PTRREF, CTRUMP_EXPR_UNA_SIZEOF, CTRUMP_EXPR_VARREF, ctrump_fixme, ctrump_unreachable, ctrump_expr::double_literal, ctrump_cond_expr::else_, ctrump_macro_expand_expr::expanded, ctrump_implicit_cast_expr::expr, ctrump_cast_expr::expr, ctrump_paren_expr::expr, ctrump_unary_expr::expr, ctrump_expr::float_literal, printer::fmt, ctrump_call_expr::func_expr, goto_loc(), ctrump_pdg_node::id, ctrump_expr::implicit_cast, ctrump_initializer_expr::initializer, ctrump_expr::initializer, ctrump_expr::ivtmp, ctrump_arr_ref_expr::lbr_loc, ctrump_integer_literal::literal, ctrump_float_literal::literal, ctrump_string_literal::literal, ctrump_string_literal_list::literals, ctrump_integer_literal::loc, ctrump_float_literal::loc, ctrump_string_literal::loc, ctrump_varref_expr::loc, ctrump_expr::long_double_literal, ctrump_call_expr::lpar_loc, ctrump_paren_expr::lpar_loc, ctrump_expr::macro_expand, ctrump_member_ref::member_name, ctrump_expr::member_ref, ctrump_var::name, ctrump_call_expr::num_args, ctrump_string_literal_list::num_str_literal, ctrump_member_ref::obj_expr, ctrump_member_ref::op_loc, ctrump_unary_expr::op_loc, ctrump_ivtmp::original_expr, ctrump_expr::paren, ctrump_varref_expr::pdg, print_comma(), print_initializer_list(), printer::print_internal_info, print_lbracket_loc(), print_rbracket_loc(), print_sint(), print_source(), print_str(), PRINT_STR_CONST, PRINT_STR_CONST_LOC, print_sym(), print_texpr(), print_typename(), ctrump_cond_expr::question_loc, ctrump_arr_ref_expr::rbr_loc, ctrump_call_expr::rpar_loc, ctrump_paren_expr::rpar_loc, ctrump_expr::sint_literal, ctrump_sizeof_type::sizeof_id_loc, ctrump_expr::sizeof_type, ctrump_expr::sllong_literal, ctrump_expr::slong_literal, ctrump_pprint_format::space_after_negation, ctrump_pprint_format::space_after_type_cast, ctrump_pprint_format::spaces_around_relational_op, ctrump_expr::str_literal, ctrump_arr_ref_expr::subscript, ctrump_member_ref::symbol_loc, ctrump_expr::text, ctrump_cond_expr::then_, ctrump_initializer_expr::typename_, ctrump_cast_expr::typename_, ctrump_sizeof_type::typename_, ctrump_expr::u, ctrump_expr::uint_literal, ctrump_expr::ullong_literal, ctrump_expr::ulong_literal, UNA_POST_EXPR_STR, UNA_PRE_EXPR_STR, ctrump_expr::unary, printer::use_column, ctrump_varref_expr::var, and ctrump_expr::varref.

Referenced by ctrump_print_expr(), ctrump_print_expr_format(), print_ctrump_designator(), print_decl_right(), print_enum_list(), print_initializer(), print_stmt(), and print_struct_declarator().

static void print_ext_fundef ( struct printer p,
const struct ctrump_fundef def 
) [static]

static void print_initializer ( struct printer p,
const struct ctrump_initializer i 
) [static]

static void print_initializer_list ( struct printer p,
const struct ctrump_initializer_list il 
) [static]

static void print_lbracket_loc ( struct printer p,
const struct ctrump_location loc 
) [static]

static void print_newline ( struct printer p  )  [static]

static void print_newline_if_not_use_column ( struct printer p  )  [static]

static void print_padding_around_braces ( struct printer p  )  [static]

static void print_padding_around_brackets ( struct printer p  )  [static]

static void print_padding_around_statement_parens ( struct printer p  )  [static]

static void print_qual_flags ( struct printer p,
int  flags 
) [static]

static void print_rbracket_loc ( struct printer p,
const struct ctrump_location loc 
) [static]

static void print_record ( struct printer p,
const struct ctrump_record_definition def 
) [static]

static void print_semicolon ( struct printer p  )  [static]

static void print_sint ( struct printer p,
int  val 
) [static]

整数出力

Definition at line 226 of file pretty-printer.c.

References print_str().

Referenced by print_attr(), print_expr(), and print_texpr_abstract_declarator().

static void print_source ( struct printer p,
const struct ctrump_source_string source 
) [static]

ctrump_source_string出力

Definition at line 239 of file pretty-printer.c.

References ctrump_source_string::chars, ctrump_source_string::length, and print_str().

Referenced by pprint_tree(), and print_expr().

static void print_space_around_assignment_op ( struct printer p  )  [static]

static void print_space_before_braces ( struct printer p  )  [static]

static void print_space_before_brackets ( struct printer p  )  [static]

static void print_space_before_statement_parens ( struct printer p  )  [static]

static void print_statement_lpar_loc ( struct printer p,
const struct ctrump_location loc 
) [static]

static void print_statement_rpar_loc ( struct printer p,
const struct ctrump_location loc 
) [static]

Definition at line 408 of file pretty-printer.c.

References goto_loc(), print_padding_around_statement_parens(), and PRINT_STR_CONST.

Referenced by print_stmt().

static void print_stmt ( struct printer p,
const struct ctrump_stmt stmt 
) [static]

Definition at line 880 of file pretty-printer.c.

References ctrump_switch_stmt::body, ctrump_do_while_stmt::body, ctrump_while_stmt::body, ctrump_if_stmt::body, ctrump_for_decl_stmt::body, ctrump_for_stmt::body, ctrump_stmt::break_, ctrump_stmt::case_, ctrump_expr::code, ctrump_stmt::code, ctrump_default_stmt::colon_loc, ctrump_case_stmt::colon_loc, ctrump_labeled_stmt::colon_loc, ctrump_stmt::compound, ctrump_switch_stmt::cond, ctrump_do_while_stmt::cond, ctrump_while_stmt::cond, ctrump_if_else_stmt::cond, ctrump_if_stmt::cond, ctrump_for_decl_stmt::cond, ctrump_for_stmt::cond, ctrump_stmt::continue_, CTRUMP_EXPR_PAREN, ctrump_fixme, CTRUMP_STMT_ASM, CTRUMP_STMT_BREAK, CTRUMP_STMT_CASE, CTRUMP_STMT_COMPOUND, CTRUMP_STMT_CONTINUE, CTRUMP_STMT_DECL, CTRUMP_STMT_DEFAULT, CTRUMP_STMT_DEFINE, CTRUMP_STMT_DO_WHILE, CTRUMP_STMT_EMPTY, CTRUMP_STMT_EXPR, CTRUMP_STMT_FOR, CTRUMP_STMT_FOR_DECL, CTRUMP_STMT_GOTO, CTRUMP_STMT_IF, CTRUMP_STMT_IF_ELSE, CTRUMP_STMT_IFDEF, CTRUMP_STMT_LABELED, CTRUMP_STMT_LIST, CTRUMP_STMT_NEWLINE, CTRUMP_STMT_PRAGMA, CTRUMP_STMT_RETURN, CTRUMP_STMT_RETURN_EXPR, CTRUMP_STMT_SLAAST_COMMENT, CTRUMP_STMT_SLASLA_COMMENT, CTRUMP_STMT_SWITCH, CTRUMP_STMT_UNDEF, CTRUMP_STMT_WHILE, ctrump_unreachable, ctrump_stmt::decl, ctrump_decl::decls, dedent(), ctrump_stmt::default_, ctrump_do_while_stmt::do_loc, ctrump_stmt::do_while, ctrump_if_else_stmt::else_body, ctrump_if_else_stmt::else_loc, ctrump_stmt::empty, ctrump_expr_stmt::expr, ctrump_stmt::expr, printer::fmt, ctrump_stmt::for_, ctrump_stmt::for_decl, ctrump_stmt::goto_, goto_loc(), ctrump_stmt::if_, ctrump_stmt::if_else, indent(), ctrump_for_decl_stmt::init, ctrump_for_stmt::init, ctrump_for_decl_stmt::iter, ctrump_for_stmt::iter, ctrump_break_stmt::kwd_loc, ctrump_continue_stmt::kwd_loc, ctrump_default_stmt::kwd_loc, ctrump_case_stmt::kwd_loc, ctrump_switch_stmt::kwd_loc, ctrump_goto_stmt::kwd_loc, ctrump_while_stmt::kwd_loc, ctrump_return_expr_stmt::kwd_loc, ctrump_return_stmt::kwd_loc, ctrump_if_else_stmt::kwd_loc, ctrump_if_stmt::kwd_loc, ctrump_for_decl_stmt::kwd_loc, ctrump_for_stmt::kwd_loc, ctrump_goto_stmt::label, ctrump_labeled_stmt::label_loc, ctrump_goto_stmt::label_loc, ctrump_labeled_stmt::label_symbol, ctrump_stmt::labeled, ctrump_switch_stmt::lpar_loc, ctrump_do_while_stmt::lpar_loc, ctrump_while_stmt::lpar_loc, ctrump_if_else_stmt::lpar_loc, ctrump_if_stmt::lpar_loc, ctrump_for_decl_stmt::lpar_loc, ctrump_for_stmt::lpar_loc, ctrump_decl::num_decls, ctrump_stmt_list::num_stmt, print_comma(), print_compound_stmt(), print_decl(), print_decl_with_init(), print_declspec(), print_expr(), print_newline(), print_newline_if_not_use_column(), print_semicolon(), print_statement_lpar_loc(), print_statement_rpar_loc(), PRINT_STR_CONST, PRINT_STR_CONST_LOC, print_sym(), ctrump_stmt::ret_expr, ctrump_stmt::return_, ctrump_return_expr_stmt::retval, ctrump_switch_stmt::rpar_loc, ctrump_do_while_stmt::rpar_loc, ctrump_while_stmt::rpar_loc, ctrump_if_else_stmt::rpar_loc, ctrump_if_stmt::rpar_loc, ctrump_for_decl_stmt::rpar_loc, ctrump_for_stmt::rpar_loc, ctrump_break_stmt::semi_loc, ctrump_continue_stmt::semi_loc, ctrump_do_while_stmt::semi_loc, ctrump_return_expr_stmt::semi_loc, ctrump_return_stmt::semi_loc, ctrump_empty_stmt::semi_loc, ctrump_expr_stmt::semi_loc, ctrump_for_decl_stmt::semi_loc, ctrump_decl::semi_loc, ctrump_for_stmt::semi_loc1, ctrump_for_stmt::semi_loc2, ctrump_pprint_format::space_after_semicolon, ctrump_decl::spec, ctrump_default_stmt::stmt, ctrump_case_stmt::stmt, ctrump_labeled_stmt::stmt, ctrump_stmt::stmt_list, ctrump_stmt_list::stmts, ctrump_stmt::switch_, ctrump_if_else_stmt::then_body, ctrump_stmt::u, printer::use_column, ctrump_case_stmt::val, ctrump_stmt::while_, and ctrump_do_while_stmt::while_loc.

Referenced by ctrump_print_stmt(), ctrump_print_stmt_format(), and print_compound_stmt().

static void print_str ( struct printer p,
const char *  str,
int  strlen 
) [static]

static void print_struct_decl ( struct printer p,
const struct ctrump_struct_decl decl 
) [static]

static void print_struct_declarator ( struct printer p,
const struct ctrump_struct_declarator declarator 
) [static]

static void print_sym ( struct printer p,
const struct ctrump_symbol sym 
) [static]

static void print_texpr ( struct printer p,
const struct ctrump_texpr texpr,
int  is_typename 
) [static]

static void print_texpr_abstract_declarator ( struct printer p,
const struct ctrump_texpr texpr,
int  prec,
int  flags,
struct ctrump_gccext_attribute attr,
int  is_typename 
) [static]

static void print_texpr_record ( struct printer p,
const struct ctrump_record_type record,
int  is_typename 
) [static]

static void print_texpr_spec ( struct printer p,
const struct ctrump_texpr texpr,
int  flags,
struct ctrump_gccext_attribute attr,
int  is_typename 
) [static]

static void print_typename ( struct printer p,
const struct ctrump_typename typename 
) [static]

static void print_typespec ( struct printer p,
const struct ctrump_typespec spec 
) [static]

Definition at line 1296 of file pretty-printer.c.

References ctrump_typespec::anon_enum_definition, ctrump_typespec::anon_struct_definition, ctrump_typespec::anon_union_definition, ctrump_texpr::builtin, ctrump_typespec::builtin, ctrump_typespec::code, CTRUMP_TYPESPEC_ANON_ENUM_DEFINITION, CTRUMP_TYPESPEC_ANON_STRUCT_DEFINITION, CTRUMP_TYPESPEC_ANON_UNION_DEFINITION, CTRUMP_TYPESPEC_BUILTIN, CTRUMP_TYPESPEC_ENUM_DEFINITION, CTRUMP_TYPESPEC_ENUM_NAME, CTRUMP_TYPESPEC_STRUCT_DEFINITION, CTRUMP_TYPESPEC_STRUCT_NAME, CTRUMP_TYPESPEC_TYPEDEF_NAME, CTRUMP_TYPESPEC_UNION_DEFINITION, CTRUMP_TYPESPEC_UNION_NAME, CTRUMP_TYPESPEC_UNTYPED_SIGNED_INT, ctrump_unreachable, ctrump_anon_record_definition::def, ctrump_named_record_definition::def, ctrump_typespec::enum_definition, ctrump_typespec::enum_name, goto_loc(), ctrump_anon_enum_definition::kwd_loc, ctrump_named_enum_definition::kwd_loc, ctrump_typespec_enum_name::kwd_loc, ctrump_anon_record_definition::kwd_loc, ctrump_named_record_definition::kwd_loc, ctrump_typespec_record_name::kwd_loc, ctrump_anon_enum_definition::list, ctrump_named_enum_definition::list, ctrump_named_enum_definition::name, ctrump_typespec_enum_name::name, ctrump_named_record_definition::name, ctrump_typespec_record_name::name, ctrump_typespec_typedef_name::name, ctrump_builtin_type::name, ctrump_named_enum_definition::name_loc, ctrump_typespec_enum_name::name_loc, print_enum_list(), print_record(), print_str(), PRINT_STR_CONST, PRINT_STR_CONST_LOC, print_sym(), ctrump_typespec::struct_definition, ctrump_typespec::struct_name, ctrump_typespec_builtin::texpr, ctrump_typespec::typedef_name, ctrump_texpr::u, ctrump_typespec::u, ctrump_typespec::union_definition, and ctrump_typespec::union_name.

Referenced by print_declspec().

static void remove_comment_preprocessor ( char *  file_in,
char *  file_out 
) [static]

static void set_indentation_before_left_brace ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_indentation_size ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

Definition at line 2662 of file pretty-printer.c.

References ctrump_pprint_format::indentation_size.

Referenced by ctrump_prog_file2pprint_format().

static void set_newline_after_right_brace ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_newline_before_left_brace ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_padding_around_parens ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_space_after_comma ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_space_after_negation ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_space_after_semicolon ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_space_after_type_cast ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_space_before_braces ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_space_before_brackets ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_space_before_statement_parens ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]

static void set_spaces_around_op ( FILE *  fp,
struct ctrump_pprint_format fmt 
) [static]


Generated on Tue Mar 31 20:19:25 2009 for ctrump by  doxygen 1.5.6