languages/compiler/generator.c File Reference

#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "header.h"

Include dependency graph for generator.c:

Go to the source code of this file.

Enumerations

enum  special_labels { x_return = -1 }

Functions

static void generate (struct generator *g, struct node *p)
static int new_label (struct generator *g)
static void output_str (FILE *outfile, struct str *str)
static void wch (struct generator *g, int ch)
static void wnl (struct generator *g)
static void ws (struct generator *g, const char *s)
static void wi (struct generator *g, int i)
static void wh_ch (struct generator *g, int i)
static void wh (struct generator *g, int i)
static void wi3 (struct generator *g, int i)
static void wvn (struct generator *g, struct name *p)
static void wv (struct generator *g, struct name *p)
static void wlitarray (struct generator *g, symbol *p)
static void wlitref (struct generator *g, symbol *p)
static void wm (struct generator *g)
static void wc (struct generator *g, struct node *p)
static void wms (struct generator *g, const char *s)
static void wbs (struct generator *g)
static void wbe (struct generator *g)
static void w (struct generator *g, const char *s)
static void wk (struct generator *g, struct node *p)
static void wrestore (struct generator *g, struct node *p, int keep_token)
static void wrestorelimit (struct generator *g, struct node *p, int keep_token)
static void winc (struct generator *g, struct node *p)
static void wsetl (struct generator *g, int n)
static void wgotol (struct generator *g, int n)
static void wf (struct generator *g, struct node *p)
static void wlim (struct generator *g, struct node *p)
static void wp (struct generator *g, const char *s, struct node *p)
static void generate_AE (struct generator *g, struct node *p)
static int K_needed (struct generator *g, struct node *p)
static int repeat_score (struct generator *g, struct node *p)
static int repeat_restore (struct generator *g, struct node *p)
static void generate_bra (struct generator *g, struct node *p)
static void generate_and (struct generator *g, struct node *p)
static void generate_or (struct generator *g, struct node *p)
static void generate_backwards (struct generator *g, struct node *p)
static void generate_not (struct generator *g, struct node *p)
static void generate_try (struct generator *g, struct node *p)
static void generate_set (struct generator *g, struct node *p)
static void generate_unset (struct generator *g, struct node *p)
static void generate_fail (struct generator *g, struct node *p)
static void generate_test (struct generator *g, struct node *p)
static void generate_do (struct generator *g, struct node *p)
static void generate_next (struct generator *g, struct node *p)
static void generate_GO_grouping (struct generator *g, struct node *p, int is_goto, int complement)
static void generate_GO (struct generator *g, struct node *p, int style)
static void generate_loop (struct generator *g, struct node *p)
static void generate_repeat (struct generator *g, struct node *p, int atleast_case)
static void generate_atleast (struct generator *g, struct node *p)
static void generate_setmark (struct generator *g, struct node *p)
static void generate_tomark (struct generator *g, struct node *p)
static void generate_atmark (struct generator *g, struct node *p)
static void generate_hop (struct generator *g, struct node *p)
static void generate_delete (struct generator *g, struct node *p)
static void generate_tolimit (struct generator *g, struct node *p)
static void generate_atlimit (struct generator *g, struct node *p)
static void generate_leftslice (struct generator *g, struct node *p)
static void generate_rightslice (struct generator *g, struct node *p)
static void generate_assignto (struct generator *g, struct node *p)
static void generate_sliceto (struct generator *g, struct node *p)
static void generate_data_address (struct generator *g, struct node *p)
static void generate_insert (struct generator *g, struct node *p, int style)
static void generate_assignfrom (struct generator *g, struct node *p)
static void generate_slicefrom (struct generator *g, struct node *p)
static void generate_setlimit (struct generator *g, struct node *p)
static void generate_dollar (struct generator *g, struct node *p)
static void generate_integer_assign (struct generator *g, struct node *p, char *s)
static void generate_integer_test (struct generator *g, struct node *p, char *s)
static void generate_call (struct generator *g, struct node *p)
static void generate_grouping (struct generator *g, struct node *p, int complement)
static void generate_namedstring (struct generator *g, struct node *p)
static void generate_literalstring (struct generator *g, struct node *p)
static void generate_define (struct generator *g, struct node *p)
static void generate_substring (struct generator *g, struct node *p)
static void generate_among (struct generator *g, struct node *p)
static void generate_booltest (struct generator *g, struct node *p)
static void generate_false (struct generator *g, struct node *p)
static void generate_debug (struct generator *g, struct node *p)
static void generate_start_comment (struct generator *g)
static void generate_head (struct generator *g)
static void generate_routine_headers (struct generator *g)
static void generate_among_table (struct generator *g, struct among *x)
static void generate_amongs (struct generator *g)
static void set_bit (symbol *b, int i)
static void generate_grouping_table (struct generator *g, struct grouping *q)
static void generate_groupings (struct generator *g)
static void generate_create (struct generator *g)
static void generate_close (struct generator *g)
static void generate_create_and_close_templates (struct generator *g)
static void generate_header_file (struct generator *g)
void generate_program_c (struct generator *g)
generatorcreate_generator_c (struct analyser *a, struct options *o)
void close_generator_c (struct generator *g)

