|
#define | version_string "x3.6" |
|
#define | banner "This is CWEAVE (Version "version_string")" |
|
#define | max_refs 10000 |
|
#define | max_toks 10000 |
|
#define | max_texts 2500 |
|
#define | max_scraps 4000 |
|
#define | max_no_of_nodes 300 |
|
#define | line_length 80 |
|
#define | stack_size 400 |
|
#define | sort_stack_size 500 |
|
#define | variant xref_info |
|
#define | max_bytes 50000L \ |
|
#define | max_modules 1000 |
|
#define | max_idents 5000 |
|
#define | max_sections 4000 \ |
|
#define | hash_size 353 |
|
#define | buf_size 200 |
|
#define | longest_name 1000 \ |
|
#define | long_buf_size (buf_size+longest_name) |
|
#define | local static |
|
#define | array_size(a) ((int)(sizeof(a)/sizeof(a[0]))) |
|
#define | false (boolean) 0 |
|
#define | true (boolean) 1 |
|
#define | ctangle 0 |
|
#define | cweave 1 |
|
#define | and_and 04 |
|
#define | lt_lt 020 |
|
#define | gt_gt 021 |
|
#define | plus_plus 013 |
|
#define | minus_minus 01 |
|
#define | minus_gt 031 |
|
#define | not_eq 032 |
|
#define | lt_eq 034 |
|
#define | gt_eq 035 |
|
#define | eq_eq 036 |
|
#define | or_or 037 |
|
#define | find_char() (loc<=limit || get_line()) |
|
#define | id_index(p) ((sixteen_bits)((p)-id_table)) |
|
#define | id_at(i) (&id_table[i]) |
|
#define | mod_index(p) ((sixteen_bits)((p)-mod_table)) |
|
#define | mod_at(i) (&mod_table[i]) |
|
#define | name_begin(p) ((p)->byte_start) |
|
#define | length(p) ((int)(strlen(name_begin(p)))) |
|
#define | name_end(p) (name_begin(p)+length(p)) |
|
#define | complete_name(p) ((p)->byte_start[-1]=='\0') |
|
#define | print_mod(p) printf(": <%s%s>",name_begin(p), complete_name(p) ? "" : "..." ) |
|
#define | spotless 0 |
|
#define | harmless_message 1 |
|
#define | error_message 2 |
|
#define | fatal_message 3 |
|
#define | mark_harmless() if (history==spotless) history=harmless_message; else |
|
#define | mark_error() (history=error_message) |
|
#define | overflow(t) fatal("\n! Sorry, %s capacity exceeded",t) \ |
|
#define | confusion(s) fatal("\n! This can't happen: %s",s) |
|
#define | show_banner flags['b'] |
|
#define | show_happiness flags['h'] |
|
#define | show_progress flags['p'] |
|
#define | show_stats flags['s'] |
|
#define | C_plus_plus flags['+'] |
|
#define | compatibility_mode flags['c'] |
|
#define | update_terminal() fflush(stdout) |
|
#define | new_line() putchar('\n') |
|
#define | term_write(string, leng) printf("%.*s",(int)(leng),string) |
|
#define | reserved(a) (a->ilk>=type_defined) \ |
|
#define | unindexed(a) (a->ilk>=NULL_like) \ |
|
#define | xref equiv_or_xref |
|
#define | next_xref(x) (&xmem[(x)->next]) |
|
#define | xnum(i) (xmem[i].num) |
|
#define | xlink(i) (xmem[i].next) |
|
#define | xref_index(p) ((sixteen_bits)((p)-xmem)) |
|
#define | cite_flag 0x4000 \ |
|
#define | def_flag 0x8000 |
|
#define | num_mask (cite_flag-1) |
|
#define | make_xref(n, i) |
|
#define | no_xref (!flags['x']) |
|
#define | make_xrefs flags['x'] |
|
#define | file_flag (cite_flag-1) \ |
|
#define | tok_mem_end (&tok_mem[max_toks]) |
|
#define | text_mem_end (&text_mem[max_texts]) |
|
#define | text_index(p) ((sixteen_bits)((p)-text_mem)) \ |
|
#define | text_at(i) (&text_mem[i]) |
|
#define | text_begin(p) (*(p)) \ |
|
#define | text_end(p) (*(p+1)) \ |
|
#define | code_of(c) ccode[(unsigned char)(c)] |
|
#define | compress2(char2, code) if (*loc==char2) return ++loc, code |
|
#define | compress3(char2, char3, code) if (*loc==char2 && loc[1]==char3) return loc+=2, code |
|
#define | comp_ass_op2(code) if (*loc=='=' && !compatibility_mode) return ++loc, code |
|
#define | comp_ass_op3(char2, code) if (*loc==char2 && loc[1]=='=' && !compatibility_mode) return loc+=2,code |
|
#define | shift_and_store(ch) (*id_loc++=ch,c=*++loc) |
|
#define | shift() (next_control=get_next()) |
|
#define | typedef_tracking(b) (typedef_master += b ? 5 : -5) |
|
#define | emit_space() out_str ("\\Y"); |
|
#define | scrap_info scrap_union.scrap_field |
|
#define | scrap_info_end (&scrap_info[max_scraps]) |
|
#define | app(a) (*tok_ptr++ = a) |
|
#define | app_tok(a) |
|
#define | app_char_tok(c) app_tok((unsigned char)(c)) |
|
#define | freeze_text() (*++text_ptr = tok_ptr) |
|
#define | pack_scrap(c, m) |
|
#define | id_flag 10240U |
|
#define | res_flag (2*id_flag) |
|
#define | mod_flag (3*id_flag) |
|
#define | text_flag (4*id_flag) |
|
#define | inner_text_flag (5*id_flag) |
|
#define | enter_block(i) save[i].txt=text_ptr, save[i].tok=tok_ptr; |
|
#define | leave_block(i) text_ptr=save[i].txt, tok_ptr=save[i].tok; |
|
#define | check_toks(n) |
|
#define | check_text() |
|
#define | check_scrap() |
|
#define | dangling_tokens() (compatibility_mode && tok_ptr>*text_ptr) |
|
#define | max_category end_expr |
|
#define | min_nonrule_cat lproc |
|
#define | valid_cat(c) ((c)>0 && (c)<min_nonrule_cat) |
|
#define | yes_math 1 |
|
#define | no_math 2 |
|
#define | maybe_math 0 |
|
#define | start_scrap(s, c, m) p=&token_trans[s],p->cat=c, p->mathness=5*(m) |
|
#define | end_scrap p->trans=text_ptr, freeze_text(); |
|
#define | max_lhs_length 4 |
|
#define | trie_root (&trie_node_mem[0]) |
|
#define | successor(q, c) (&trie_node_mem[(q)->next[(c)-1]]) |
|
#define | no_successor(q, c) ((q)->next[(c)-1]==0) |
|
#define | set_successor(q, c, x) ((q)->next[(c)-1]=(sixteen_bits)((x)-trie_node_mem)) |
|
#define | rule_error install_failed=true,print \ |
|
#define | left_math(a) (a->mathness>>2) |
|
#define | right_math(a) (a->mathness&0x3) |
|
#define | set_mode(x) |
|
#define | app_trans(a) app_tok(text_flag+text_index((a)->trans)) |
|
#define | add_trans(a) |
|
#define | math_char(x) ((x)==yes_math ? '+' : (x)==no_math ? '-' : '?') |
|
#define | cwebx 0x0001 |
|
#define | compatibility 0x0002 |
|
#define | only_plus_plus 0x0004 |
|
#define | no_plus_plus 0x0008 |
|
#define | unaligned_braces 0x0050 |
|
#define | aligned_braces 0x0020 |
|
#define | wide_braces 0x0030 |
|
#define | standard_braces 0x0060 |
|
#define | merged_decls 0x0080 |
|
#define | forced_statements 0x0100 |
|
#define | no_forced_statements 0x0600 |
|
#define | all_stats_forced 0x0300 |
|
#define | not_all_stats_forced 0x0400 |
|
#define | cur_tok cur_state.tok_field |
|
#define | cur_end cur_state.end_field |
|
#define | cur_mode cur_state.mode_field |
|
#define | cur_state stack[0] |
|
#define | stack_end (&stack[stack_size]) |
|
#define | pop_level() cur_state = *--stack_ptr |
|
#define | out_id_full(p) out_id_part(name_begin(p),length(p)) |
|
#define | out_line (&out_buf[1]) |
|
#define | out_buf_end (&out_line[line_length]) |
|
#define | tex_putc(c) putc (c, tex_file) |
|
#define | tex_new_line() (putc('\n', tex_file),++out_line_nr) |
|
#define | tex_printf(format) fprintf(tex_file, format) |
|
#define | output_line_empty() (out_ptr==out_line) |
|
#define | out(c) *(out_ptr>=out_buf_end ? (break_out(),out_ptr++) : out_ptr++)=c |
|
#define | triple_file_output flags['t'] |
|
#define | even_out_pages flags['e'] |
|
#define | sort_info scrap_union.id_list_field |
|
#define | sort_info_end (&sort_info[sort_stack_size]) |
|
#define | ilink(p) index_link[id_index(p)] |
|
#define | infinity 255 |
|
#define | report(k, c, m) printf("\t%lu %ss (out of %lu)\n",(unsigned long)(c),k,(unsigned long)(m)) |
|
|
enum | {
normal,
roman,
wildcard,
typewriter,
reference,
header_file_name,
type_defined,
TeX_like,
NULL_like,
const_like,
typedef_like,
and_like,
not_like,
namespace_like,
typename_like
} |
|
enum | {
at_sign_image = UCHAR_MAX+1,
or,
mul_assign,
div_assign,
mod_assign,
plus_assign,
minus_assign,
left_assign,
right_assign,
and_assign,
xor_assign,
or_assign,
sh_sh,
ellipsis,
colon_colon,
start_preproc,
end_preproc,
join,
thin_space,
math_break,
line_break,
big_line_break,
no_line_break,
backup_line,
pseudo_semi,
force_expr_open,
force_expr_close,
include_preproc,
ignore,
constant,
string,
identifier,
xref_roman,
xref_wildcard,
xref_typewriter,
xref_mark,
refer,
TeX_string,
verbatim,
ignored_text,
char_trans,
ASCII_code,
begin_comment,
end_comment,
underline,
format,
definition,
header,
begin_C,
module_name,
new_section
} |
|
enum | {
cancel =UCHAR_MAX+1,
indent,
outdent,
opt,
flush_left,
break_space,
force,
big_force,
backup,
big_backup,
relax,
space =opt,
tilde =flush_left
} |
|
enum | {
unop = 1,
binop,
unorbinop,
select,
question,
lbrace,
rbrace,
lpar,
rpar,
lbrack,
rbrack,
comma,
semi,
colon,
colcol,
magic,
subscript,
struct_head,
short_lbrace,
short_struct_head,
compound_statement,
statement,
function,
function_head,
parameters,
label,
if_head,
if_else_head,
do_head,
mod_scrap,
declarator,
declaration,
expression,
while_like,
do_like,
if_like,
else_like,
extern_like,
throw_like,
try_like,
catch_like,
int_like,
case_like,
sizeof_like,
struct_like,
return_like,
template_like,
langle,
rangle,
templ_params,
lproc,
rproc,
insert,
begin_expr,
end_expr
} |
|
enum | mode { inner,
outer
} |
|
|
boolean | names_match (id_pointer, char *, int, int) |
|
void | init_id_name (id_pointer, int) |
|
void | init_module_name (mod_pointer) |
|
void | phase_one (void) |
|
void | phase_two (void) |
|
void | phase_three (void) |
|
int | scan_comment (int *bal, boolean one_liner) |
|
int | get_next (void) |
|
boolean | push_header_file (boolean suspend) |
|
void | C_xref (boolean) |
|
void | outer_xref (void) |
|
void | mod_check (mod_pointer) |
|
void | do_C (void) |
|
void | outer_read (void) |
|
void | finish_C (void) |
|
void | finish_line (void) |
|
void | out_str (char *) |
|
void | out_sec_nr (int) |
|
xref_pointer | list_refs (xref_pointer, sixteen_bits) |
|
void | footnote (xref_pointer *, sixteen_bits) |
|
void | app_str (char *) |
|
text_pointer | translate (void) |
|
void | make_output (text_pointer, mode) |
|
void | install_rule (reduction *rule) |
|
void | out_identifier (id_pointer) |
|
void | out_keyword (id_pointer) |
|
xref_pointer | out_module_name (mod_pointer) |
|
void | break_out (void) |
|
void | unbucket (eight_bits) |
|
void | list_modules (mod_pointer) |
|
int | main (int argc, char **argv) |
|
void | new_id_xref (id_pointer p) |
|
void | new_mod_xref (mod_pointer p) |
|
void | set_file_flag (mod_pointer p) |
|
void | copy_limbo (void) |
|
int | skip_TeX (void) |
|
int | copy_TeX (void) |
|
void | C_read (boolean inner) |
|
text_pointer | C_translate (void) |
|
trie_node * | get_new_trie_node (void) |
|
reduction * | match (scrap_pointer p) |
|
void | fuse (scrap_pointer s, int n) |
|
void | make_nonreserved (scrap_pointer p) |
|
id_pointer | first_ident (text_pointer p) |
|
void | make_underlined (scrap_pointer p) |
|
void | reduce (reduction *rule) |
|
void | push_level (text_pointer p) |
|
void | out_id_part (char *s, int l) |
|
void | out_index (id_pointer p) |
|
void | flush_buffer (char *b, boolean percent) |
|