languages/compiler/tokeniser.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "header.h"
#include "syswords.h"

Include dependency graph for tokeniser.c:

Go to the source code of this file.

Classes

struct  system_word

Functions

static int smaller (int a, int b)
symbolget_input (symbol *p)
static void error (struct tokeniser *t, char *s1, int n, symbol *p, char *s2)
static void error1 (struct tokeniser *t, char *s)
static void error2 (struct tokeniser *t, char *s)
static int compare_words (int m, symbol *p, int n, byte *q)
static int find_word (int n, symbol *p)
static int get_number (int n, symbol *p)
static int eq_s (struct tokeniser *t, char *s)
static int white_space (struct tokeniser *t, int ch)
static symbolfind_in_m (struct tokeniser *t, int n, symbol *p)
static int read_literal_string (struct tokeniser *t, int c)
static int next_token (struct tokeniser *t)
static int next_char (struct tokeniser *t)
static int next_real_char (struct tokeniser *t)
static void read_chars (struct tokeniser *t)
static int decimal_to_num (int ch)
static int hex_to_num (int ch)
static void convert_numeric_string (struct tokeniser *t, symbol *p, int base)
int read_token (struct tokeniser *t)
bytename_of_token (int code)
tokenisercreate_tokeniser (symbol *p)
void close_tokeniser (struct tokeniser *t)


Function Documentation

static int smaller ( int  a,
int  b 
) [static]

Definition at line 19 of file tokeniser.c.

Referenced by next_token().

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

static void error ( struct tokeniser t,
char *  s1,
int  n,
symbol p,
char *  s2 
) [static]

Definition at line 43 of file tokeniser.c.

References tokeniser::error_count, tokeniser::get_depth, tokeniser::line_number, and unless.

static void error1 ( struct tokeniser t,
char *  s 
) [static]

Definition at line 58 of file tokeniser.c.

References error().

Referenced by convert_numeric_string(), read_literal_string(), and read_token().

static void error2 ( struct tokeniser t,
char *  s 
) [static]

Definition at line 62 of file tokeniser.c.

References error().

static int compare_words ( int  m,
symbol p,
int  n,
byte q 
) [static]

Definition at line 66 of file tokeniser.c.

References unless.

Referenced by find_word().

static int find_word ( int  n,
symbol p 
) [static]

Definition at line 77 of file tokeniser.c.

References system_word::code, compare_words(), repeat, vocab, and w().

Referenced by next_token().

static int get_number ( int  n,
symbol p 
) [static]

Definition at line 90 of file tokeniser.c.

Referenced by next_token().

static int eq_s ( struct tokeniser t,
char *  s 
) [static]

Definition at line 96 of file tokeniser.c.

References tokeniser::c, tokeniser::p, and SIZE.

Referenced by read_token().

static int white_space ( struct tokeniser t,
int  ch 
) [static]

Definition at line 106 of file tokeniser.c.

References tokeniser::line_number.

Referenced by next_real_char(), next_token(), read_chars(), and read_literal_string().

static symbol* find_in_m ( struct tokeniser t,
int  n,
symbol p 
) [static]

Definition at line 116 of file tokeniser.c.

References tokeniser::m_pairs, m_pair::name, m_pair::next, repeat, SIZE, and m_pair::value.

Referenced by read_literal_string().

static int read_literal_string ( struct tokeniser t,
int  c 
) [static]

Definition at line 128 of file tokeniser.c.

References add_to_b(), tokeniser::b, error(), error1(), error2(), find_in_m(), tokeniser::m_end, tokeniser::m_start, tokeniser::p, repeat, SIZE, unless, and white_space().

Referenced by next_token().

static int next_token ( struct tokeniser t  )  [static]

Definition at line 171 of file tokeniser.c.

References tokeniser::b, tokeniser::c, c_literalstring, c_name, c_number, error(), find_word(), get_number(), move_to_b(), tokeniser::number, tokeniser::p, read_literal_string(), repeat, SIZE, smaller(), and white_space().

Referenced by read_token().

static int next_char ( struct tokeniser t  )  [static]

Definition at line 217 of file tokeniser.c.

References tokeniser::c, tokeniser::p, and SIZE.

Referenced by next_real_char(), and read_chars().

static int next_real_char ( struct tokeniser t  )  [static]

Definition at line 222 of file tokeniser.c.

References next_char(), repeat, and white_space().

Referenced by read_chars(), and read_token().

static void read_chars ( struct tokeniser t  )  [static]

Definition at line 230 of file tokeniser.c.

References tokeniser::b2, tokeniser::c, error2(), move_to_b(), next_char(), next_real_char(), tokeniser::p, repeat, and white_space().

Referenced by read_token().

static int decimal_to_num ( int  ch  )  [static]

Definition at line 243 of file tokeniser.c.

Referenced by convert_numeric_string().

static int hex_to_num ( int  ch  )  [static]

Definition at line 248 of file tokeniser.c.

Referenced by convert_numeric_string().

static void convert_numeric_string ( struct tokeniser t,
symbol p,
int  base 
) [static]

Definition at line 254 of file tokeniser.c.

References decimal_to_num(), error1(), hex_to_num(), put_utf8(), repeat, SIZE, Xapian::Unicode::tolower(), unless, tokeniser::utf8, and tokeniser::widechars.

Referenced by read_token().

int read_token ( struct tokeniser t  ) 

Definition at line 300 of file tokeniser.c.

References add_to_b(), include::b, tokeniser::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, tokeniser::next, include::next, next_real_char(), next_token(), input::p, tokeniser::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().

struct tokeniser* create_tokeniser ( symbol p  )  [read]

Definition at line 428 of file tokeniser.c.

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

Referenced by main().

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, input::next, tokeniser::next, m_pair::next, until, and m_pair::value.

Referenced by main().


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