Variables

static const char * vars [] = { "p", "c", "l", "lb", "bra", "ket", NULL }


Enumeration Type Documentation

enum special_labels

Enumerator:
x_return 

Definition at line 15 of file generator.c.


Function Documentation

static void generate ( struct generator g,
struct node p 
) [static]

Definition at line 1267 of file generator.c.

References c_among, c_and, c_assign, c_assignto, c_atleast, c_atlimit, c_atmark, c_attach, c_backwards, c_booltest, c_bra, c_call, c_debug, c_define, c_delete, c_divideassign, c_do, c_dollar, c_eq, c_fail, c_false, c_ge, c_gopast, c_goto, c_gr, c_grouping, c_hop, c_insert, c_le, c_leftslice, c_literalstring, c_loop, c_ls, c_mathassign, c_minusassign, c_multiplyassign, c_name, c_ne, c_next, c_non, c_not, c_or, c_plusassign, c_repeat, c_reverse, c_rightslice, c_set, c_setlimit, c_setmark, c_slicefrom, c_sliceto, c_substring, c_test, c_tolimit, c_tomark, c_true, c_try, c_unset, generator::failure_keep_count, generator::failure_label, generate_among(), generate_and(), generate_assignfrom(), generate_assignto(), generate_atleast(), generate_atlimit(), generate_atmark(), generate_backwards(), generate_booltest(), generate_bra(), generate_call(), generate_debug(), generate_define(), generate_delete(), generate_do(), generate_dollar(), generate_fail(), generate_false(), generate_GO(), generate_grouping(), generate_hop(), generate_insert(), generate_integer_assign(), generate_integer_test(), generate_leftslice(), generate_literalstring(), generate_loop(), generate_namedstring(), generate_next(), generate_not(), generate_or(), generate_repeat(), generate_rightslice(), generate_set(), generate_setlimit(), generate_setmark(), generate_slicefrom(), generate_sliceto(), generate_substring(), generate_test(), generate_tolimit(), generate_tomark(), generate_try(), generate_unset(), generator::label_used, and node::type.

Referenced by generate_among(), generate_and(), generate_backwards(), generate_bra(), generate_define(), generate_do(), generate_dollar(), generate_fail(), generate_GO(), generate_loop(), generate_not(), generate_or(), generate_program_c(), generate_repeat(), generate_setlimit(), generate_test(), and generate_try().

static int new_label ( struct generator g  )  [static]

Definition at line 21 of file generator.c.

References generator::next_label.

Referenced by generate_do(), generate_dollar(), generate_GO(), generate_not(), generate_or(), generate_repeat(), and generate_try().

static void output_str ( FILE *  outfile,
struct str str 
) [static]

Definition at line 26 of file generator.c.

References b_to_s(), and str_data().

Referenced by generate_program_c().

static void wch ( struct generator g,
int  ch 
) [static]

Definition at line 33 of file generator.c.

References generator::outbuf, and str_append_ch().

Referenced by generate_AE(), generate_head(), wf(), wgotol(), wi3(), wlitarray(), wp(), wsetl(), and wvn().

static void wnl ( struct generator g  )  [static]

Definition at line 37 of file generator.c.

