languages/compiler/header.h File Reference

#include "syswords2.h"

Include dependency graph for header.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  m_pair
struct  input
struct  include
struct  tokeniser
struct  name
struct  literalstring
struct  amongvec
struct  among
struct  grouping
struct  node
struct  analyser
struct  generator
struct  options

Defines

#define true   1
#define false   0
#define repeat   while(true)
#define unless(C)   if(!(C))
#define until(C)   while(!(C))
#define MALLOC   check_malloc
#define FREE   check_free
#define NEW(type, p)   struct type * p = (struct type *) MALLOC(sizeof(struct type))
#define NEWVEC(type, p, n)   struct type * p = (struct type *) MALLOC(sizeof(struct type) * n)
#define STARTSIZE   10
#define SIZE(p)   ((int *)(p))[-1]
#define CAPACITY(p)   ((int *)(p))[-2]

Typedefs

typedef unsigned char byte
typedef unsigned short symbol

Enumerations

enum  token_codes {
  c_among = 4, c_and, c_as, c_assign,
  c_assignto, c_atleast, c_atlimit, c_atmark,
  c_attach, c_backwardmode, c_backwards, c_booleans,
  c_bra, c_comment1, c_comment2, c_cursor,
  c_debug, c_decimal, c_define, c_delete,
  c_divide, c_divideassign, c_do, c_dollar,
  c_eq, c_externals, c_fail, c_false,
  c_for, c_ge, c_get, c_gopast,
  c_goto, c_gr, c_groupings, c_hex,
  c_hop, c_insert, c_integers, c_ket,
  c_le, c_leftslice, c_limit, c_loop,
  c_ls, c_maxint, c_minint, c_minus,
  c_minusassign, c_multiply, c_multiplyassign, c_ne,
  c_next, c_non, c_not, c_or,
  c_plus, c_plusassign, c_repeat, c_reverse,
  c_rightslice, c_routines, c_set, c_setlimit,
  c_setmark, c_size, c_sizeof, c_slicefrom,
  c_sliceto, c_stringdef, c_stringescapes, c_strings,
  c_substring, c_test, c_tolimit, c_tomark,
  c_true, c_try, c_unset, c_mathassign,
  c_name, c_number, c_literalstring, c_neg,
  c_call, c_grouping, c_booltest
}
enum  name_types {
  t_size = 6, t_string = 0, t_boolean = 1, t_integer = 2,
  t_routine = 3, t_external = 4, t_grouping = 5
}
enum  analyser_modes { m_forward = 0, m_backward }

Functions

symbolcreate_b (int n)
void report_b (FILE *out, symbol *p)
void lose_b (symbol *p)
symbolincrease_capacity (symbol *p, int n)
symbolmove_to_b (symbol *p, int n, symbol *q)
symboladd_to_b (symbol *p, int n, symbol *q)
symbolcopy_b (symbol *p)
char * b_to_s (symbol *p)
symboladd_s_to_b (symbol *p, const char *s)
strstr_new (void)
void str_delete (struct str *str)
void str_append (struct str *str, struct str *add)
void str_append_ch (struct str *str, char add)
void str_append_b (struct str *str, symbol *q)
void str_append_string (struct str *str, const char *s)
void str_append_int (struct str *str, int i)
void str_clear (struct str *str)
void str_assign (struct str *str, char *s)
strstr_copy (struct str *old)
symbolstr_data (struct str *str)
int str_len (struct str *str)
int get_utf8 (const symbol *p, int *slot)
int put_utf8 (int ch, symbol *p)
symbolget_input (symbol *p)
tokenisercreate_tokeniser (symbol *b)
int read_token (struct tokeniser *t)
bytename_of_token (int code)
void close_tokeniser (struct tokeniser *t)
void * check_malloc (int n)
void check_free (void *p)
void print_program (struct analyser *a)
analysercreate_analyser (struct tokeniser *t)
void close_analyser (struct analyser *a)
void read_program (struct analyser *a)
generatorcreate_generator_c (struct analyser *a, struct options *o)
void close_generator_c (struct generator *g)
void generate_program_c (struct generator *g)
generatorcreate_generator_java (struct analyser *a, struct options *o)
void close_generator_java (struct generator *g)
void generate_program_java (struct generator *g)

Variables

int space_count


Define Documentation

#define true   1

Definition at line 5 of file header.h.

#define false   0

Definition at line 6 of file header.h.

#define repeat   while(true)

Definition at line 7 of file header.h.

