reader.c File Reference

#include "defs.h"

Include dependency graph for reader.c:

Go to the source code of this file.

Defines

#define LINESIZE   100

Functions

 cachec (int c)
 get_line ()
char * dup_line ()
 skip_comment ()
int nextc ()
int keyword ()
 copy_ident ()
 copy_text ()
 copy_union ()
int hexval (int c)
bucketget_literal ()
int is_reserved (char *name)
bucketget_name ()
int get_number ()
char * get_tag ()
 declare_tokens (int assoc)
 declare_types ()
 declare_start ()
 read_declarations ()
 initialize_grammar ()
 expand_items ()
 expand_rules ()
 advance_to_start ()
 start_rule (bucket *bp, int s_lineno)
 end_rule ()
 insert_empty_rule ()
 add_symbol ()
 copy_action ()
int mark_symbol ()
 read_grammar ()
 free_tags ()
 pack_names ()
 check_symbols ()
 pack_symbols ()
 pack_grammar ()
 print_grammar ()
 reader ()

Variables

char * cache
int cinc
int cache_size
int ntags
int tagmax
char ** tag_table
char saw_eof
char unionized
char * cptr
char * line
int linesize
bucketgoal
int prec
int gensym
char last_was_action
int maxitems
bucket ** pitem
int maxrules
bucket ** plhs
int name_pool_size
char * name_pool
char line_format [] = "#line %d \"%s\"\n"


Define Documentation

#define LINESIZE   100
 

Definition at line 8 of file reader.c.

Referenced by get_line().


Function Documentation

add_symbol  ) 
 

Definition at line 1148 of file reader.c.

References bp, c, cptr, end_rule(), expand_items(), get_literal(), get_name(), insert_empty_rule(), last_was_action, lineno, maxitems, nextc(), nitems, pitem, and start_rule().

Referenced by read_grammar().

advance_to_start  ) 
 

Definition at line 1035 of file reader.c.

References bp, c, copy_text(), cptr, declare_start(), keyword(), lineno, MARK, nextc(), no_grammar(), START, syntax_error(), and TEXT.

Referenced by read_grammar().

cachec int  c  ) 
 

Definition at line 37 of file reader.c.

References assert, cache, cache_size, cinc, no_space(), and REALLOC.

Referenced by get_name(), get_tag(), and keyword().

check_symbols  ) 
 

Definition at line 1519 of file reader.c.

References bp, bucket::class, first_symbol, goal, bucket::name, TERM, undefined_goal(), undefined_symbol_warning(), and UNKNOWN.

Referenced by reader().

copy_action  ) 
 

Definition at line 1179 of file reader.c.

References action_file, c, cptr, d_line(), dollar_error(), dollar_warning(), dup_line(), f, fprintf(), FREE, get_number(), get_tag(), i, input_file_name, insert_empty_rule(), isdigit, last_was_action, lflag, line_format, lineno, loop, nitems, nrules, pitem, and quote().

Referenced by read_grammar().

copy_ident  ) 
 

Definition at line 271 of file reader.c.

References c, cptr, EOF, f, fprintf(), lineno, nextc(), outline, output_file, syntax_error(), and unexpected_EOF().

Referenced by read_declarations().

copy_text  ) 
 

Definition at line 300 of file reader.c.

References c, c_line, cptr, dup_line(), f, fprintf(), FREE, get_line(), input_file_name, lflag, line_format, lineno, loop, putc, quote(), text_file, unterminated_comment(), unterminated_string(), and unterminated_text().

Referenced by advance_to_start(), and read_declarations().

copy_union  ) 
 

Definition at line 431 of file reader.c.

References c, c_line, cptr, dflag, dup_line(), fprintf(), FREE, get_line(), input_file_name, lflag, line_format, lineno, loop, over_unionized(), putc, quote(), text_file, union_file, unionized, unterminated_comment(), unterminated_string(), and unterminated_union().