References generator::line_count, generator::outbuf, and str_append_ch().

Referenced by wbe(), wc(), wgotol(), wp(), and wsetl().

static void ws ( struct generator g,
const char *  s 
) [static]

Definition at line 42 of file generator.c.

References generator::outbuf, and str_append_string().

Referenced by generate_AE(), generate_define(), generate_head(), split_words(), wc(), wf(), wk(), wlitarray(), wlitref(), wm(), wms(), wp(), wrestore(), wrestorelimit(), wv(), and wvn().

static void wi ( struct generator g,
int  i 
) [static]

Definition at line 46 of file generator.c.

References generator::outbuf, and str_append_int().

Referenced by generate_AE(), generate_among_table(), generate_data_address(), generate_grouping_table(), generate_setlimit(), generate_test(), wc(), wf(), wgotol(), wi3(), wk(), wlitref(), wp(), wrestore(), wrestorelimit(), wsetl(), and wvn().

static void wh_ch ( struct generator g,
int  i 
) [static]

Definition at line 50 of file generator.c.

References generator::outbuf, and str_append_ch().

Referenced by wh().

static void wh ( struct generator g,
int  i 
) [static]

Definition at line 54 of file generator.c.

References wh_ch().

Referenced by wlitarray().

static void wi3 ( struct generator g,
int  i 
) [static]

Definition at line 59 of file generator.c.

References wch(), and wi().

Referenced by wp().

static void wvn ( struct generator g,
struct name p 
) [static]

Definition at line 65 of file generator.c.

References name::b, name::count, options::externals_prefix, options::make_lang, generator::options, generator::outbuf, str_append_b(), t_boolean, t_external, t_integer, t_string, name::type, wch(), wi(), and ws().

Referenced by wp(), and wv().

static void wv ( struct generator g,
struct name p 
) [static]

Definition at line 84 of file generator.c.

References options::make_lang, generator::options, t_routine, name::type, ws(), and wvn().

Referenced by generate_AE(), generate_data_address(), and wp().

static void wlitarray ( struct generator g,
symbol p 
) [static]

Definition at line 89 of file generator.c.

References SIZE, wch(), wh(), and ws().

Referenced by wlitref(), and wp().

static void wlitref ( struct generator g,
symbol p 
) [static]

Definition at line 113 of file generator.c.

References generator::declarations, generator::literalstring_count, generator::outbuf, SIZE, wi(), wlitarray(), and ws().

Referenced by generate_data_address(), and wp().

static void wm ( struct generator g  )  [static]

Definition at line 128 of file generator.c.

References generator::margin, and ws().

Referenced by wms(), and wp().

static void wc ( struct generator g,
struct node p 
) [static]

Definition at line 133 of file generator.c.

References name::b, c_divideassign, c_eq, c_ge, c_gr, c_le, c_ls, c_mathassign, c_minusassign, c_multiplyassign, c_ne, c_plusassign, node::line_number, node::name, name_of_token(), generator::outbuf, str_append_b(), node::type, wi(), wnl(), and ws().

Referenced by wp().

static void wms ( struct generator g,
const char *  s 
) [static]

Definition at line 166 of file generator.c.

References wm(), and ws().

Referenced by wbe(), wbs(), wgotol(), and wsetl().

static void wbs ( struct generator g  )  [static]

Definition at line 169 of file generator.c.

References generator::margin, and wms().

Referenced by wp().

static void wbe ( struct generator g  )  [static]

Definition at line 174 of file generator.c.

References generator::line_count, generator::line_labelled, generator::margin, wms(), and wnl().

Referenced by wp().

static void w ( struct generator g,
const char *  s 
) [static]

Definition at line 299 of file generator.c.

References wp().

