#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"
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ソースからフォーマットを推測してファイルに保存する. |
かなり context-sensitive な処理がありますが、 仕方ないので、状態を追加したり更新したりを恐れないで改変していってください!!
Definition in file pretty-printer.c.
#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 |
#define DECL_POINTER_PREC 1 |
#define DECL_QUALIFIY_PREC 1 |
Definition at line 1400 of file pretty-printer.c.
#define DECL_TYPELIST_PREC 3 |
#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, | |||
s | ) | print_str(p, s, sizeof(s)-1) |
Definition at line 47 of file pretty-printer.c.
Referenced by ctrump_print_expr(), ctrump_print_expr_format(), ctrump_print_stmt(), ctrump_print_stmt_format(), ctrump_print_texpr_as_internal(), ctrump_print_texpr_as_typename(), ctrump_print_translation_unit(), ctrump_print_translation_unit_format(), pprint_tree(), print_attr(), print_brace_close(), print_brace_open(), print_comma(), print_decl_right(), print_declspec(), print_expr(), print_lbracket_loc(), print_padding_around_braces(), print_padding_around_brackets(), print_padding_around_statement_parens(), print_qual_flags(), print_rbracket_loc(), print_semicolon(), print_space_around_assignment_op(), print_space_before_braces(), print_space_before_brackets(), print_space_before_statement_parens(), print_statement_lpar_loc(), print_statement_rpar_loc(), print_stmt(), print_struct_declarator(), print_texpr_abstract_declarator(), print_texpr_record(), print_texpr_spec(), print_typename(), and print_typespec().
#define PRINT_STR_CONST_LOC | ( | p, | |||
s, | |||||
l | ) | goto_loc(p,l); print_str(p, s, sizeof(s)-1) |
Definition at line 48 of file pretty-printer.c.
Referenced by print_ctrump_designator(), print_decl_left(), print_decl_right(), print_decl_with_init(), print_enum_list(), print_expr(), print_initializer_list(), print_record(), print_stmt(), print_typename(), and print_typespec().
#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().
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] |
Definition at line 1999 of file pretty-printer.c.
References ctrump_gccext_attribute::aligned, CTRUMP_ALIGN_UNSPECIFIED, and ctrump_gccext_attribute::flags.
Referenced by print_texpr(), print_texpr_abstract_declarator(), and print_texpr_spec().
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] |
Definition at line 2622 of file pretty-printer.c.
Referenced by column_begin_with_forifwhileswitch(), set_indentation_before_left_brace(), set_space_after_semicolon(), and set_space_before_statement_parens().
static char* column_begin_with_forifwhileswitch | ( | char * | buf | ) | [static] |
Definition at line 2640 of file pretty-printer.c.
References column_begin_with().
Referenced by set_indentation_before_left_brace(), set_newline_before_left_brace(), set_padding_around_parens(), and set_space_before_braces().
void ctrump_format_file2pprint_format | ( | char * | file_name, | |
struct ctrump_pprint_format * | fmt | |||
) |
ファイルから出力フォーマットを読み出す
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] |
ファイルから出力フォーマットを読み出す
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によるインデントに設定しなおす
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 | |||
) |
フォーマットをファイルに保存する
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 を文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
print_ssa_node | 内部情報を出力するかどうか | |
expr | 出力するツリー |
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 を文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
print_ssa_node | 内部情報を出力するかどうか | |
fmt | フォーマット | |
expr | 出力するツリー |
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 を文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
print_ssa_node | 内部情報を出力するかどうか | |
stmt | 出力するツリー |
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 を文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
print_ssa_node | 内部情報を出力するかどうか | |
fmt | フォーマット | |
stmt | 出力するツリー |
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 | |||
) |
型情報を文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
texpr | 出力するツリー |
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で表現される文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
texpr | 出力するツリー |
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)
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 を文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
print_ssa_node | 内部情報を出力するかどうか | |
trans_unit | 出力するツリー |
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 を文字列に変換する
ret | 文字列を入れるポインタ 使用後はfree()すること ''終端される | |
ret_length | ''を含まない ret の長さ | |
print_ssa_node | 内部情報を出力するかどうか | |
fmt | フォーマット | |
trans_unit | 出力するツリー |
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ソースからフォーマットを推測してファイルに保存する.
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 | |||
) |
Cソースからフォーマットを推測する.
file_name | Cソースのパス文字列 | |
fmt | フォーマット |
Definition at line 3354 of file pretty-printer.c.
References call_preprocessor(), ctrump_get_default_parser_option(), ctrump_mempool_init(), ctrump_parse(), ctrump_ppc32_abi, ctrump_translation_unit2pprint_format(), ctrump_type_env_init(), init_pprint_format(), remove_comment_preprocessor(), set_indentation_before_left_brace(), set_indentation_size(), set_newline_after_right_brace(), set_newline_before_left_brace(), set_padding_around_parens(), set_space_after_comma(), set_space_after_negation(), set_space_after_semicolon(), set_space_after_type_cast(), set_space_before_braces(), set_space_before_brackets(), set_space_before_statement_parens(), and set_spaces_around_op().
Referenced by ctrump_prog_file2format_file().
static void ctrump_translation_unit2pprint_format | ( | const struct ctrump_translation_unit * | t, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2730 of file pretty-printer.c.
References ctrump_declarator_param_typelist::args, ctrump_decl_specifier::begin, ctrump_fundef::body, ctrump_declarator_node::code, CTRUMP_DECLARATOR_PARAM_TYPELIST, CTRUMP_EXT_FUNCTION_DEFINITION, ctrump_fundef::decl, ctrump_declarator_param::decl_spec, ctrump_fundef::decl_spec, ctrump_translation_unit::decls, ctrump_extdecl::func_def, ctrump_declarator_node::identifier, ctrump_compound_stmt::lbr_loc, ctrump_location::lineno, ctrump_declarator_identifier::loc, ctrump_pprint_format::newline_after_decl_params, ctrump_pprint_format::newline_after_declarator, ctrump_pprint_format::newline_after_declspec, ctrump_declarator::nodes, ctrump_declarator_param_typelist::num_args, ctrump_pprint_format::num_blank_lines_after_func, ctrump_translation_unit::num_decl, ctrump_declarator_node::param_typelist, ctrump_compound_stmt::rbr_loc, ctrump_declarator_param_typelist::rpar_loc, ctrump_declarator_node::u, and ctrump_extdecl::u.
Referenced by ctrump_prog_file2pprint_format().
static void dedent | ( | struct printer * | p | ) | [static] |
インデントひとつ戻す
Definition at line 321 of file pretty-printer.c.
References printer::fmt, printer::indent, ctrump_pprint_format::indentation_size, and printer::use_column.
Referenced by print_brace_close(), print_enum_list(), print_ext_fundef(), print_record(), print_stmt(), print_texpr_abstract_declarator(), and print_texpr_record().
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] |
loc の示す位置までカーソルを進める
Definition at line 165 of file pretty-printer.c.
References buf_putc(), ctrump_location::column, printer::cur_column, printer::cur_lineno, ctrump_location::lineno, print_newline(), printer::suspended, and printer::use_column.
Referenced by pprint_tree(), print_compound_stmt(), print_ctrump_designator(), print_decl(), print_decl_left(), print_decl_right(), print_declspec(), print_enum_list(), print_expr(), print_initializer_list(), print_lbracket_loc(), print_rbracket_loc(), print_record(), print_statement_lpar_loc(), print_statement_rpar_loc(), print_stmt(), print_struct_declarator(), and print_typespec().
static void indent | ( | struct printer * | p | ) | [static] |
インデント
Definition at line 310 of file pretty-printer.c.
References printer::fmt, printer::indent, ctrump_pprint_format::indentation_size, and printer::use_column.
Referenced by print_brace_open(), print_enum_list(), print_ext_fundef(), print_record(), print_stmt(), print_texpr_abstract_declarator(), and print_texpr_record().
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] |
Definition at line 1870 of file pretty-printer.c.
References printer::buf_len, printer::buffer, printer::content_len, printer::cur_column, printer::cur_lineno, ctrump_translation_unit::filename, printer::filename, printer::indent, printer::line_begin, printer::max_column, printer::print_internal_info, printer::suspended, and printer::use_column.
Referenced by ctrump_print_expr(), ctrump_print_stmt(), ctrump_print_texpr_as_internal(), ctrump_print_texpr_as_typename(), ctrump_print_translation_unit(), and init_printer_with_format().
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] |
Definition at line 1891 of file pretty-printer.c.
References printer::fmt, and init_printer().
Referenced by ctrump_print_expr_format(), ctrump_print_stmt_format(), and ctrump_print_translation_unit_format().
static int is_empty_line | ( | char * | buf | ) | [static] |
static int is_preprocessor_exp_line | ( | char * | buf | ) | [static] |
static int is_slasla_comment_line | ( | char * | buf | ) | [static] |
Definition at line 2364 of file pretty-printer.c.
Referenced by ctrump_format_file2pprint_format(), and remove_comment_preprocessor().
static void pprint_tree | ( | struct printer * | p, | |
const struct ctrump_translation_unit * | t | |||
) | [static] |
Definition at line 1763 of file pretty-printer.c.
References ctrump_extdecl::code, ctrump_location::column, CTRUMP_EXT_DEFINE, CTRUMP_EXT_EMPTY_DEFINITION, CTRUMP_EXT_FUNCTION_DEFINITION, CTRUMP_EXT_GCC_CPP_NOTE, CTRUMP_EXT_IFDEF_BLOCK, CTRUMP_EXT_INCLUDE, CTRUMP_EXT_INCLUDE_PATH, CTRUMP_EXT_NEWLINE, CTRUMP_EXT_OBJECT_DEFINITION, CTRUMP_EXT_SLAAST_COMMENT, CTRUMP_EXT_SLASLA_COMMENT, CTRUMP_EXT_UNDEF, ctrump_fixme, ctrump_unreachable, ctrump_translation_unit::decls, ctrump_ext_gcc_cpp_note::digits, printer::filename, ctrump_extdecl::gcc_cpp_note, goto_bol(), goto_loc(), ctrump_ext_gcc_cpp_note::line, ctrump_location::lineno, ctrump_extdecl::loc, ctrump_translation_unit::num_decl, ctrump_ext_gcc_cpp_note::num_digit, print_decl(), print_ext_fundef(), print_newline(), print_semicolon(), print_source(), print_str(), PRINT_STR_CONST, ctrump_extdecl::source_text, printer::suspended, and ctrump_extdecl::u.
Referenced by ctrump_print_translation_unit(), and ctrump_print_translation_unit_format().
static void print_attr | ( | struct printer * | p, | |
const struct ctrump_gccext_attribute * | attr | |||
) | [static] |
Definition at line 1259 of file pretty-printer.c.
References ctrump_gccext_attribute::aligned, CTRUMP_ALIGN_UNSPECIFIED, print_sint(), and PRINT_STR_CONST.
Referenced by print_decl_left(), print_declarator(), print_declspec(), print_record(), print_texpr_abstract_declarator(), and print_texpr_spec().
static void print_brace_close | ( | struct printer * | p | ) | [static] |
Definition at line 820 of file pretty-printer.c.
References dedent(), printer::fmt, ctrump_pprint_format::indentation_before_left_brace, PRINT_STR_CONST, and printer::use_column.
Referenced by print_compound_stmt().
static void print_brace_open | ( | struct printer * | p | ) | [static] |
Definition at line 808 of file pretty-printer.c.
References printer::fmt, indent(), ctrump_pprint_format::indentation_before_left_brace, print_newline_if_not_use_column(), PRINT_STR_CONST, and printer::use_column.
Referenced by print_compound_stmt().
static void print_comma | ( | struct printer * | p | ) | [static] |
コンマ出力
Definition at line 332 of file pretty-printer.c.
References printer::fmt, PRINT_STR_CONST, ctrump_pprint_format::space_after_comma, and printer::use_column.
Referenced by print_decl(), print_decl_right(), print_expr(), print_initializer_list(), print_stmt(), and print_struct_decl().
static void print_compound_stmt | ( | struct printer * | p, | |
const struct ctrump_compound_stmt * | c, | |||
char * | context | |||
) | [static] |
Definition at line 831 of file pretty-printer.c.
References printer::fmt, goto_loc(), ctrump_compound_stmt::items, ctrump_compound_stmt::lbr_loc, ctrump_pprint_format::newline_after_declarator, ctrump_pprint_format::newline_after_right_brace, ctrump_pprint_format::newline_before_left_brace, ctrump_compound_stmt::num_item, print_brace_close(), print_brace_open(), print_newline(), print_newline_if_not_use_column(), print_space_before_braces(), print_stmt(), ctrump_compound_stmt::rbr_loc, and printer::use_column.
Referenced by print_ext_fundef(), and print_stmt().
static void print_ctrump_designator | ( | struct printer * | p, | |
const struct ctrump_designator * | d | |||
) | [static] |
Definition at line 1585 of file pretty-printer.c.
References ctrump_designator::code, CTRUMP_DESIGNATOR_IDENT, CTRUMP_DESIGNATOR_INDEX, ctrump_unreachable, ctrump_designator_ident::dot_loc, goto_loc(), ctrump_designator_ident::ident, ctrump_designator::ident, ctrump_designator_index::index, ctrump_designator::index, ctrump_designator_index::lbr_loc, ctrump_designator_ident::name_loc, print_expr(), print_lbracket_loc(), print_rbracket_loc(), PRINT_STR_CONST_LOC, print_sym(), ctrump_designator_index::rbr_loc, and ctrump_designator::u.
Referenced by print_initializer_list().
static void print_decl | ( | struct printer * | p, | |
const struct ctrump_decl * | def | |||
) | [static] |
Definition at line 1696 of file pretty-printer.c.
References ctrump_typespec::code, CTRUMP_TYPESPEC_ANON_ENUM_DEFINITION, CTRUMP_TYPESPEC_ANON_STRUCT_DEFINITION, CTRUMP_TYPESPEC_ANON_UNION_DEFINITION, CTRUMP_TYPESPEC_ENUM_DEFINITION, CTRUMP_TYPESPEC_STRUCT_DEFINITION, CTRUMP_TYPESPEC_UNION_DEFINITION, ctrump_decl::decls, goto_loc(), ctrump_decl::num_decls, print_comma(), print_decl_with_init(), print_declspec(), print_newline_if_not_use_column(), print_semicolon(), ctrump_decl::semi_loc, ctrump_decl::spec, and ctrump_decl_specifier::type_spec.
Referenced by pprint_tree(), print_ext_fundef(), and print_stmt().
static void print_decl_left | ( | struct printer * | p, | |
const struct ctrump_declarator_node * | n | |||
) | [static] |
Definition at line 1405 of file pretty-printer.c.
References ctrump_declarator_node::array, ctrump_declarator_pointer::attr, ctrump_declarator_node::code, 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, ctrump_declarator_param_idlist::decl, ctrump_declarator_paren::decl, ctrump_declarator_param_typelist::decl, ctrump_declarator_incomplete_array::decl, ctrump_declarator_varlen_array::decl, ctrump_declarator_array::decl, ctrump_declarator_pointer::decl, goto_loc(), ctrump_declarator_identifier::identifier, ctrump_declarator_node::identifier, ctrump_declarator_node::incomplete_array, ctrump_declarator_identifier::loc, ctrump_declarator_paren::lpar_loc, ctrump_declarator_node::param_id_list, ctrump_declarator_node::param_typelist, ctrump_declarator_node::paren, ctrump_declarator_node::pointer, print_attr(), print_qual_flags(), PRINT_STR_CONST_LOC, print_sym(), ctrump_declarator_pointer::qual_flags, ctrump_declarator_pointer::star_loc, ctrump_declarator_node::u, and ctrump_declarator_node::varlen_array.
Referenced by print_declarator().
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] |
Definition at line 1675 of file pretty-printer.c.
References ctrump_initializer::code, CTRUMP_INITIALIZER_EMPTY, CTRUMP_INITIALIZER_EXPR, CTRUMP_INITIALIZER_NESTED, ctrump_decl_with_init::decl, ctrump_decl_with_init::eq_loc, ctrump_decl_with_init::initializer, print_declarator(), print_initializer(), print_space_around_assignment_op(), and PRINT_STR_CONST_LOC.
Referenced by print_decl(), and print_stmt().
static void print_declarator | ( | struct printer * | p, | |
const struct ctrump_declarator * | d | |||
) | [static] |
Definition at line 1576 of file pretty-printer.c.
References ctrump_declarator::attr, ctrump_declarator::nodes, print_attr(), print_decl_left(), and print_decl_right().
Referenced by print_decl_right(), print_decl_with_init(), print_ext_fundef(), print_struct_declarator(), and print_typename().
static void print_declspec | ( | struct printer * | p, | |
const struct ctrump_decl_specifier * | spec | |||
) | [static] |
Definition at line 1367 of file pretty-printer.c.
References ctrump_decl_specifier::attr, ctrump_decl_specifier::begin, CTRUMP_FUNC_SPEC_INLINE, CTRUMP_STOR_CLASS_EXTERN, CTRUMP_STOR_CLASS_REGISTER, CTRUMP_STOR_CLASS_STATIC, CTRUMP_STOR_CLASS_TYPEDEF, ctrump_decl_specifier::func_spec, goto_loc(), print_attr(), print_qual_flags(), PRINT_STR_CONST, print_typespec(), ctrump_decl_specifier::qual_flags, ctrump_decl_specifier::stor_class, and ctrump_decl_specifier::type_spec.
Referenced by print_decl(), print_decl_right(), print_ext_fundef(), print_stmt(), print_struct_decl(), and print_typename().
static void print_enum_list | ( | struct printer * | p, | |
const struct ctrump_enum_list * | el | |||
) | [static] |
Definition at line 2311 of file pretty-printer.c.
References ctrump_enum_list::comma_loc, ctrump_enum_list_elem::comma_loc, CTRUMP_ENUM_LIST_HAVE_LAST_COMMA, dedent(), ctrump_enum_list::elems, ctrump_enum_list_elem::eq_loc, ctrump_enum_list::flags, goto_loc(), indent(), ctrump_enum_list::lbr_loc, ctrump_enum_list_elem::name, ctrump_enum_list_elem::name_loc, ctrump_enum_list::num_elem, print_expr(), print_newline_if_not_use_column(), print_space_around_assignment_op(), print_space_before_braces(), PRINT_STR_CONST_LOC, print_sym(), ctrump_enum_list::rbr_loc, and ctrump_enum_list_elem::value.
Referenced by print_typespec().
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] |
Definition at line 1205 of file pretty-printer.c.
References ctrump_fundef::body, ctrump_fundef::decl, ctrump_fundef::decl_spec, dedent(), printer::fmt, indent(), ctrump_pprint_format::newline_after_declspec, ctrump_pprint_format::num_blank_lines_after_func, ctrump_fundef::num_oldstyle_declaration, ctrump_fundef::oldstyle_decl_list, print_compound_stmt(), print_decl(), print_declarator(), print_declspec(), print_newline(), print_newline_if_not_use_column(), and printer::use_column.
Referenced by pprint_tree().
static void print_initializer | ( | struct printer * | p, | |
const struct ctrump_initializer * | i | |||
) | [static] |
Definition at line 1652 of file pretty-printer.c.
References ctrump_initializer::code, CTRUMP_INITIALIZER_EMPTY, CTRUMP_INITIALIZER_EXPR, CTRUMP_INITIALIZER_NESTED, ctrump_unreachable, ctrump_initializer::expr, ctrump_initializer::nest, print_expr(), print_initializer_list(), and ctrump_initializer::u.
Referenced by print_decl_with_init(), and print_initializer_list().
static void print_initializer_list | ( | struct printer * | p, | |
const struct ctrump_initializer_list * | il | |||
) | [static] |
Definition at line 1609 of file pretty-printer.c.
References CTRUMP_INITIALIZER_HAVE_LAST_COMMA, ctrump_initializer_list_elem::designators_list, ctrump_initializer_list::elems, ctrump_initializer_list_elem::eq_loc, goto_loc(), ctrump_initializer_list::hints_for_printer, ctrump_initializer_list_elem::initializer, ctrump_initializer_list::last_comma_loc, ctrump_initializer_list::lbr_loc, ctrump_initializer_list_elem::left_comma_loc, ctrump_initializer_list_elem::num_designator, ctrump_initializer_list::num_elem, print_comma(), print_ctrump_designator(), print_initializer(), print_padding_around_braces(), print_space_around_assignment_op(), print_space_before_braces(), PRINT_STR_CONST_LOC, and ctrump_initializer_list::rbr_loc.
Referenced by print_expr(), and print_initializer().
static void print_lbracket_loc | ( | struct printer * | p, | |
const struct ctrump_location * | loc | |||
) | [static] |
Definition at line 418 of file pretty-printer.c.
References goto_loc(), print_padding_around_brackets(), print_space_before_brackets(), and PRINT_STR_CONST.
Referenced by print_ctrump_designator(), print_decl_right(), and print_expr().
static void print_newline | ( | struct printer * | p | ) | [static] |
改行出力
Definition at line 131 of file pretty-printer.c.
References buf_putc(), printer::cur_column, printer::cur_lineno, printer::line_begin, and printer::suspended.
Referenced by goto_bol(), goto_loc(), pprint_tree(), print_compound_stmt(), print_decl_right(), print_ext_fundef(), print_newline_if_not_use_column(), print_stmt(), print_str(), and print_texpr_record().
static void print_newline_if_not_use_column | ( | struct printer * | p | ) | [static] |
Definition at line 143 of file pretty-printer.c.
References print_newline(), and printer::use_column.
Referenced by print_brace_open(), print_compound_stmt(), print_decl(), print_enum_list(), print_ext_fundef(), print_record(), print_semicolon(), and print_stmt().
static void print_padding_around_braces | ( | struct printer * | p | ) | [static] |
Definition at line 381 of file pretty-printer.c.
References printer::fmt, ctrump_pprint_format::padding_around_braces, PRINT_STR_CONST, and printer::use_column.
Referenced by print_initializer_list().
static void print_padding_around_brackets | ( | struct printer * | p | ) | [static] |
Definition at line 388 of file pretty-printer.c.
References printer::fmt, ctrump_pprint_format::padding_around_brackets, PRINT_STR_CONST, and printer::use_column.
Referenced by print_lbracket_loc(), and print_rbracket_loc().
static void print_padding_around_statement_parens | ( | struct printer * | p | ) | [static] |
Definition at line 373 of file pretty-printer.c.
References printer::fmt, ctrump_pprint_format::padding_around_statement_parens, PRINT_STR_CONST, and printer::use_column.
Referenced by print_statement_lpar_loc(), and print_statement_rpar_loc().
static void print_qual_flags | ( | struct printer * | p, | |
int | flags | |||
) | [static] |
Definition at line 1245 of file pretty-printer.c.
References CTRUMP_QUAL_CONST, CTRUMP_QUAL_RESTRICT, CTRUMP_QUAL_VOLATILE, and PRINT_STR_CONST.
Referenced by print_decl_left(), print_decl_right(), print_declspec(), print_texpr_abstract_declarator(), and print_texpr_spec().
static void print_rbracket_loc | ( | struct printer * | p, | |
const struct ctrump_location * | loc | |||
) | [static] |
Definition at line 430 of file pretty-printer.c.
References goto_loc(), print_padding_around_brackets(), and PRINT_STR_CONST.
Referenced by print_ctrump_designator(), print_decl_right(), and print_expr().
static void print_record | ( | struct printer * | p, | |
const struct ctrump_record_definition * | def | |||
) | [static] |
Definition at line 1270 of file pretty-printer.c.
References ctrump_record_definition::attr, ctrump_record_definition::decls, dedent(), goto_loc(), indent(), ctrump_record_definition::lbr_loc, ctrump_record_definition::num_decl, print_attr(), print_newline_if_not_use_column(), print_semicolon(), print_space_before_braces(), PRINT_STR_CONST_LOC, print_struct_decl(), ctrump_record_definition::rbr_loc, and ctrump_struct_decl::semi_loc.
Referenced by print_typespec().
static void print_semicolon | ( | struct printer * | p | ) | [static] |
Definition at line 801 of file pretty-printer.c.
References print_newline_if_not_use_column(), and PRINT_STR_CONST.
Referenced by pprint_tree(), print_decl(), print_record(), and print_stmt().
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] |
Definition at line 365 of file pretty-printer.c.
References printer::fmt, PRINT_STR_CONST, ctrump_pprint_format::spaces_around_assignment_op, and printer::use_column.
Referenced by print_decl_with_init(), print_enum_list(), and print_initializer_list().
static void print_space_before_braces | ( | struct printer * | p | ) | [static] |
Definition at line 349 of file pretty-printer.c.
References printer::fmt, PRINT_STR_CONST, ctrump_pprint_format::space_before_braces, and printer::use_column.
Referenced by print_compound_stmt(), print_enum_list(), print_initializer_list(), and print_record().
static void print_space_before_brackets | ( | struct printer * | p | ) | [static] |
Definition at line 357 of file pretty-printer.c.
References printer::fmt, PRINT_STR_CONST, ctrump_pprint_format::space_before_brackets, and printer::use_column.
Referenced by print_lbracket_loc().
static void print_space_before_statement_parens | ( | struct printer * | p | ) | [static] |
Definition at line 341 of file pretty-printer.c.
References printer::fmt, PRINT_STR_CONST, ctrump_pprint_format::space_before_statement_parens, and printer::use_column.
Referenced by print_statement_lpar_loc().
static void print_statement_lpar_loc | ( | struct printer * | p, | |
const struct ctrump_location * | loc | |||
) | [static] |
Definition at line 396 of file pretty-printer.c.
References goto_loc(), print_padding_around_statement_parens(), print_space_before_statement_parens(), and PRINT_STR_CONST.
Referenced by print_stmt().
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] |
文字列出力
Definition at line 192 of file pretty-printer.c.
References buf_putc(), printer::cur_column, printer::indent, printer::line_begin, print_newline(), printer::suspended, and printer::use_column.
Referenced by pprint_tree(), print_expr(), print_sint(), print_source(), print_sym(), print_texpr_spec(), and print_typespec().
static void print_struct_decl | ( | struct printer * | p, | |
const struct ctrump_struct_decl * | decl | |||
) | [static] |
Definition at line 1743 of file pretty-printer.c.
References ctrump_struct_decl::code, CTRUMP_STRUCT_DECL_FIELDS, ctrump_struct_decl::decl, ctrump_struct_decl_decl::decls, ctrump_struct_decl_decl::num_decls, print_comma(), print_declspec(), print_struct_declarator(), ctrump_struct_decl_decl::spec, and ctrump_struct_decl::u.
Referenced by print_record().
static void print_struct_declarator | ( | struct printer * | p, | |
const struct ctrump_struct_declarator * | declarator | |||
) | [static] |
Definition at line 1729 of file pretty-printer.c.
References ctrump_struct_declarator::bitfield_expr, ctrump_struct_declarator::colon_loc, ctrump_struct_declarator::decl, goto_loc(), print_declarator(), print_expr(), and PRINT_STR_CONST.
Referenced by print_struct_decl().
static void print_sym | ( | struct printer * | p, | |
const struct ctrump_symbol * | sym | |||
) | [static] |
シンボル出力
Definition at line 250 of file pretty-printer.c.
References print_str(), ctrump_symbol::symlen, and ctrump_symbol::symstr.
Referenced by print_ctrump_designator(), print_decl_left(), print_decl_right(), print_enum_list(), print_expr(), print_stmt(), print_texpr_record(), print_texpr_spec(), and print_typespec().
static void print_texpr | ( | struct printer * | p, | |
const struct ctrump_texpr * | texpr, | |||
int | is_typename | |||
) | [static] |
Definition at line 2218 of file pretty-printer.c.
References attr_empty(), print_texpr_abstract_declarator(), and print_texpr_spec().
Referenced by ctrump_print_texpr_as_internal(), ctrump_print_texpr_as_typename(), print_expr(), print_texpr_abstract_declarator(), and print_texpr_record().
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] |
Definition at line 2118 of file pretty-printer.c.
References ctrump_function_type::arg_num, ctrump_function_type::args, ctrump_texpr::array, ctrump_array_type::array_of, ctrump_qualified_type::attr, attr_empty(), ctrump_texpr::code, ctrump_fixme, ctrump_merge_attr(), CTRUMP_TYPE_ARRAY, CTRUMP_TYPE_BUILTIN, CTRUMP_TYPE_ENUM, CTRUMP_TYPE_FUNC, CTRUMP_TYPE_INCOMPLETE_ARRAY, CTRUMP_TYPE_POINTER, CTRUMP_TYPE_QUALIFIED, CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_TYPEDEF_NAME, CTRUMP_TYPE_UNION, CTRUMP_TYPE_VARLEN_ARRAY, ctrump_unreachable, DECL_ARRAY_PREC, DECL_POINTER_PREC, DECL_TYPELIST_PREC, dedent(), ctrump_texpr::func, ctrump_function_type::has_unspecified_arg, indent(), ctrump_texpr::pointer_to, print_attr(), print_qual_flags(), print_sint(), PRINT_STR_CONST, print_texpr(), ctrump_qualified_type::qual_flags, ctrump_texpr::qualified, ctrump_function_type::ret, ctrump_array_type::size, ctrump_texpr::u, and ctrump_qualified_type::unqualified_type.
Referenced by print_texpr().
static void print_texpr_record | ( | struct printer * | p, | |
const struct ctrump_record_type * | record, | |||
int | is_typename | |||
) | [static] |
Definition at line 2008 of file pretty-printer.c.
References dedent(), ctrump_record_type::fields, indent(), ctrump_record_type::is_completed, ctrump_record_type::name, ctrump_record_type::nfield, print_newline(), PRINT_STR_CONST, print_sym(), print_texpr(), and ctrump_record_type_field::type.
Referenced by print_texpr_spec().
static void print_texpr_spec | ( | struct printer * | p, | |
const struct ctrump_texpr * | texpr, | |||
int | flags, | |||
struct ctrump_gccext_attribute * | attr, | |||
int | is_typename | |||
) | [static] |
Definition at line 2041 of file pretty-printer.c.
References ctrump_texpr::array, ctrump_array_type::array_of, ctrump_qualified_type::attr, attr_empty(), ctrump_texpr::builtin, ctrump_texpr::code, ctrump_fixme, ctrump_merge_attr(), CTRUMP_TYPE_ARRAY, CTRUMP_TYPE_BUILTIN, CTRUMP_TYPE_ENUM, CTRUMP_TYPE_FUNC, CTRUMP_TYPE_INCOMPLETE_ARRAY, CTRUMP_TYPE_POINTER, CTRUMP_TYPE_QUALIFIED, CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_TYPEDEF_NAME, CTRUMP_TYPE_UNION, CTRUMP_TYPE_VARLEN_ARRAY, ctrump_unreachable, ctrump_typedef_name::def_name, ctrump_texpr::func, ctrump_builtin_type::name, ctrump_texpr::pointer_to, print_attr(), print_qual_flags(), print_str(), PRINT_STR_CONST, print_sym(), print_texpr_record(), ctrump_qualified_type::qual_flags, ctrump_texpr::qualified, ctrump_function_type::ret, ctrump_texpr::typedef_name, ctrump_texpr::u, ctrump_texpr::union_, and ctrump_qualified_type::unqualified_type.
Referenced by print_texpr().
static void print_typename | ( | struct printer * | p, | |
const struct ctrump_typename * | typename | |||
) | [static] |
typenameを出力
Definition at line 272 of file pretty-printer.c.
References CTRUMP_DECLARATOR_EMPTY, delete_extra_space(), printer::fmt, ctrump_pprint_format::padding_around_type_cast, print_declarator(), print_declspec(), PRINT_STR_CONST, PRINT_STR_CONST_LOC, and printer::use_column.
Referenced by print_expr().
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] |
Definition at line 2383 of file pretty-printer.c.
References is_preprocessor_exp_line(), and is_slasla_comment_line().
Referenced by ctrump_prog_file2pprint_format().
static void set_indentation_before_left_brace | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2700 of file pretty-printer.c.
References column_begin_with(), column_begin_with_forifwhileswitch(), and ctrump_pprint_format::indentation_before_left_brace.
Referenced by ctrump_prog_file2pprint_format().
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] |
Definition at line 2878 of file pretty-printer.c.
References ctrump_pprint_format::newline_after_right_brace.
Referenced by ctrump_prog_file2pprint_format().
static void set_newline_before_left_brace | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2850 of file pretty-printer.c.
References column_begin_with_forifwhileswitch(), and ctrump_pprint_format::newline_before_left_brace.
Referenced by ctrump_prog_file2pprint_format().
static void set_padding_around_parens | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 3228 of file pretty-printer.c.
References column_begin_with_forifwhileswitch(), ctrump_pprint_format::padding_around_braces, ctrump_pprint_format::padding_around_brackets, ctrump_pprint_format::padding_around_statement_parens, and ctrump_pprint_format::padding_around_type_cast.
Referenced by ctrump_prog_file2pprint_format().
static void set_space_after_comma | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2971 of file pretty-printer.c.
References ctrump_pprint_format::space_after_comma.
Referenced by ctrump_prog_file2pprint_format().
static void set_space_after_negation | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 3058 of file pretty-printer.c.
References ctrump_pprint_format::space_after_negation.
Referenced by ctrump_prog_file2pprint_format().
static void set_space_after_semicolon | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2994 of file pretty-printer.c.
References column_begin_with(), and ctrump_pprint_format::space_after_semicolon.
Referenced by ctrump_prog_file2pprint_format().
static void set_space_after_type_cast | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 3019 of file pretty-printer.c.
References ctrump_pprint_format::space_after_type_cast.
Referenced by ctrump_prog_file2pprint_format().
static void set_space_before_braces | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2932 of file pretty-printer.c.
References column_begin_with_forifwhileswitch(), and ctrump_pprint_format::space_before_braces.
Referenced by ctrump_prog_file2pprint_format().
static void set_space_before_brackets | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2953 of file pretty-printer.c.
References ctrump_pprint_format::space_before_brackets.
Referenced by ctrump_prog_file2pprint_format().
static void set_space_before_statement_parens | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 2907 of file pretty-printer.c.
References column_begin_with(), and ctrump_pprint_format::space_before_statement_parens.
Referenced by ctrump_prog_file2pprint_format().
static void set_spaces_around_op | ( | FILE * | fp, | |
struct ctrump_pprint_format * | fmt | |||
) | [static] |
Definition at line 3082 of file pretty-printer.c.
References ctrump_pprint_format::spaces_around_assignment_op, ctrump_pprint_format::spaces_around_bitwise_op, ctrump_pprint_format::spaces_around_logical_op, ctrump_pprint_format::spaces_around_math_op, ctrump_pprint_format::spaces_around_relational_op, and ctrump_pprint_format::spaces_around_shift_op.
Referenced by ctrump_prog_file2pprint_format().