Referenced by read_declarations().

declare_start  ) 
 

Definition at line 917 of file reader.c.

References bp, c, cptr, EOF, get_name(), goal, isalpha, lineno, nextc(), restarted_warning(), syntax_error(), TERM, terminal_start(), and unexpected_EOF().

Referenced by advance_to_start(), and read_declarations().

declare_tokens int  assoc  ) 
 

Definition at line 827 of file reader.c.

References bp, c, EOF, get_literal(), get_name(), get_tag(), goal, if(), isalpha, nextc(), prec, retyped_warning(), TERM, tokenized_start(), and unexpected_EOF().

Referenced by read_declarations().

declare_types  ) 
 

Definition at line 889 of file reader.c.

References bp, c, cptr, EOF, get_literal(), get_name(), get_tag(), isalpha, lineno, nextc(), retyped_warning(), syntax_error(), and unexpected_EOF().

Referenced by read_declarations().

char* dup_line  ) 
 

Definition at line 99 of file reader.c.

References MALLOC, no_space(), p, s, and t.

Referenced by copy_action(), copy_text(), copy_union(), get_literal(), get_tag(), and skip_comment().

end_rule  ) 
 

Definition at line 1100 of file reader.c.

References default_action_warning(), expand_items(), i, last_was_action, maxitems, nitems, nrules, pitem, and plhs.

Referenced by add_symbol(), and read_grammar().

expand_items  ) 
 

Definition at line 1015 of file reader.c.

References maxitems, no_space(), pitem, and REALLOC.

Referenced by add_symbol(), end_rule(), and insert_empty_rule().

expand_rules  ) 
 

Definition at line 1023 of file reader.c.

References maxrules, no_space(), plhs, rassoc, REALLOC, and rprec.

Referenced by insert_empty_rule(), and start_rule().

free_tags  ) 
 

Definition at line 1479 of file reader.c.

References assert, FREE, i, and ntags.

Referenced by reader().

get_line  ) 
 

Definition at line 52 of file reader.c.

References c, cptr, EOF, f, FREE, getc, i, input_file, line, lineno, LINESIZE, linesize, MALLOC, no_space(), and saw_eof.

Referenced by copy_text(), copy_union(), file_insert(), get_literal(), get_prog(), load_file(), main(), match(), and nextc().

bucket* get_literal  ) 
 

Definition at line 586 of file reader.c.

References bp, c, cinc, cptr, dup_line(), get_line(), i, IS_OCTAL, lineno, n, quote(), s, and unterminated_string().

Referenced by add_symbol(), declare_tokens(), declare_types(), and mark_symbol().

bucket* get_name  ) 
 

Definition at line 747 of file reader.c.

References c, cache, cachec(), cinc, cptr, IS_IDENT, is_reserved(), lookup(), NUL, and used_reserved().

Referenced by add_symbol(), declare_start(), declare_tokens(), declare_types(), mark_symbol(), parse_path(), and servxcheck().

int get_number void   ) 
 

Definition at line 763 of file reader.c.

References c, cptr, and isdigit.

Referenced by copy_action(), get_codepage(), get_toupper(), GOTO(), set_misc_flags(), and set_var().

char* get_tag  ) 
 

Definition at line 777 of file reader.c.

References c, cache, cachec(), cinc, cptr, dup_line(), EOF, i, illegal_tag(), IS_IDENT, isalpha, lineno, nextc(), ntags, NUL, strcmp, tag_table, and unexpected_EOF().

Referenced by copy_action(), declare_tokens(), and declare_types().

int hexval int  c  ) 
 

Definition at line 572 of file reader.c.

initialize_grammar  ) 
 

Definition at line 984 of file reader.c.

References MALLOC, maxitems, maxrules, nitems, no_space(), nrules, pitem, plhs, rassoc, and rprec.

Referenced by read_grammar().

insert_empty_rule  ) 
 