Referenced by TermList::as_adj_query(), TermList::as_near_query(), TermList::as_opwindow_query(), Xapian::Stem::Internal::find_among(), Xapian::Stem::Internal::find_among_b(), find_word(), generate_AE(), generate_among(), generate_among_table(), generate_amongs(), generate_and(), generate_assignfrom(), generate_atleast(), generate_atmark(), generate_backwards(), generate_close(), generate_create(), generate_create_and_close_templates(), generate_data_address(), generate_define(), generate_do(), generate_dollar(), generate_GO(), generate_GO_grouping(), generate_grouping_table(), generate_head(), generate_header_file(), generate_hop(), generate_insert(), generate_integer_assign(), generate_integer_test(), generate_loop(), generate_next(), generate_not(), generate_or(), generate_program_c(), generate_repeat(), generate_routine_headers(), generate_setlimit(), generate_start_comment(), generate_test(), generate_tomark(), generate_try(), MultiMatch::get_mset(), Xapian::Stem::Internal::in_grouping_b_U(), Xapian::Stem::Internal::in_grouping_U(), make_among(), Xapian::Stem::Internal::out_grouping_b_U(), Xapian::Stem::Internal::out_grouping_U(), MergePostList::recalc_maxweight(), winc(), wk(), wlim(), wrestore(), and wrestorelimit().

static void wk ( struct generator g,
struct node p 
) [static]

Definition at line 183 of file generator.c.

References generator::keep_count, m_forward, node::mode, w(), wi(), and ws().

Referenced by wp().

static void wrestore ( struct generator g,
struct node p,
int  keep_token 
) [static]

Definition at line 193 of file generator.c.

References m_forward, node::mode, w(), wi(), and ws().

Referenced by generate_and(), generate_do(), generate_GO(), generate_not(), generate_or(), generate_repeat(), generate_setlimit(), and wf().

static void wrestorelimit ( struct generator g,
struct node p,
int  keep_token 
) [static]

Definition at line 202 of file generator.c.

References m_forward, node::mode, w(), wi(), and ws().

Referenced by generate_setlimit(), and wf().

static void winc ( struct generator g,
struct node p 
) [static]

Definition at line 211 of file generator.c.

References m_forward, node::mode, and w().

Referenced by wp().

static void wsetl ( struct generator g,
int  n 
) [static]

Definition at line 216 of file generator.c.

References generator::line_count, generator::line_labelled, generator::margin, wch(), wi(), wms(), and wnl().

Referenced by generate_do(), generate_dollar(), generate_GO(), generate_not(), generate_or(), generate_repeat(), and generate_try().

static void wgotol ( struct generator g,
int  n 
) [static]

Definition at line 224 of file generator.c.

References wch(), wi(), wms(), and wnl().

Referenced by generate_or().

static void wf ( struct generator g,
struct node p 
) [static]

Definition at line 228 of file generator.c.

References generator::failure_keep_count, generator::failure_label, generator::label_used, wch(), wi(), wrestore(), wrestorelimit(), ws(), and x_return.

Referenced by wlim(), and wp().

static void wlim ( struct generator g,
struct node p 
) [static]

Definition at line 252 of file generator.c.

References m_forward, node::mode, w(), and wf().

Referenced by wp().

static void wp ( struct generator g,
const char *  s,
struct node p 
) [static]

Definition at line 259 of file generator.c.

References options::externals_prefix, generator::I, generator::L, node::literalstring, options::make_lang, generator::margin, generator::options, generator::S, until, generator::V, wbe(), wbs(), wc(), wch(), wf(), wi(), wi3(), winc(), wk(), wlim(), wlitarray(), wlitref(), wm(), wnl(), ws(), wv(), and wvn().

Referenced by generate_among(), generate_and(), generate_assignfrom(), generate_assignto(), generate_atleast(), generate_atlimit(), generate_atmark(), generate_backwards(), generate_booltest(), generate_call(), generate_debug(), generate_delete(), generate_do(), generate_dollar(), generate_fail(), generate_false(), generate_GO(), generate_GO_grouping(), generate_grouping(), generate_hop(), generate_insert(), generate_integer_assign(), generate_integer_test(), generate_leftslice(), generate_literalstring(), generate_loop(), generate_namedstring(), generate_next(), generate_not(), generate_or(), generate_repeat(), generate_rightslice(), generate_set(), generate_setlimit(), generate_setmark(), generate_slicefrom(), generate_sliceto(), generate_test(), generate_tolimit(), generate_tomark(), generate_try(), generate_unset(), and w().

static void generate_AE ( struct generator g,
struct node p 
) [static]

Definition at line 301 of file generator.c.

