|
Berkeley YACC
1993-03-03
Berkeley's version of Yet Another Compiler Compiler
|
#include "defs.h"
Include dependency graph for reader.c:Go to the source code of this file.
Macros | |
| #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) |
| bucket * | get_literal () |
| int | is_reserved (char *name) |
| bucket * | get_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 |
| bucket * | goal |
| 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 LINESIZE 100 |
Definition at line 8 of file reader.c.
Referenced by get_line().
| add_symbol | ( | ) |
Definition at line 1148 of file reader.c.
References cptr, end_rule(), expand_items(), get_literal(), get_name(), insert_empty_rule(), last_was_action, lineno, maxitems, nextc(), nitems, and start_rule().
Referenced by read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| advance_to_start | ( | ) |
Definition at line 1035 of file reader.c.
References bucket::class, copy_text(), cptr, declare_start(), get_name(), keyword(), line, lineno, MARK, bucket::name, nextc(), no_grammar(), START, start_rule(), syntax_error(), TERM, terminal_start(), TEXT, and unexpected_EOF().
Referenced by read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| cachec | ( | int | c | ) |
Definition at line 37 of file reader.c.
References cache, cache_size, cinc, no_space(), and REALLOC.
Referenced by get_literal(), get_name(), get_tag(), and keyword().
Here is the call graph for this function:
Here is the caller graph for this function:| check_symbols | ( | ) |
Definition at line 1532 of file reader.c.
References bucket::class, first_symbol, bucket::name, bucket::next, TERM, undefined_goal(), undefined_symbol_warning(), and UNKNOWN.
Referenced by reader().
Here is the call graph for this function:
Here is the caller graph for this function:| copy_action | ( | ) |
Definition at line 1179 of file reader.c.
References action_file, cptr, dollar_error(), dollar_warning(), dup_line(), FREE, get_line(), get_number(), get_tag(), input_file_name, insert_empty_rule(), last_was_action, lflag, line, line_format, lineno, nitems, nrules, ntags, bucket::tag, unknown_rhs(), unterminated_action(), unterminated_comment(), unterminated_string(), untyped_lhs(), and untyped_rhs().
Referenced by read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| copy_ident | ( | ) |
Definition at line 271 of file reader.c.
References cptr, line, lineno, nextc(), outline, output_file, syntax_error(), and unexpected_EOF().
Referenced by read_declarations().
Here is the call graph for this function:
Here is the caller graph for this function:| copy_text | ( | ) |
Definition at line 300 of file reader.c.
References cptr, dup_line(), FREE, get_line(), input_file_name, lflag, line, line_format, lineno, text_file, unterminated_comment(), unterminated_string(), and unterminated_text().
Referenced by advance_to_start(), and read_declarations().
Here is the call graph for this function:
Here is the caller graph for this function:| copy_union | ( | ) |
Definition at line 431 of file reader.c.
References cptr, dflag, dup_line(), FREE, get_line(), input_file_name, lflag, line, line_format, lineno, over_unionized(), text_file, union_file, unionized, unterminated_comment(), unterminated_string(), and unterminated_union().
Referenced by read_declarations().
Here is the call graph for this function:
Here is the caller graph for this function:| declare_start | ( | ) |
Definition at line 917 of file reader.c.
References bucket::class, cptr, get_name(), line, lineno, bucket::name, nextc(), restarted_warning(), syntax_error(), TERM, terminal_start(), and unexpected_EOF().
Referenced by advance_to_start(), and read_declarations().
Here is the call graph for this function:
Here is the caller graph for this function:| declare_tokens | ( | int | assoc | ) |
Definition at line 827 of file reader.c.
References bucket::assoc, bucket::class, get_literal(), get_name(), get_number(), get_tag(), bucket::name, nextc(), prec, bucket::prec, reprec_warning(), retyped_warning(), revalued_warning(), bucket::tag, TERM, TOKEN, tokenized_start(), UNDEFINED, unexpected_EOF(), shorts::value, and bucket::value.
Referenced by read_declarations().
Here is the call graph for this function:
Here is the caller graph for this function:| declare_types | ( | ) |
Definition at line 889 of file reader.c.
References cptr, get_literal(), get_name(), get_tag(), line, lineno, bucket::name, nextc(), retyped_warning(), syntax_error(), bucket::tag, and unexpected_EOF().
Referenced by read_declarations().
Here is the call graph for this function:
Here is the caller graph for this function:| char* dup_line | ( | ) |
Definition at line 99 of file reader.c.
References line, MALLOC, and no_space().
Referenced by copy_action(), copy_text(), copy_union(), get_literal(), get_tag(), and skip_comment().
Here is the call graph for this function:
Here is the caller graph for this function:| end_rule | ( | ) |
Definition at line 1100 of file reader.c.
References default_action_warning(), expand_items(), last_was_action, maxitems, nitems, and nrules.
Referenced by add_symbol(), and read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| expand_items | ( | ) |
Definition at line 1015 of file reader.c.
References maxitems, no_space(), and REALLOC.
Referenced by add_symbol(), end_rule(), and insert_empty_rule().
Here is the call graph for this function:
Here is the caller graph for this function:| expand_rules | ( | ) |
Definition at line 1023 of file reader.c.
References maxrules, no_space(), rassoc, REALLOC, and rprec.
Referenced by insert_empty_rule(), and start_rule().
Here is the call graph for this function:
Here is the caller graph for this function:| free_tags | ( | ) |
| get_line | ( | ) |
Definition at line 52 of file reader.c.
References cptr, FREE, input_file, line, lineno, LINESIZE, linesize, MALLOC, no_space(), REALLOC, and saw_eof.
Referenced by copy_action(), copy_text(), copy_union(), get_literal(), nextc(), and skip_comment().
Here is the call graph for this function:
Here is the caller graph for this function:| bucket* get_literal | ( | ) |
Definition at line 586 of file reader.c.
References cache, cachec(), cinc, bucket::class, cptr, dup_line(), FREE, get_line(), hexval(), illegal_character(), IS_OCTAL, line, lineno, lookup(), MALLOC, MAXCHAR, no_space(), NUL, TERM, UNDEFINED, unterminated_string(), and bucket::value.
Referenced by add_symbol(), declare_tokens(), declare_types(), and mark_symbol().
Here is the call graph for this function:
Here is the caller graph for this function:| bucket* get_name | ( | ) |
Definition at line 747 of file reader.c.
References cache, cachec(), cinc, cptr, IS_IDENT, is_reserved(), lookup(), NUL, and used_reserved().
Referenced by add_symbol(), advance_to_start(), declare_start(), declare_tokens(), declare_types(), and mark_symbol().
Here is the call graph for this function:
Here is the caller graph for this function:| int get_number | ( | ) |
Definition at line 763 of file reader.c.
References cptr.
Referenced by copy_action(), and declare_tokens().
Here is the caller graph for this function:| char* get_tag | ( | ) |
Definition at line 777 of file reader.c.
References cache, cachec(), cinc, cptr, dup_line(), FREE, illegal_tag(), IS_IDENT, line, lineno, MALLOC, nextc(), no_space(), ntags, NUL, REALLOC, strcpy(), tag_table, tagmax, and unexpected_EOF().
Referenced by copy_action(), declare_tokens(), and declare_types().
Here is the call graph for this function:
Here is the caller graph for this function:| int hexval | ( | int | c | ) |
Definition at line 572 of file reader.c.
Referenced by get_literal().
Here is the caller graph for this function:| initialize_grammar | ( | ) |
Definition at line 984 of file reader.c.
References MALLOC, maxitems, maxrules, nitems, no_space(), nrules, rassoc, rprec, and TOKEN.
Referenced by read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| insert_empty_rule | ( | ) |
Definition at line 1119 of file reader.c.
References cache, bucket::class, expand_items(), expand_rules(), gensym, last_symbol, make_bucket(), maxitems, maxrules, bucket::next, nitems, NONTERM, nrules, rassoc, rprec, bucket::tag, and TOKEN.
Referenced by add_symbol(), and copy_action().
Here is the call graph for this function:
Here is the caller graph for this function:| int is_reserved | ( | char * | name | ) |
Definition at line 725 of file reader.c.
References NUL.
Referenced by get_name().
Here is the caller graph for this function:| int keyword | ( | ) |
Definition at line 209 of file reader.c.
References cache, cachec(), cinc, cptr, IDENT, LEFT, line, lineno, MARK, NONASSOC, NUL, RIGHT, START, syntax_error(), TEXT, TOKEN, TYPE, and UNION.
Referenced by advance_to_start(), and read_declarations().
Here is the call graph for this function:
Here is the caller graph for this function:| int mark_symbol | ( | ) |
Definition at line 1403 of file reader.c.
References bucket::assoc, cptr, get_literal(), get_name(), IS_IDENT, line, lineno, nextc(), nrules, bucket::prec, prec_redeclared(), rassoc, rprec, syntax_error(), and UNDEFINED.
Referenced by read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| int nextc | ( | ) |
Definition at line 147 of file reader.c.
References cptr, get_line(), line, and skip_comment().
Referenced by add_symbol(), advance_to_start(), copy_ident(), declare_start(), declare_tokens(), declare_types(), get_tag(), mark_symbol(), read_declarations(), and read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| print_grammar | ( | ) |
Definition at line 1739 of file reader.c.
References nrules, ritem, rlhs, symbol_name, verbose_file, and vflag.
Referenced by reader().
Here is the caller graph for this function:| read_declarations | ( | ) |
Definition at line 935 of file reader.c.
References cache, cache_size, copy_ident(), copy_text(), copy_union(), cptr, declare_start(), declare_tokens(), declare_types(), IDENT, keyword(), LEFT, line, lineno, MALLOC, MARK, nextc(), no_space(), NONASSOC, RIGHT, START, syntax_error(), TEXT, TOKEN, TYPE, unexpected_EOF(), and UNION.
Referenced by reader().
Here is the call graph for this function:
Here is the caller graph for this function:| read_grammar | ( | ) |
Definition at line 1446 of file reader.c.
References add_symbol(), advance_to_start(), copy_action(), cptr, end_rule(), initialize_grammar(), line, lineno, mark_symbol(), nextc(), nrules, start_rule(), and syntax_error().
Referenced by reader().
Here is the call graph for this function:
Here is the caller graph for this function:| reader | ( | ) |
Definition at line 1775 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 main().
Here is the call graph for this function:
Here is the caller graph for this function:| skip_comment | ( | ) |
Definition at line 116 of file reader.c.
References cptr, dup_line(), FREE, get_line(), line, lineno, and unterminated_comment().
Referenced by nextc().
Here is the call graph for this function:
Here is the caller graph for this function:| start_rule | ( | bucket * | bp, |
| int | s_lineno | ||
| ) |
Definition at line 1085 of file reader.c.
References expand_rules(), maxrules, NONTERM, nrules, rassoc, rprec, TERM, terminal_lhs(), TOKEN, and UNDEFINED.
Referenced by add_symbol(), advance_to_start(), and read_grammar().
Here is the call graph for this function:
Here is the caller graph for this function:| char* cache |
Definition at line 10 of file reader.c.
Referenced by cachec(), get_literal(), get_name(), get_tag(), insert_empty_rule(), keyword(), and read_declarations().
| int cache_size |
Definition at line 11 of file reader.c.
Referenced by cachec(), and read_declarations().
| 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 find_final_state().
| 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.
Referenced by advance_to_start(), copy_action(), copy_ident(), copy_text(), copy_union(), declare_start(), declare_types(), dup_line(), get_line(), get_literal(), get_tag(), illegal_character(), keyword(), mark_symbol(), nextc(), output_trailing_text(), over_unionized(), read_declarations(), read_grammar(), and skip_comment().
| 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(), and pack_symbols().
| 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 copy_action(), free_tags(), get_tag(), and output_stype().
| int prec |
Definition at line 21 of file reader.c.
Referenced by declare_tokens(), 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 free_tags(), and get_tag().
| char unionized |
Definition at line 16 of file reader.c.
Referenced by copy_union(), output_defines(), and output_stype().