Definition at line 1119 of file reader.c.

References assert, bp, cache, expand_items(), expand_rules(), gensym, last_symbol, make_bucket(), maxitems, maxrules, bucket::next, nitems, NONTERM, nrules, pitem, plhs, rassoc, rprec, sprintf(), and bucket::tag.

Referenced by add_symbol(), and copy_action().

int is_reserved char *  name  ) 
 

Definition at line 725 of file reader.c.

References isdigit, NUL, and strcmp.

Referenced by get_name(), and get_slots().

int keyword  ) 
 

Definition at line 209 of file reader.c.

References c, cachec(), cinc, cptr, isalpha, isdigit, isupper, and tolower.

Referenced by advance_to_start(), exec_one(), main(), and read_declarations().

int mark_symbol  ) 
 

Definition at line 1403 of file reader.c.

References bp, c, cptr, get_literal(), get_name(), IS_IDENT, isalpha, lineno, nextc(), nrules, prec_redeclared(), rassoc, rprec, syntax_error(), and UNDEFINED.

int nextc void   ) 
 

Definition at line 147 of file reader.c.

References cptr, EOF, get_line(), s, and skip_comment().

Referenced by add_symbol(), advance_to_start(), copy_ident(), declare_start(), declare_tokens(), declare_types(), get_tag(), mark_symbol(), read_declarations(), read_grammar(), read_word(), and skipwhite().

pack_grammar  ) 
 

Definition at line 1661 of file reader.c.

References bucket::assoc, goal, i, index(), bucket::index, j, MALLOC, nitems, no_space(), nrules, pitem, plhs, prec, rassoc, REALLOC, ritem, rlhs, rprec, rrhs, start_symbol, and TERM.

Referenced by reader().

pack_names  ) 
 

Definition at line 1494 of file reader.c.

References bp, first_symbol, FREE, MALLOC, name_pool, name_pool_size, no_space(), p, strcpy(), strlen(), and t.

Referenced by reader().

pack_symbols  ) 
 

Definition at line 1537 of file reader.c.

References bp, first_symbol, i, j, k, nsyms, ntokens, and TERM.

Referenced by reader().

print_grammar  ) 
 

Definition at line 1720 of file reader.c.

References f, fprintf(), i, j, k, nrules, rlhs, strlen(), symbol_name, verbose_file, and vflag.

Referenced by reader().

read_declarations  ) 
 

Definition at line 935 of file reader.c.

References c, cache, cache_size, copy_ident(), copy_text(), copy_union(), cptr, declare_start(), declare_tokens(), declare_types(), EOF, IDENT, k, keyword(), LEFT, lineno, MALLOC, MARK, nextc(), no_space(), NONASSOC, RIGHT, START, syntax_error(), TEXT, TYPE, unexpected_EOF(), and UNION.

Referenced by reader().

read_grammar  ) 
 

Definition at line 1446 of file reader.c.

References add_symbol(), advance_to_start(), c, copy_action(), cptr, end_rule(), EOF, initialize_grammar(), isalpha, nextc(), nrules, plhs, and start_rule().

Referenced by reader().

reader  ) 
 

Definition at line 1756 of file reader.c.

References banner, check_symbols(), create_symbol_table(), free_symbol_table(), free_symbols(), free_tags(), pack_grammar(), pack_names(), pack_symbols(), print_grammar(), read_declarations(), read_grammar(), and write_section().

Referenced by doit(), main(), and quit().

skip_comment  ) 
 

Definition at line 116 of file reader.c.

References cptr, dup_line(), FREE, lineno, and s.

Referenced by nextc().

start_rule bucket bp,
int  s_lineno
 

Definition at line 1085 of file reader.c.

References expand_rules(), maxrules, NONTERM, nrules, plhs, rassoc, rprec, TERM, terminal_lhs(), and UNDEFINED.

Referenced by add_symbol(), and read_grammar().