References c_cursor, c_divide, c_limit, c_maxint, c_minint, c_minus, c_multiply, c_name, c_neg, c_number, c_plus, c_size, c_sizeof, node::left, m_forward, node::mode, node::name, node::number, node::right, node::type, generator::V, w(), wch(), wi(), ws(), and wv().

Referenced by generate_atleast(), generate_atmark(), generate_hop(), generate_integer_assign(), generate_integer_test(), generate_loop(), and generate_tomark().

static int K_needed ( struct generator g,
struct node p 
) [static]

Definition at line 343 of file generator.c.

References c_bra, c_call, c_debug, c_divideassign, c_dollar, c_eq, c_false, c_ge, c_gr, c_le, c_leftslice, c_ls, c_mathassign, c_minusassign, c_multiplyassign, c_ne, c_plusassign, c_rightslice, c_sliceto, c_true, name::definition, node::left, node::name, node::right, node::type, and until.

Referenced by generate_and(), generate_do(), generate_not(), generate_or(), generate_test(), and generate_try().

static int repeat_score ( struct generator g,
struct node p 
) [static]

Definition at line 381 of file generator.c.

References c_bra, c_call, c_debug, c_divideassign, c_dollar, c_eq, c_ge, c_gr, c_grouping, c_hop, c_le, c_leftslice, c_literalstring, c_ls, c_mathassign, c_minusassign, c_multiplyassign, c_name, c_ne, c_next, c_non, c_plusassign, c_rightslice, c_sliceto, name::definition, node::left, node::name, node::right, node::type, and until.

Referenced by repeat_restore().

static int repeat_restore ( struct generator g,
struct node p 
) [static]

Definition at line 429 of file generator.c.

References repeat_score().

Referenced by generate_GO(), and generate_repeat().

static void generate_bra ( struct generator g,
struct node p 
) [static]

Definition at line 433 of file generator.c.

References generate(), node::left, node::right, and until.

Referenced by generate().

static void generate_and ( struct generator g,
struct node p 
) [static]

Definition at line 438 of file generator.c.

References generate(), K_needed(), generator::keep_count, node::left, node::right, until, w(), wp(), and wrestore().

Referenced by generate().

static void generate_or ( struct generator g,
struct node p 
) [static]

Definition at line 457 of file generator.c.

References generator::failure_keep_count, generator::failure_label, generate(), K_needed(), generator::keep_count, generator::label_used, node::left, new_label(), node::right, until, w(), wgotol(), wp(), wrestore(), and wsetl().

Referenced by generate().

static void generate_backwards ( struct generator g,
struct node p 
) [static]

Definition at line 495 of file generator.c.

References generate(), node::left, w(), and wp().

Referenced by generate().

static void generate_not ( struct generator g,
struct node p 
) [static]

Definition at line 503 of file generator.c.

References generator::failure_keep_count, generator::failure_label, generate(), K_needed(), generator::keep_count, generator::label_used, node::left, new_label(), w(), wp(), wrestore(), and wsetl().

Referenced by generate().

static void generate_try ( struct generator g,
struct node p 
) [static]

Definition at line 540 of file generator.c.

References generator::failure_keep_count, generator::failure_label, generate(), K_needed(), generator::keep_count, generator::label_used, node::left, new_label(), w(), wp(), and wsetl().

Referenced by generate().

static void generate_set ( struct generator g,
struct node p 
) [static]

Definition at line 560 of file generator.c.

References node::name, generator::V, and wp().

Referenced by generate().

static void generate_unset ( struct generator g,
struct node p 
) [static]

Definition at line 564 of file generator.c.

References node::name, generator::V, and wp().

Referenced by generate().

static void generate_fail ( struct generator g,
struct node p 
) [static]

Definition at line 568 of file generator.c.

References generate(), node::left, and wp().

Referenced by generate().

static void generate_test ( struct generator g,
struct node p 
) [static]

Definition at line 575 of file generator.c.

References generate(), K_needed(), generator::keep_count, node::left, m_forward, node::mode, w(), wi(), and wp().

Referenced by generate().

static void generate_do ( struct generator g,
struct node p 
) [static]

Definition at line 597 of file generator.c.