Referenced by convert_numeric_string(), find_in_m(), find_word(), get_input(), look_for_name(), next_real_char(), next_token(), read_AE(), read_among(), read_C_connection(), read_C_list(), read_chars(), read_define_grouping(), read_literal_string(), read_names(), read_options(), read_program_(), and read_token().

#define unless (  )     if(!(C))

Definition at line 8 of file header.h.

Referenced by check_modifyable(), check_routine_mode(), compare_words(), convert_numeric_string(), error(), generate_among(), generate_among_table(), get_token(), main(), make_among(), name_to_node(), print_node_(), read_AE(), read_among(), read_C(), read_define(), read_define_grouping(), read_define_routine(), read_literal_string(), read_names(), read_program(), read_program_(), and read_token().

#define until (  )     while(!(C))

Definition at line 9 of file header.h.

Referenced by close_analyser(), close_tokeniser(), generate_among(), generate_amongs(), generate_and(), generate_bra(), generate_groupings(), generate_header_file(), generate_or(), generate_program_c(), generate_routine_headers(), K_needed(), main(), make_among(), read_program(), read_token(), repeat_score(), reverse_b(), and wp().

#define MALLOC   check_malloc

Definition at line 11 of file header.h.

Referenced by create_b().

#define FREE   check_free

Definition at line 12 of file header.h.

Referenced by close_analyser(), close_generator_c(), close_tokeniser(), lose_b(), main(), and read_token().

#define NEW ( type,
 )     struct type * p = (struct type *) MALLOC(sizeof(struct type))

Definition at line 14 of file header.h.

Referenced by create_analyser(), create_generator_c(), create_tokeniser(), main(), make_among(), new_literalstring(), new_node(), read_define_grouping(), read_names(), read_options(), and read_token().

#define NEWVEC ( type,
p,
 )     struct type * p = (struct type *) MALLOC(sizeof(struct type) * n)

Definition at line 15 of file header.h.

Referenced by make_among().

#define STARTSIZE   10

Definition at line 17 of file header.h.

Referenced by get_input().

#define SIZE (  )     ((int *)(p))[-1]

Definition at line 18 of file header.h.

Referenced by add_s_to_b(), add_to_b(), alter_grouping(), b_to_s(), convert_numeric_string(), copy_b(), create_b(), eq_s(), Xapian::Stem::Internal::eq_v(), Xapian::Stem::Internal::eq_v_b(), find_in_m(), generate_data_address(), generate_grouping_table(), generate_literalstring(), get_input(), increase_capacity(), Xapian::Stem::Internal::insert_v(), look_for_name(), main(), make_among(), move_to_b(), next_char(), next_token(), read_define_grouping(), read_literal_string(), read_token(), Xapian::Stem::Internal::replace_s(), report_b(), reverse_b(), Xapian::Stem::Internal::slice_from_v(), str_append(), str_append_b(), str_clear(), str_len(), wlitarray(), and wlitref().

#define CAPACITY (  )     ((int *)(p))[-2]

Definition at line 19 of file header.h.

Referenced by add_s_to_b(), add_to_b(), Xapian::Stem::Internal::assign_to(), create_b(), get_input(), increase_capacity(), move_to_b(), Xapian::Stem::Internal::replace_s(), and Xapian::Stem::Internal::slice_to().


Typedef Documentation

typedef unsigned char byte

Definition at line 2 of file header.h.

typedef unsigned short symbol

Definition at line 3 of file header.h.


Enumeration Type Documentation

enum token_codes

Enumerator:
c_among 
c_and 
c_as 
c_assign 
c_assignto 
c_atleast 
c_atlimit 
c_atmark 
c_attach 
c_backwardmode 
c_backwards 
c_booleans 
c_bra 
c_comment1 
c_comment2 
c_cursor 
c_debug 
c_decimal 
c_define 
c_delete 
c_divide 
c_divideassign 
c_do 
c_dollar 
c_eq 
c_externals 
c_fail 
c_false 
c_for 
c_ge 
c_get 
c_gopast 
c_goto 
c_gr 
c_groupings 
c_hex 
c_hop 
c_insert 
c_integers 
c_ket 
c_le 
c_leftslice 
c_limit 
c_loop 
c_ls 
c_maxint 
c_minint 
c_minus 
c_minusassign 
c_multiply 
c_multiplyassign 
c_ne 
c_next 
c_non 
c_not 
c_or 
c_plus 
c_plusassign 
c_repeat 
c_reverse 
c_rightslice 
c_routines 
c_set 
c_setlimit 
c_setmark 
c_size 
c_sizeof 
c_slicefrom 
c_sliceto 
c_stringdef 
c_stringescapes 
c_strings 
c_substring 
c_test 
c_tolimit 
c_tomark 
c_true 
c_try 
c_unset 
c_mathassign 
c_name 
c_number 
c_literalstring 
c_neg 
c_call 
c_grouping 
c_booltest 

