xapian-core  1.4.26
Classes | Macros | Typedefs | Enumerations | Functions | Variables
header.h File Reference
#include <stdio.h>
#include "syswords2.h"
+ Include dependency graph for header.h:

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
 

Macros

#define SNOWBALL_VERSION   "2.0.0"
 
#define true   1
 
#define false   0
 
#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 SIZE(p)   ((int *)(p))[-1]
 
#define CAPACITY(p)   ((int *)(p))[-2]
 
#define MOVE_TO_B(B, LIT)   move_to_b(B, sizeof(LIT) / sizeof(LIT[0]), LIT)
 

Typedefs

typedef unsigned char byte
 
typedef unsigned short symbol
 

Enumerations

enum  enc { ENC_SINGLEBYTE, ENC_UTF8, ENC_WIDECHARS }
 
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_len, c_lenof,
  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, NUM_TOKEN_CODES
}
 
enum  uplus_modes { UPLUS_NONE, UPLUS_DEFINED, UPLUS_UNICODE }
 
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 }
 
enum  special_labels { x_return = -1 }
 

Functions

symbolcreate_b (int n)
 
void report_b (FILE *out, const symbol *p)
 
void lose_b (symbol *p)
 
symbolincrease_capacity (symbol *p, int n)
 
symbolmove_to_b (symbol *p, int n, const symbol *q)
 
symboladd_to_b (symbol *p, int n, const symbol *q)
 
symbolcopy_b (const symbol *p)
 
char * b_to_s (const symbol *p)
 
symboladd_s_to_b (symbol *p, const char *s)
 
struct str * str_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)
 
struct str * str_copy (struct str *old)
 
symbolstr_data (struct str *str)
 
int str_len (struct str *str)
 
int str_back (struct str *str)
 
int get_utf8 (const symbol *p, int *slot)
 
int put_utf8 (int ch, symbol *p)
 
void output_str (FILE *outfile, struct str *str)
 
symbolget_input (const char *filename)
 
struct tokenisercreate_tokeniser (symbol *b, char *file)
 
int read_token (struct tokeniser *t)
 
const char * name_of_token (int code)
 
void disable_token (struct tokeniser *t, int code)
 
void close_tokeniser (struct tokeniser *t)
 
void * check_malloc (int n)
 
void check_free (void *p)
 
void print_program (struct analyser *a)
 
struct analysercreate_analyser (struct tokeniser *t)
 
void close_analyser (struct analyser *a)
 
void read_program (struct analyser *a)
 
struct generatorcreate_generator (struct analyser *a, struct options *o)
 
void close_generator (struct generator *g)
 
void write_char (struct generator *g, int ch)
 
void write_newline (struct generator *g)
 
void write_string (struct generator *g, const char *s)
 
void write_int (struct generator *g, int i)
 
void write_b (struct generator *g, symbol *b)
 
void write_str (struct generator *g, struct str *str)
 
void write_comment_content (struct generator *g, struct node *p)
 
void write_generated_comment_content (struct generator *g)
 
void write_start_comment (struct generator *g, const char *comment_start, const char *comment_end)
 
int K_needed (struct generator *g, struct node *p)
 
int repeat_restore (struct generator *g, struct node *p)
 
void generate_program_c (struct generator *g)
 
void generate_program_java (struct generator *g)
 
void generate_program_csharp (struct generator *g)
 
void generate_program_pascal (struct generator *g)
 
void generate_program_python (struct generator *g)
 
void generate_program_js (struct generator *g)
 
void generate_program_rust (struct generator *g)
 
void generate_program_go (struct generator *g)
 

Variables

int space_count
 

Macro Definition Documentation

◆ CAPACITY

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

◆ false

#define false   0

Definition at line 9 of file header.h.

◆ FREE

#define FREE   check_free

Definition at line 12 of file header.h.

◆ MALLOC

#define MALLOC   check_malloc

Definition at line 11 of file header.h.

◆ MOVE_TO_B

#define MOVE_TO_B (   B,
  LIT 
)    move_to_b(B, sizeof(LIT) / sizeof(LIT[0]), LIT)

Definition at line 30 of file header.h.

◆ NEW

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

Definition at line 14 of file header.h.

◆ NEWVEC

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

Definition at line 15 of file header.h.

◆ SIZE

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

◆ SNOWBALL_VERSION

#define SNOWBALL_VERSION   "2.0.0"

Definition at line 3 of file header.h.

◆ true

#define true   1

Definition at line 8 of file header.h.

Typedef Documentation

◆ byte

typedef unsigned char byte

Definition at line 5 of file header.h.

◆ symbol

typedef unsigned short symbol

Definition at line 6 of file header.h.

Enumeration Type Documentation

◆ analyser_modes

Enumerator
m_forward 
m_backward 

Definition at line 276 of file header.h.

◆ enc