References generator::failure_keep_count, generator::failure_label, generate(), K_needed(), generator::keep_count, generator::label_used, node::left, new_label(), w(), wp(), wrestore(), and wsetl().

Referenced by generate().

static void generate_next ( struct generator g,
struct node p 
) [static]

Definition at line 619 of file generator.c.

References m_forward, node::mode, generator::options, options::utf8, w(), and wp().

Referenced by generate(), and generate_GO().

static void generate_GO_grouping ( struct generator g,
struct node p,
int  is_goto,
int  complement 
) [static]

Definition at line 634 of file generator.c.

References name::grouping, generator::I, grouping::largest_ch, m_forward, node::mode, node::name, generator::options, generator::S, grouping::smallest_ch, options::utf8, generator::V, w(), and wp().

Referenced by generate_GO().

static void generate_GO ( struct generator g,
struct node p,
int  style 
) [static]

Definition at line 656 of file generator.c.

References c_grouping, c_non, generator::failure_keep_count, generator::failure_label, generate(), generate_GO_grouping(), generate_next(), generator::keep_count, generator::label_used, node::left, new_label(), repeat_restore(), node::type, w(), wp(), wrestore(), and wsetl().

Referenced by generate().

static void generate_loop ( struct generator g,
struct node p 
) [static]

Definition at line 706 of file generator.c.

References node::AE, generate(), generate_AE(), node::left, w(), and wp().

Referenced by generate().

static void generate_repeat ( struct generator g,
struct node p,
int  atleast_case 
) [static]

Definition at line 716 of file generator.c.

References generator::failure_keep_count, generator::failure_label, generate(), generator::keep_count, generator::label_used, node::left, new_label(), repeat_restore(), w(), wp(), wrestore(), and wsetl().

Referenced by generate(), and generate_atleast().

static void generate_atleast ( struct generator g,
struct node p 
) [static]

Definition at line 744 of file generator.c.

References node::AE, generator::failure_keep_count, generator::failure_label, generate_AE(), generate_repeat(), generator::label_used, w(), and wp().

Referenced by generate().

static void generate_setmark ( struct generator g,
struct node p 
) [static]

Definition at line 761 of file generator.c.

References node::name, generator::V, and wp().

Referenced by generate().

static void generate_tomark ( struct generator g,
struct node p 
) [static]

Definition at line 766 of file generator.c.

References node::AE, generate_AE(), m_forward, node::mode, generator::S, w(), and wp().

Referenced by generate().

static void generate_atmark ( struct generator g,
struct node p 
) [static]

Definition at line 773 of file generator.c.

References node::AE, generate_AE(), w(), and wp().

Referenced by generate().

static void generate_hop ( struct generator g,
struct node p 
) [static]

Definition at line 778 of file generator.c.

References node::AE, generate_AE(), m_forward, options::make_lang, node::mode, generator::options, generator::S, options::utf8, w(), and wp().

Referenced by generate().

static void generate_delete ( struct generator g,
struct node p 
) [static]

Definition at line 795 of file generator.c.

References wp().

Referenced by generate().

static void generate_tolimit ( struct generator g,
struct node p 
) [static]

Definition at line 805 of file generator.c.

References m_forward, node::mode, generator::S, and wp().

Referenced by generate().

static void generate_atlimit ( struct generator g,
struct node p 
) [static]

Definition at line 810 of file generator.c.

References m_forward, node::mode, generator::S, and wp().

Referenced by generate().

static void generate_leftslice ( struct generator g,
struct node p 
) [static]

Definition at line 816 of file generator.c.

References m_forward, node::mode, generator::S, and wp().

Referenced by generate().

static void generate_rightslice ( struct generator g,
struct node p 
) [static]

Definition at line 821 of file generator.c.

References m_forward, node::mode, generator::S, and wp().

Referenced by generate().

static void generate_assignto ( struct generator g,
struct node p 
) [static]

Definition at line 826 of file generator.c.

References options::make_lang, node::name, generator::options, generator::V, and wp().

Referenced by generate().

static void generate_sliceto ( struct generator g,
struct node p 
) [static]

Definition at line 833 of file generator.c.

References node::name, generator::V, and wp().