Definition at line 103 of file header.h.

enum name_types

Enumerator:
t_size 
t_string 
t_boolean 
t_integer 
t_routine 
t_external 
t_grouping 

Definition at line 197 of file header.h.

enum analyser_modes

Enumerator:
m_forward 
m_backward 

Definition at line 239 of file header.h.


Function Documentation

symbol* create_b ( int  n  ) 

Definition at line 53 of file space.c.

References CAPACITY, HEAD, MALLOC, and SIZE.

Referenced by add_s_to_b(), copy_b(), create_tokeniser(), generate_grouping_table(), get_input(), increase_capacity(), read_define_grouping(), and str_new().

void report_b ( FILE *  out,
symbol p 
)

Definition at line 60 of file space.c.

References SIZE.

Referenced by error2(), error3(), error4(), print_node_(), and read_program().

void lose_b ( symbol p  ) 

Definition at line 65 of file space.c.

References FREE, and HEAD.

Referenced by close_analyser(), close_tokeniser(), generate_grouping_table(), increase_capacity(), main(), read_token(), and str_delete().

symbol* increase_capacity ( symbol p,
int  n 
)

Definition at line 70 of file space.c.

References CAPACITY, create_b(), EXTENDER, lose_b(), and SIZE.

Referenced by add_s_to_b(), add_to_b(), get_input(), and move_to_b().

symbol* move_to_b ( symbol p,
int  n,
symbol q 
)

Definition at line 77 of file space.c.

References CAPACITY, increase_capacity(), and SIZE.

Referenced by copy_b(), next_token(), and read_chars().

symbol* add_to_b ( symbol p,
int  n,
symbol q 
)

Definition at line 83 of file space.c.

References CAPACITY, increase_capacity(), and SIZE.

Referenced by alter_grouping(), read_literal_string(), read_token(), str_append(), str_append_b(), and str_append_ch().

symbol* copy_b ( symbol p  ) 

Definition at line 89 of file space.c.

References create_b(), move_to_b(), and SIZE.

Referenced by new_literalstring(), read_names(), and read_token().

char* b_to_s ( symbol p  ) 

Definition at line 110 of file space.c.

References SIZE.

Referenced by get_input(), get_output(), and output_str().

symbol* add_s_to_b ( symbol p,
const char *  s 
)

Definition at line 130 of file space.c.

References CAPACITY, create_b(), increase_capacity(), and SIZE.

Referenced by main(), read_options(), and str_append_string().

struct str* str_new ( void   )  [read]

Definition at line 156 of file space.c.

References create_b(), and str::data.

Referenced by generate_program_c(), and str_copy().

void str_delete ( struct str str  ) 

Definition at line 164 of file space.c.

References str::data, and lose_b().

Referenced by generate_program_c().

void str_append ( struct str str,
struct str add 
)

Definition at line 171 of file space.c.

References add_to_b(), str::data, and SIZE.

Referenced by str_copy().

void str_append_ch ( struct str str,
char  add 
)

Definition at line 178 of file space.c.

References add_to_b(), and str::data.

Referenced by wch(), wh_ch(), and wnl().

void str_append_b ( struct str str,
symbol q 
)

Definition at line 186 of file space.c.

References add_to_b(), str::data, and SIZE.

Referenced by generate_header_file(), wc(), and wvn().

void str_append_string ( struct str str,
const char *  s 
)

Definition at line 192 of file space.c.

References add_s_to_b(), and str::data.

Referenced by str_append_int(), str_assign(), and ws().

void str_append_int ( struct str str,
int  i 
)

Definition at line 198 of file space.c.

References str_append_string().

Referenced by wi().

void str_clear ( struct str str  ) 

Definition at line 206 of file space.c.

References str::data, and SIZE.

Referenced by generate_program_c(), and str_assign().

void str_assign ( struct str str,
char *  s 
)

Definition at line 212 of file space.c.

References str_append_string(), and str_clear().

struct str* str_copy ( struct str old  )  [read]

Definition at line 219 of file space.c.

References str_append(), and str_new().

symbol* str_data ( struct str str  ) 

Definition at line 227 of file space.c.

References str::data.

Referenced by output_str().

int str_len ( struct str str  ) 

Definition at line 233 of file space.c.

References str::data, and SIZE.

int get_utf8 ( const symbol p,
int *  slot 
)

Definition at line 238 of file space.c.

Referenced by next_symbol().

int put_utf8 ( int  ch,
symbol p 
)

