#include <stdio.h>#include <ctype.h>#include "../parm.h"#include "op_codes.h"#include "codegen.h"Go to the source code of this file.
Data Structures | |
| struct | hrecord |
Defines | |
| #define | DEBUG DEBUG |
| #define | OCLENGTH 9 |
| #define | MAXLOC 100000 |
| #define | NIL 0 |
| #define | TABSIZE 50 |
| #define | hash(s) ((((s)[0]<<2) + (((s)[1]) == '\0'? 0 : (s)[1] + (s)[2]))%TABSIZE) |
| #define | NONE ((char *)0) |
| #define | skip_blanks while (*p == ' ' || *p == '\t' || *p == ',') { p++; } |
| #define | AT_END (*p == '\0' || *p == '\n' || *p == ';') |
Functions | |
| void | add_RIC_table (char *nm, int val) |
| void | init_RIC_table () |
| int | find_RIC_table (char *name) |
| static char * | extract_field (char *p) |
| void | free_RIC (struct RIC_instr *p) |
| put_RIC (struct RIC_instr *seq, FILE *f) | |
| struct RIC_instr * | get_RIC (FILE *f) |
| struct RIC_instr * | parse_RIC (char **s) |
| struct RIC_instr * | Ginline_cnvt (char *s) |
| void | write_RIC (FILE *f, struct RIC_instr *RIC_i, int n, int rs) |
| void | write_RIC_seq (FILE *f, struct RIC_instr *RIC_seq, int n, int rs) |
| genl_RIC (FILE *f, int op, char *label) | |
| gen_RIC (FILE *f, int op, int arg1, int arg2, int arg3) | |
| struct RIC_instr * | copy_RIC (struct RIC_instr *p) |
| struct RIC_instr * | cat_RIC (struct RIC_instr *p, struct RIC_instr *q) |
| struct RIC_instr * | RIC_inst_args (struct RIC_instr *p, long n) |
| struct RIC_instr * | RIC_inst_rs (struct RIC_instr *p, long n) |
| long | RIC_len (struct RIC_instr *p) |
Variables | |
| static hrecord * | htable [TABSIZE] |
| char * | op_code_table [] |
| static char | field_buf [OCLENGTH+1] |
| long | avail_loc |
| #define AT_END (*p == '\0' || *p == '\n' || *p == ';') |
Referenced by parse_RIC().
| #define hash | ( | s | ) | ((((s)[0]<<2) + (((s)[1]) == '\0'? 0 : (s)[1] + (s)[2]))%TABSIZE) |
Definition at line 25 of file RIC.c.
Referenced by add_RIC_table(), find_adj(), and find_RIC_table().
| #define MAXLOC 100000 |
| #define OCLENGTH 9 |
| #define skip_blanks while (*p == ' ' || *p == '\t' || *p == ',') { p++; } |
Referenced by parse_RIC().
| void add_RIC_table | ( | char * | nm, | |
| int | val | |||
| ) |
Definition at line 31 of file RIC.c.
References gc_malloc, hash, hrecord::hr_name, hrecord::hr_next, and hrecord::hr_val.
Referenced by init_RIC_table().
Definition at line 480 of file RIC.c.
References copy_RIC(), gc_malloc, RIC_instr::label_arg, n_args, RIC_instr::next_instr, RIC_instr::op_code, RIC_nil, and TRUE.
| static char* extract_field | ( | char * | p | ) | [static] |
Definition at line 115 of file RIC.c.
References field_buf, and OCLENGTH.
Referenced by parse_RIC().
| int find_RIC_table | ( | char * | name | ) |
Definition at line 95 of file RIC.c.
References hash, hrecord::hr_name, hrecord::hr_next, hrecord::hr_val, MISSING, and NIL.
Referenced by parse_RIC().
| void free_RIC | ( | struct RIC_instr * | p | ) |
Definition at line 141 of file RIC.c.
References free, and RIC_instr::next_instr.
Referenced by construct_inline(), Gappl(), and Gexpression().
| gen_RIC | ( | FILE * | f, | |
| int | op, | |||
| int | arg1, | |||
| int | arg2, | |||
| int | arg3 | |||
| ) |
| struct RIC_instr* get_RIC | ( | FILE * | f | ) | [read] |
Definition at line 185 of file RIC.c.
References RIC_instr::arg, ARG_BIT, avail_loc, dbgmsg, DCL, gc_malloc, RIC_instr::label, RIC_instr::label_arg, label_buf, MAXLABELSZ, n_args, RIC_instr::next_instr, RIC_instr::op_code, and RS.
Referenced by sig_in1().
| struct RIC_instr* Ginline_cnvt | ( | char * | s | ) | [read] |
Definition at line 368 of file RIC.c.
References end, free, RIC_instr::next_instr, NIL, and parse_RIC().
| void init_RIC_table | ( | ) |
| struct RIC_instr* parse_RIC | ( | char ** | s | ) | [read] |
Definition at line 255 of file RIC.c.
References RIC_instr::arg, ARG_BIT, AT_END, dbgmsg, extract_field(), FALSE, field_buf, find_RIC_table(), gc_malloc, RIC_instr::label, RIC_instr::label_arg, MAX_LABEL_OP, MISSING, n_args, RIC_instr::next_instr, RIC_instr::op_code, skip_blanks, TRUE, and v.
Referenced by Ginline_cnvt().
| put_RIC | ( | struct RIC_instr * | seq, | |
| FILE * | f | |||
| ) |
Definition at line 155 of file RIC.c.
References RIC_instr::arg, RIC_instr::label, RIC_instr::label_arg, n_args, RIC_instr::next_instr, and RIC_instr::op_code.
Referenced by sig_out1().
Definition at line 523 of file RIC.c.
References RIC_instr::arg, ARG_BIT, IDT, RIC_instr::label_arg, LDN, n_args, RIC_instr::next_instr, RIC_instr::op_code, and RIC_nil.
Definition at line 551 of file RIC.c.
References RIC_instr::arg, IDT, RIC_instr::label_arg, LDN, n_args, RIC_instr::next_instr, RIC_instr::op_code, RIC_nil, and RS.
| long RIC_len | ( | struct RIC_instr * | p | ) |
Definition at line 575 of file RIC.c.
References RIC_instr::arg, HINT, RIC_instr::next_instr, RIC_instr::op_code, OPT, and RIC_nil.
Referenced by construct_inline().
| void write_RIC | ( | FILE * | f, | |
| struct RIC_instr * | RIC_i, | |||
| int | n, | |||
| int | rs | |||
| ) |
Definition at line 399 of file RIC.c.
References RIC_instr::arg, ARG_BIT, ASSERT, IDT, RIC_instr::label, RIC_instr::label_arg, LDN, MAXLOC, n_args, RIC_instr::op_code, RS, and SK.
Referenced by write_RIC_seq().
| void write_RIC_seq | ( | FILE * | f, | |
| struct RIC_instr * | RIC_seq, | |||
| int | n, | |||
| int | rs | |||
| ) |
Definition at line 438 of file RIC.c.
References RIC_instr::next_instr, NIL, and write_RIC().
Referenced by Gappl(), and Gexpression().
| long avail_loc |
Definition at line 15 of file extract_sig.c.
char field_buf[OCLENGTH+1] [static] |
| char* op_code_table[] |
Definition at line 4 of file op_codes.c.
1.5.4