Referenced by generate().

static void generate_data_address ( struct generator g,
struct node p 
) [static]

Definition at line 841 of file generator.c.

References grouping::b, node::literalstring, node::name, SIZE, w(), wi(), wlitref(), and wv().

Referenced by generate_assignfrom(), generate_insert(), and generate_slicefrom().

static void generate_insert ( struct generator g,
struct node p,
int  style 
) [static]

Definition at line 851 of file generator.c.

References c_attach, generate_data_address(), m_backward, options::make_lang, node::mode, generator::options, w(), and wp().

Referenced by generate().

static void generate_assignfrom ( struct generator g,
struct node p 
) [static]

Definition at line 870 of file generator.c.

References generate_data_address(), m_forward, options::make_lang, node::mode, generator::options, w(), and wp().

Referenced by generate().

static void generate_slicefrom ( struct generator g,
struct node p 
) [static]

Definition at line 888 of file generator.c.

References generate_data_address(), and wp().

Referenced by generate().

static void generate_setlimit ( struct generator g,
struct node p 
) [static]

Definition at line 898 of file generator.c.

References node::aux, generate(), generator::keep_count, node::left, m_forward, node::mode, w(), wi(), wp(), wrestore(), and wrestorelimit().

Referenced by generate().

static void generate_dollar ( struct generator g,
struct node p 
) [static]

Definition at line 922 of file generator.c.

References generator::failure_keep_count, generator::failure_label, generate(), generator::I, generator::keep_count, generator::label_used, node::left, options::make_lang, node::name, new_label(), generator::options, generator::S, generator::V, vars, w(), wp(), and wsetl().

Referenced by generate().

static void generate_integer_assign ( struct generator g,
struct node p,
char *  s 
) [static]

Definition at line 975 of file generator.c.

References node::AE, generate_AE(), node::name, generator::S, generator::V, w(), and wp().

Referenced by generate().

static void generate_integer_test ( struct generator g,
struct node p,
char *  s 
) [static]

Definition at line 982 of file generator.c.

References node::AE, generate_AE(), node::name, generator::S, generator::V, w(), and wp().

Referenced by generate().

static void generate_call ( struct generator g,
struct node p 
) [static]

Definition at line 989 of file generator.c.

References generator::failure_keep_count, generator::failure_label, node::name, generator::V, wp(), and x_return.

Referenced by generate().

static void generate_grouping ( struct generator g,
struct node p,
int  complement 
) [static]

Definition at line 1003 of file generator.c.

References name::grouping, generator::I, grouping::largest_ch, m_forward, node::mode, node::name, generator::options, generator::S, grouping::smallest_ch, options::utf8, generator::V, and wp().

Referenced by generate().

static void generate_namedstring ( struct generator g,
struct node p 
) [static]

Definition at line 1015 of file generator.c.

References m_forward, node::mode, node::name, generator::S, generator::V, and wp().

Referenced by generate().

static void generate_literalstring ( struct generator g,
struct node p 
) [static]

Definition at line 1022 of file generator.c.

References grouping::b, generator::I, generator::L, node::literalstring, m_forward, node::mode, generator::S, SIZE, and wp().

Referenced by generate().

static void generate_define ( struct generator g,
struct node p 
) [static]

Definition at line 1051 of file generator.c.

References node::amongvar_needed, generate(), node::left, m_forward, options::make_lang, node::mode, options::name, node::name, generator::next_label, generator::options, generator::S, t_routine, name::type, generator::V, w(), ws(), and x_return.

Referenced by generate().

static void generate_substring ( struct generator g,
struct node p 
) [static]

Definition at line 1076 of file generator.c.

References node::among, amongvec::b, among::b, generator::I, among::literalstring_count, m_forward, node::mode, among::number, amongvec::p, generator::S, amongvec::size, and size.

Referenced by generate(), and generate_among().

static void generate_among ( struct generator g,
struct node p 
) [static]

Definition at line 1222 of file generator.c.

References node::among, c_bra, c_literalstring, among::command_count, generate(), generate_substring(), generator::I, node::left, node::right, among::starter, among::substring, node::type, unless, until, w(), and wp().

Referenced by generate().

