atlas  0.6
Classes | Macros | Typedefs | Enumerations | Functions | Variables
cweave.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include "common.h"
Include dependency graph for cweave.c:

Classes

struct  xref_info
 
struct  scrap
 
struct  reduction
 
struct  trie_node
 
struct  output_stack_element
 
struct  sort_node
 

Macros

#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))
 

Typedefs

typedef struct xref_info xref_info
 
typedef struct xref_infoxref_pointer
 
typedef sixteen_bits token
 
typedef sixteen_bitstoken_pointer
 
typedef sixteen_bits ** text_pointer
 
typedef struct scrapscrap_pointer
 
typedef struct output_stack_elementstack_pointer
 
typedef struct sort_nodesort_pointer
 

Enumerations

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 }
 

Functions

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_nodeget_new_trie_node (void)
 
reductionmatch (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)
 

Variables

xref_info xmem [max_refs]
 
xref_pointer xref_ptr = &xmem[0]
 
sixteen_bits xref_switch = 0
 
sixteen_bits mod_xref_switch = 0
 
token tok_mem [max_toks]
 
token_pointer text_mem [max_texts]
 
token_pointer tok_ptr = tok_mem
 
text_pointer text_ptr = text_mem
 
int ccode [UCHAR_MAX+1]
 
id_pointer cur_id
 
mod_pointer cur_mod
 
int preprocessing =0
 
boolean change_exists =false
 
int next_control
 
local int typedef_master =-5
 
local int brace_level
 
local int par_level
 
union {
   scrap   scrap_field [max_scraps]
 
   sort_node   id_list_field [sort_stack_size]
 
scrap_union
 
scrap_pointer scrap_base =scrap_info
 
scrap_pointer scrap_ptr = scrap_info
 
struct {
   text_pointer   txt
 