Variable Documentation

char* cache
 

Definition at line 10 of file reader.c.

Referenced by _addHash(), addEndEntry(), addFreeEntry(), addNameToHash(), addUsedEntry(), alloc_cache_ent(), allocDirCacheEntry(), arp_init(), arp_ioctl(), cachec(), checkXYZ(), clear_vses(), dir_write(), freeDirCache(), freeDirCacheRange(), get_block(), get_name(), get_tag(), growDirCache(), hashDce(), insert_empty_rule(), isHashed(), lookupForInsert(), lookupInDircache(), main(), mergeFreeSlots(), process_arp_pkt(), read_declarations(), vfat_lookup(), vfat_lookup_loop_common(), vfat_lookup_loop_for_insert(), vfat_lookup_loop_for_read(), and write_vfat().

int cache_size
 

Definition at line 11 of file reader.c.

Referenced by cachec(), flush_fat(), read_declarations(), and read_fat().

int cinc
 

Definition at line 11 of file reader.c.

Referenced by cachec(), get_literal(), get_name(), get_tag(), and keyword().

char* cptr
 

Definition at line 17 of file reader.c.

Referenced by add_symbol(), advance_to_start(), copy_action(), copy_ident(), copy_text(), copy_union(), declare_start(), declare_types(), get_line(), get_literal(), get_name(), get_number(), get_tag(), keyword(), mark_symbol(), nextc(), output_trailing_text(), read_declarations(), read_grammar(), and skip_comment().

int gensym
 

Definition at line 22 of file reader.c.

Referenced by insert_empty_rule().

bucket* goal
 

Definition at line 20 of file reader.c.

Referenced by check_symbols(), declare_start(), declare_tokens(), down_line(), find_final_state(), and pack_grammar().

char last_was_action
 

Definition at line 23 of file reader.c.

Referenced by add_symbol(), copy_action(), and end_rule().

char * line
 

Definition at line 17 of file reader.c.

char line_format[] = "#line %d \"%s\"\n"
 

Definition at line 34 of file reader.c.

Referenced by copy_action(), copy_text(), copy_union(), output_semantic_actions(), output_stored_text(), and output_trailing_text().

int linesize
 

Definition at line 18 of file reader.c.

Referenced by get_line().

int maxitems
 

Definition at line 25 of file reader.c.

Referenced by add_symbol(), end_rule(), expand_items(), initialize_grammar(), and insert_empty_rule().

int maxrules
 

Definition at line 28 of file reader.c.

Referenced by expand_rules(), initialize_grammar(), insert_empty_rule(), and start_rule().

char* name_pool
 

Definition at line 32 of file reader.c.

Referenced by pack_names().

int name_pool_size
 

Definition at line 31 of file reader.c.

Referenced by pack_names().

int ntags
 

Definition at line 13 of file reader.c.

Referenced by free_tags(), get_tag(), and output_stype().

bucket** pitem
 

Definition at line 26 of file reader.c.

Referenced by add_symbol(), copy_action(), end_rule(), expand_items(), initialize_grammar(), insert_empty_rule(), and pack_grammar().

bucket** plhs
 

Definition at line 29 of file reader.c.

Referenced by end_rule(), expand_rules(), initialize_grammar(), insert_empty_rule(), pack_grammar(), read_grammar(), and start_rule().

int prec
 

Definition at line 21 of file reader.c.

Referenced by declare_tokens(), doformat(), and pack_grammar().

char saw_eof
 

Definition at line 16 of file reader.c.

Referenced by get_line().

char** tag_table
 

Definition at line 14 of file reader.c.

Referenced by get_tag().

int tagmax
 

Definition at line 13 of file reader.c.

char unionized
 

Definition at line 16 of file reader.c.

Referenced by copy_union(), and output_stype().


Generated on Fri Apr 14 22:59:56 2006 for minix by  doxygen 1.4.6