static void generate_booltest ( struct generator g,
struct node p 
) [static]

Definition at line 1248 of file generator.c.

References node::name, generator::V, and wp().

Referenced by generate().

static void generate_false ( struct generator g,
struct node p 
) [static]

Definition at line 1254 of file generator.c.

References wp().

Referenced by generate().

static void generate_debug ( struct generator g,
struct node p 
) [static]

Definition at line 1259 of file generator.c.

References generator::debug_count, generator::I, node::line_number, and wp().

Referenced by generate().

static void generate_start_comment ( struct generator g  )  [static]

Definition at line 1343 of file generator.c.

References options::make_lang, generator::options, and w().

Referenced by generate_program_c().

static void generate_head ( struct generator g  )  [static]

Definition at line 1351 of file generator.c.

References options::make_lang, generator::options, options::output_file, options::runtime_path, among::s, w(), wch(), and ws().

Referenced by generate_program_c().

static void generate_routine_headers ( struct generator g  )  [static]

Definition at line 1378 of file generator.c.

References generator::analyser, options::make_lang, analyser::names, name::next, generator::options, t_external, t_routine, name::type, until, generator::V, and w().

Referenced by generate_program_c().

static void generate_among_table ( struct generator g,
struct among x 
) [static]

Definition at line 1405 of file generator.c.

References name::among_func_count, amongvec::b, among::b, amongvec::function, among::have_funcs, amongvec::i, generator::I, generator::L, among::literalstring_count, among::number, amongvec::result, generator::S, amongvec::size, unless, w(), and wi().

Referenced by generate_amongs().

static void generate_amongs ( struct generator g  )  [static]

Definition at line 1474 of file generator.c.

References name::among_func_count, analyser::amongs, generator::analyser, generate_among_table(), generator::I, options::name, analyser::names, among::next, name::next, generator::options, name::routine_called_from_among, generator::S, t_routine, name::type, until, generator::V, and w().

Referenced by generate_program_c().

static void set_bit ( symbol b,
int  i 
) [static]

Definition at line 1515 of file generator.c.

References name::b.

Referenced by generate_grouping_table().

static void generate_grouping_table ( struct generator g,
struct grouping q 
) [static]

Definition at line 1517 of file generator.c.

References grouping::b, name::b, create_b(), grouping::largest_ch, lose_b(), grouping::name, set_bit(), SIZE, size, grouping::smallest_ch, generator::V, w(), and wi().

Referenced by generate_groupings().

static void generate_groupings ( struct generator g  )  [static]

Definition at line 1541 of file generator.c.

References generator::analyser, generate_grouping_table(), analyser::groupings, grouping::next, and until.

Referenced by generate_program_c().

static void generate_create ( struct generator g  )  [static]

Definition at line 1549 of file generator.c.

References generator::analyser, generator::I, options::make_lang, options::name, analyser::name_count, analyser::names, name::next, generator::options, generator::S, t_boolean, t_integer, t_routine, t_string, name::type, generator::V, and w().

Referenced by generate_program_c().

static void generate_close ( struct generator g  )  [static]

Definition at line 1594 of file generator.c.

References generator::analyser, generator::I, options::make_lang, options::name, analyser::name_count, analyser::names, name::next, generator::options, options::output_file, generator::S, t_string, name::type, generator::V, and w().

Referenced by generate_program_c().

static void generate_create_and_close_templates ( struct generator g  )  [static]

Definition at line 1633 of file generator.c.

References w().

Referenced by generate_header_file(), and generate_program_c().

static void generate_header_file ( struct generator g  )  [static]

Definition at line 1640 of file generator.c.

References generator::analyser, name::b, name::count, generate_create_and_close_templates(), generator::I, options::make_lang, options::name, analyser::names, name::next, generator::options, generator::outbuf, options::parent_class_name, generator::S, str_append_b(), t_boolean, t_external, t_integer, t_routine, t_string, name::type, until, generator::V, options::variables_prefix, and w().

Referenced by generate_program_c().

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_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().


Variable Documentation

const char* vars[] = { "p", "c", "l", "lb", "bra", "ket", NULL } [static]

Definition at line 920 of file generator.c.

Referenced by generate_dollar().


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