   token_pointer   tok
 
save [2]
 
scrap token_trans [ignore]
 
trie_node trie_node_mem [max_no_of_nodes]
 
int node_no = 1
 
sixteen_bits rule_mask
 
scrap_pointer pp
 
scrap_pointer lo_ptr
 
scrap_pointer hi_ptr
 
output_stack_element stack [stack_size]
 
stack_pointer stack_ptr =&stack[0]
 
char out_buf [line_length+1]
 
char * out_ptr
 
int out_line_nr =1
 
sort_pointer sort_ptr =sort_info
 
eight_bits collate [UCHAR_MAX-25]
 
int end_collate
 
id_pointer index_link [max_idents]
 
id_pointer bucket [UCHAR_MAX+1]
 

Macro Definition Documentation

#define add_trans (   a)
Value:
{ scrap_pointer scr=a; /* so that evaluating |a| may have side effects */ \
if (left_math(scr)!=maybe_math) \
{ if (cur_mathness==maybe_math) init_mathness=left_math(scr); \
else if (cur_mathness!=left_math(scr)) app('$'); \
\
cur_mathness=right_math(scr); \
} \
app_trans(scr); \
}
#define left_math(a)
Definition: cweave.c:160
Definition: cweave.c:285
#define right_math(a)
Definition: cweave.c:161
#define maybe_math
Definition: cweave.c:149
#define app_trans(a)
Definition: cweave.c:167
#define app(a)
Definition: cweave.c:121
#define aligned_braces   0x0020
#define all_stats_forced   0x0300
#define and_and   04
#define app (   a)    (*tok_ptr++ = a)
#define app_char_tok (   c)    app_tok((unsigned char)(c))
#define app_tok (   a)
Value:
if (tok_ptr>tok_mem_end-2) overflow("token"); \
else app(a)
#define tok_mem_end
Definition: cweave.c:98
token_pointer tok_ptr
Definition: cweave.c:422
#define overflow(t)
Definition: cweave.c:64
#define app(a)
Definition: cweave.c:121
#define app_trans (   a)    app_tok(text_flag+text_index((a)->trans))
#define array_size (   a)    ((int)(sizeof(a)/sizeof(a[0])))
#define banner   "This is CWEAVE (Version "version_string")"
#define buf_size   200
#define C_plus_plus   flags['+']
#define check_scrap ( )
Value:
overflow("scrap"); else check_text()
scrap_pointer scrap_ptr
Definition: cweave.c:449
#define scrap_info_end
Definition: cweave.c:120
#define overflow(t)
Definition: cweave.c:64
#define check_text()
Definition: cweave.c:139
#define check_text ( )
Value:
overflow("text"); else
text_pointer text_ptr
Definition: cweave.c:423
#define overflow(t)
Definition: cweave.c:64
#define text_mem_end
Definition: cweave.c:99
#define check_toks (   n)
Value:
overflow("token"); else
#define tok_mem_end
Definition: cweave.c:98
token_pointer tok_ptr
Definition: cweave.c:422
#define overflow(t)
Definition: cweave.c:64
unsigned long n
Definition: axis.cpp:77
#define cite_flag   0x4000 \
#define code_of (   c)    ccode[(unsigned char)(c)]
#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 compatibility   0x0002
#define compatibility_mode   flags['c']
#define complete_name (   p)    ((p)->byte_start[-1]=='\0')
#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 confusion (   s)    fatal("\n! This can't happen: %s",s)
#define ctangle   0
#define cur_end   cur_state.end_field
#define cur_mode   cur_state.mode_field
#define cur_state   stack[0]
#define cur_tok   cur_state.tok_field
#define cweave   1
#define cwebx   0x0001
#define dangling_tokens ( )    (compatibility_mode && tok_ptr>*text_ptr)
#define def_flag   0x8000
#define emit_space ( )    out_str ("\\Y");
#define end_scrap   p->trans=text_ptr, freeze_text();
#define enter_block (   i)    save[i].txt=text_ptr, save[i].tok=tok_ptr;
#define eq_eq   036
#define error_message   2
#define even_out_pages   flags['e']
#define false   (boolean) 0
#define fatal_message   3
#define file_flag   (cite_flag-1) \
#define find_char ( )    (loc<=limit || get_line())
#define forced_statements   0x0100
#define freeze_text ( )    (*++text_ptr = tok_ptr)
#define gt_eq   035
#define gt_gt   021
#define harmless_message   1
#define hash_size   353
#define id_at (   i)    (&id_table[i])
#define id_flag   10240U
#define id_index (   p)    ((sixteen_bits)((p)-id_table))
#define ilink (   p)    index_link[id_index(p)]
#define infinity   255
#define inner_text_flag   (5*id_flag)
#define leave_block (   i)    text_ptr=save[i].txt, tok_ptr=save[i].tok;
#define left_math (   a)    (a->mathness>>2)
#define length (   p)    ((int)(strlen(name_begin(p))))
#define line_length   80
#define local   static
#define long_buf_size   (buf_size+longest_name)
#define longest_name   1000 \
#define lt_eq   034
#define lt_lt   020
#define make_xref (   n,
 
)
Value:
/* create \xr. node with |num==n| and successor |xmem[i]| */ \
if (++xref_ptr >= &xmem[max_refs]) \
overflow ("cross-reference"); \
xref_pointer xref_ptr
Definition: cweave.c:416
xref_info xmem[max_refs]
Definition: cweave.c:415
#define max_refs
Definition: cweave.c:3
sixteen_bits num
Definition: cweave.c:237
sixteen_bits next
Definition: cweave.c:238
#define overflow(t)
Definition: cweave.c:64
unsigned long n
Definition: axis.cpp:77
#define make_xrefs   flags['x']
#define mark_error ( )    (history=error_message)
#define mark_harmless ( )    if (history==spotless) history=harmless_message; else
#define math_char (   x)    ((x)==yes_math ? '+' : (x)==no_math ? '-' : '?')
#define max_bytes   50000L \
#define max_category   end_expr
#define max_idents   5000
#define max_lhs_length   4
#define max_modules   1000
#define max_no_of_nodes   300
#define max_refs   10000
#define max_scraps   4000
#define max_sections   4000 \
#define max_texts   2500
#define max_toks   10000
#define maybe_math   0
#define merged_decls   0x0080
#define min_nonrule_cat   lproc
#define minus_gt   031
#define minus_minus   01
#define mod_at (   i)    (&mod_table[i])
#define mod_flag   (3*id_flag)
#define mod_index (   p)    ((sixteen_bits)((p)-mod_table))
#define name_begin (   p)    ((p)->byte_start)
#define name_end (   p)    (name_begin(p)+length(p))
#define new_line ( )    putchar('\n')
#define next_xref (   x)    (&xmem[(x)->next])
#define no_forced_statements   0x0600
#define no_math   2
#define no_plus_plus   0x0008
#define no_successor (   q,
 
)    ((q)->next[(c)-1]==0)
#define no_xref   (!flags['x'])
#define not_all_stats_forced   0x0400
#define not_eq   032
#define num_mask   (cite_flag-1)
#define only_plus_plus   0x0004
#define or_or   037
#define out (   c)    *(out_ptr>=out_buf_end ? (break_out(),out_ptr++) : out_ptr++)=c
#define out_buf_end   (&out_line[line_length])
#define out_id_full (   p)    out_id_part(name_begin(p),length(p))
#define out_line   (&out_buf[1])
#define output_line_empty ( )    (out_ptr==out_line)
#define overflow (   t)    fatal("\n! Sorry, %s capacity exceeded",t) \
#define pack_scrap (   c,
 
)
Value:
(scrap_ptr++)->mathness = 5*(m) )
scrap_pointer scrap_ptr
Definition: cweave.c:449
#define freeze_text()
Definition: cweave.c:126
text_pointer trans
Definition: cweave.c:288
text_pointer text_ptr
Definition: cweave.c:423
eight_bits cat
Definition: cweave.c:286
#define plus_plus   013
#define pop_level ( )    cur_state = *--stack_ptr
#define print_mod (   p)    printf(": <%s%s>",name_begin(p), complete_name(p) ? "" : "..." )
#define report (   k,
  c,
 
)    printf("\t%lu %ss (out of %lu)\n",(unsigned long)(c),k,(unsigned long)(m))
#define res_flag   (2*id_flag)
#define reserved (   a)    (a->ilk>=type_defined) \
#define right_math (   a)    (a->mathness&0x3)
#define rule_error   install_failed=true,print \
#define scrap_info   scrap_union.scrap_field
#define scrap_info_end   (&scrap_info[max_scraps])
#define set_mode (   x)
Value:
if (cur_mathness==maybe_math) cur_mathness=init_mathness=x; \
else if (cur_mathness!=x) { app('$'); cur_mathness=x; } \
\
else
#define maybe_math
Definition: cweave.c:149
#define app(a)
Definition: cweave.c:121
#define set_successor (   q,
  c,
 
)    ((q)->next[(c)-1]=(sixteen_bits)((x)-trie_node_mem))
#define shift ( )    (next_control=get_next())
#define shift_and_store (   ch)    (*id_loc++=ch,c=*++loc)
#define show_banner   flags['b']
#define show_happiness   flags['h']
#define show_progress   flags['p']
#define show_stats   flags['s']
#define sort_info   scrap_union.id_list_field
#define sort_info_end   (&sort_info[sort_stack_size])
#define sort_stack_size   500
#define spotless   0
#define stack_end   (&stack[stack_size])
#define stack_size   400
#define standard_braces   0x0060
#define start_scrap (   s,
  c,
 
)    p=&token_trans[s],p->cat=c, p->mathness=5*(m)
#define successor (   q,
 
)    (&trie_node_mem[(q)->next[(c)-1]])
#define term_write (   string,
  leng 
)    printf("%.*s",(int)(leng),string)
#define tex_new_line ( )    (putc('\n', tex_file),++out_line_nr)
#define tex_printf (   format)    fprintf(tex_file, format)
#define tex_putc (   c)    putc (c, tex_file)
#define text_at (   i)    (&text_mem[i])
#define text_begin (   p)    (*(p)) \
#define text_end (   p)    (*(p+1)) \
#define text_flag   (4*id_flag)
#define text_index (   p)    ((sixteen_bits)((p)-text_mem)) \
#define text_mem_end   (&text_mem[max_texts])
#define tok_mem_end   (&tok_mem[max_toks])
#define trie_root   (&trie_node_mem[0])
#define triple_file_output   flags['t']
#define true   (boolean) 1
#define typedef_tracking (   b)    (typedef_master += b ? 5 : -5)
#define unaligned_braces   0x0050
#define unindexed (   a)    (a->ilk>=NULL_like) \
#define update_terminal ( )    fflush(stdout)
#define valid_cat (   c)    ((c)>0 && (c)<min_nonrule_cat)
#define variant   xref_info
#define version_string   "x3.6"
#define wide_braces   0x0030
#define xlink (   i)    (xmem[i].next)
#define xnum (   i)    (xmem[i].num)
#define xref   equiv_or_xref
#define xref_index (   p)    ((sixteen_bits)((p)-xmem))
#define yes_math   1