Definition at line 251 of file space.c.

Referenced by convert_numeric_string().

symbol* get_input ( symbol p  ) 

Definition at line 21 of file tokeniser.c.

References b_to_s(), CAPACITY, create_b(), increase_capacity(), repeat, size, SIZE, and STARTSIZE.

Referenced by main(), and read_token().

struct tokeniser* create_tokeniser ( symbol b  )  [read]

Definition at line 428 of file tokeniser.c.

References create_b(), NEW, and tokeniser::p.

Referenced by main().

int read_token ( struct tokeniser t  ) 

Definition at line 300 of file tokeniser.c.

References add_to_b(), tokeniser::b, include::b, tokeniser::b2, tokeniser::c, c_comment1, c_comment2, c_decimal, c_get, c_hex, c_literalstring, c_stringdef, c_stringescapes, convert_numeric_string(), copy_b(), eq_s(), error(), error1(), error2(), FREE, tokeniser::get_depth, get_input(), tokeniser::includes, tokeniser::line_number, lose_b(), tokeniser::m_end, tokeniser::m_pairs, tokeniser::m_start, m_pair::name, NEW, include::next, tokeniser::next, next_real_char(), next_token(), tokeniser::p, input::p, tokeniser::previous_token, read_chars(), read_token(), repeat, SIZE, tokeniser::token, tokeniser::token_held, unless, and until.

Referenced by C_style(), get_token(), read_AE(), read_AE_test(), read_among(), read_C(), read_C_connection(), read_C_list(), read_define_grouping(), read_names(), read_program_(), and read_token().

byte* name_of_token ( int  code  ) 

Definition at line 409 of file tokeniser.c.

References c_booltest, c_call, c_grouping, c_literalstring, c_mathassign, c_name, c_neg, c_number, system_word::code, and vocab.

Referenced by error2(), print_node_(), and wc().

void close_tokeniser ( struct tokeniser t  ) 

Definition at line 446 of file tokeniser.c.

References tokeniser::b, tokeniser::b2, FREE, lose_b(), tokeniser::m_pairs, m_pair::name, m_pair::next, tokeniser::next, input::next, until, and m_pair::value.

Referenced by main().

void* check_malloc ( int  n  ) 

Definition at line 98 of file space.c.

References space_count.

void check_free ( void *  p  ) 

Definition at line 103 of file space.c.

References space_count.

void print_program ( struct analyser a  ) 

Definition at line 34 of file analyser.c.

References print_node_(), and analyser::program.

Referenced by main().

struct analyser* create_analyser ( struct tokeniser t  )  [read]

Definition at line 904 of file analyser.c.

References m_forward, NEW, and t_size.

Referenced by main().

void close_analyser ( struct analyser a  ) 

Definition at line 921 of file analyser.c.

References analyser::amongs, grouping::b, among::b, literalstring::b, name::b, FREE, analyser::groupings, analyser::literalstrings, lose_b(), analyser::names, grouping::next, among::next, literalstring::next, name::next, node::next, analyser::nodes, and until.

Referenced by main().

void read_program ( struct analyser a  ) 

Definition at line 857 of file analyser.c.

References name::b, name::definition, error4(), tokeniser::error_count, name::grouping, analyser::names, name::next, read_program_(), name::referenced, report_b(), t_external, t_grouping, t_routine, analyser::tokeniser, name::type, unless, until, and name::used.

Referenced by main().

struct generator* create_generator_c ( struct analyser a,
struct options o 
) [read]

Definition at line 1779 of file generator.c.

References NEW.

Referenced by main().

void close_generator_c ( struct generator g  ) 

Definition at line 1789 of file generator.c.

References FREE.

Referenced by main().

void generate_program_c ( struct generator g  ) 

Definition at line 1740 of file generator.c.

References generator::analyser, generator::declarations, generate(), generate_amongs(), generate_close(), generate_create(), generate_create_and_close_templates(), generate_groupings(), generate_head(), generate_header_file(), generate_routine_headers(), generate_start_comment(), generator::literalstring_count, options::make_lang, generator::options, generator::outbuf, options::output_c, options::output_h, output_str(), analyser::program, node::right, str_clear(), str_delete(), str_new(), until, and w().

Referenced by main().

struct generator* create_generator_java ( struct analyser a,
struct options o 
) [read]

Referenced by main().

void close_generator_java ( struct generator g  ) 

Referenced by main().

void generate_program_java ( struct generator g  ) 

Referenced by main().


Variable Documentation

int space_count

Definition at line 96 of file space.c.

Referenced by check_free(), check_malloc(), and main().


Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.