enum enc
Enumerator
ENC_SINGLEBYTE 
ENC_UTF8 
ENC_WIDECHARS 

Definition at line 52 of file header.h.

◆ name_types

enum name_types
Enumerator
t_size 
t_string 
t_boolean 
t_integer 
t_routine 
t_external 
t_grouping 

Definition at line 233 of file header.h.

◆ special_labels

Enumerator
x_return 

Definition at line 330 of file header.h.

◆ 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_len 
c_lenof 
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 
NUM_TOKEN_CODES 

Definition at line 81 of file header.h.

◆ uplus_modes

Enumerator
UPLUS_NONE 
UPLUS_DEFINED 
UPLUS_UNICODE 

Definition at line 97 of file header.h.

Function Documentation

◆ add_s_to_b()

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

◆ add_to_b()

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

◆ b_to_s()

char* b_to_s ( const symbol p)

◆ check_free()

void check_free ( void *  p)

◆ check_malloc()

void* check_malloc ( int  n)

◆ close_analyser()

void close_analyser ( struct analyser a)

◆ close_generator()

void close_generator ( struct generator g)

◆ close_tokeniser()

void close_tokeniser ( struct tokeniser t)

◆ copy_b()

symbol* copy_b ( const symbol p)

◆ create_analyser()

struct analyser* create_analyser ( struct tokeniser t)

◆ create_b()

symbol* create_b ( int  n)

◆ create_generator()

struct generator* create_generator ( struct analyser a,
struct options o 
)

◆ create_tokeniser()

struct tokeniser* create_tokeniser ( symbol b,
char *  file 
)

◆ disable_token()

void disable_token ( struct tokeniser t,
int  code 
)

◆ generate_program_c()

void generate_program_c ( struct generator g)

◆ generate_program_csharp()

void generate_program_csharp ( struct generator g)

◆ generate_program_go()

void generate_program_go ( struct generator g)

◆ generate_program_java()

void generate_program_java ( struct generator g)

◆ generate_program_js()

void generate_program_js ( struct generator g)

◆ generate_program_pascal()

void generate_program_pascal ( struct generator g)

◆ generate_program_python()

void generate_program_python ( struct generator g)

◆ generate_program_rust()

void generate_program_rust ( struct generator g)

◆ get_input()

symbol* get_input ( const char *  filename)

◆ get_utf8()

int get_utf8 ( const symbol p,
int *  slot 
)

◆ increase_capacity()

symbol* increase_capacity ( symbol p,
int  n 
)

◆ K_needed()

int K_needed ( struct generator g,
struct node p 
)

◆ lose_b()

void lose_b ( symbol p)

◆ move_to_b()

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

◆ name_of_token()

const char* name_of_token ( int  code)

◆ output_str()

void output_str ( FILE *  outfile,
struct str *  str 
)

◆ print_program()

void print_program ( struct analyser a)

◆ put_utf8()

int put_utf8 ( int  ch,
symbol p 
)

◆ read_program()

void read_program ( struct analyser a)

◆ read_token()

int read_token ( struct tokeniser t)

◆ repeat_restore()

int repeat_restore ( struct generator g,
struct node p 
)

◆ report_b()

void report_b ( FILE *  out,
const symbol p 
)

◆ str_append()

void str_append ( struct str *  str,
struct str *  add 
)

◆ str_append_b()

void str_append_b ( struct str *  str,
symbol q 
)

◆ str_append_ch()

void str_append_ch ( struct str *  str,
char  add 
)

◆ str_append_int()

void str_append_int ( struct str *  str,
int  i 
)

◆ str_append_string()

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

◆ str_assign()

void str_assign ( struct str *  str,
char *  s 
)

◆ str_back()

int str_back ( struct str *  str)

◆ str_clear()

void str_clear ( struct str *  str)

◆ str_copy()

struct str* str_copy ( struct str *  old)

◆ str_data()

symbol* str_data ( struct str *  str)

◆ str_delete()

void str_delete ( struct str *  str)

◆ str_len()

int str_len ( struct str *  str)

◆ str_new()

struct str* str_new ( void  )

◆ write_b()

void write_b ( struct generator g,
symbol b 
)

◆ write_char()

void write_char ( struct generator g,
int  ch 
)

◆ write_comment_content()

void write_comment_content ( struct generator g,
struct node p 
)

◆ write_generated_comment_content()

void write_generated_comment_content ( struct generator g)

◆ write_int()

void write_int ( struct generator g,
int  i 
)

◆ write_newline()

void write_newline ( struct generator g)

◆ write_start_comment()

void write_start_comment ( struct generator g,
const char *  comment_start,
const char *  comment_end 
)

◆ write_str()

void write_str ( struct generator g,
struct str *  str 
)

◆ write_string()

void write_string ( struct generator g,
const char *  s 
)

Variable Documentation

◆ space_count

int space_count