Typedef Documentation

typedef struct scrap * scrap_pointer
typedef struct sort_node * sort_pointer
typedef struct xref_info xref_info
typedef struct xref_info * xref_pointer

Enumeration Type Documentation

anonymous enum
Enumerator
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 
anonymous enum
Enumerator
at_sign_image 
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 
anonymous enum
Enumerator
cancel 
indent 
outdent 
opt 
flush_left 
break_space 
force 
big_force 
backup 
big_backup 
relax 
space 
tilde 
anonymous enum
Enumerator
unop 
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
Enumerator
inner 
outer 

Function Documentation

void app_str ( char *  s)
void break_out ( void  )
void C_read ( boolean  inner)
text_pointer C_translate ( void  )
void C_xref ( boolean  inner)
void copy_limbo ( void  )
int copy_TeX ( void  )
void do_C ( void  )
void finish_C ( void  )
void finish_line ( void  )
id_pointer first_ident ( text_pointer  p)
void flush_buffer ( char *  b,
boolean  percent 
)
void footnote ( xref_pointer p,
sixteen_bits  flag 
)
void fuse ( scrap_pointer  s,
int  n 
)
trie_node* get_new_trie_node ( void  )
int get_next ( void  )
void init_id_name ( id_pointer  p,
int  t 
)
void init_module_name ( mod_pointer  p)
void install_rule ( reduction rule)
void list_modules ( mod_pointer  p)
xref_pointer list_refs ( xref_pointer  x,
sixteen_bits  flag 
)
int main ( int  argc,
char **  argv 
)
void make_nonreserved ( scrap_pointer  p)
void make_output ( text_pointer  t,
mode  m 
)
void make_underlined ( scrap_pointer  p)
reduction* match ( scrap_pointer  p)
void mod_check ( mod_pointer  p)
boolean names_match ( id_pointer  x,
char *  q,
int  l,
int  ilk 
)
void new_id_xref ( id_pointer  p)
void new_mod_xref ( mod_pointer  p)
void out_id_part ( char *  s,
int  l 
)
void out_identifier ( id_pointer  p)
void out_index ( id_pointer  p)
void out_keyword ( id_pointer  p)
xref_pointer out_module_name ( mod_pointer  name)
void out_sec_nr ( int  n)
void out_str ( char *  s)
void outer_read ( void  )
void outer_xref ( void  )
void phase_one ( void  )
void phase_three ( void  )
void phase_two ( void  )
boolean push_header_file ( boolean  suspend)
void push_level ( text_pointer  p)
void reduce ( reduction rule)
int scan_comment ( int *  bal,
boolean  one_liner 
)
void set_file_flag ( mod_pointer  p)
int skip_TeX ( void  )
text_pointer translate ( void  )
void unbucket ( eight_bits  d)

Variable Documentation

local int brace_level
id_pointer bucket[UCHAR_MAX+1]
int ccode[UCHAR_MAX+1]
boolean change_exists =false
eight_bits collate[UCHAR_MAX-25]
id_pointer cur_id
mod_pointer cur_mod
int end_collate
scrap_pointer hi_ptr
sort_node id_list_field[sort_stack_size]
id_pointer index_link[max_idents]
scrap_pointer lo_ptr
sixteen_bits mod_xref_switch = 0
int next_control
int node_no = 1
char out_buf[line_length+1]
int out_line_nr =1
char* out_ptr
local int par_level
int preprocessing =0
sixteen_bits rule_mask
struct { ... } save[2]
scrap scrap_field[max_scraps]
union { ... } scrap_union
stack_pointer stack_ptr =&stack[0]
text_pointer text_ptr = text_mem
token tok_mem[max_toks]
scrap token_trans[ignore]
trie_node trie_node_mem[max_no_of_nodes]
local int typedef_master =-5
xref_pointer xref_ptr = &xmem[0]
sixteen_bits xref_switch = 0