C:/Users/Dennis/src/lang/russell.orig/src/pass5d/RIC.c File Reference

#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_instrget_RIC (FILE *f)
struct RIC_instrparse_RIC (char **s)
struct RIC_instrGinline_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_instrcopy_RIC (struct RIC_instr *p)
struct RIC_instrcat_RIC (struct RIC_instr *p, struct RIC_instr *q)
struct RIC_instrRIC_inst_args (struct RIC_instr *p, long n)
struct RIC_instrRIC_inst_rs (struct RIC_instr *p, long n)
long RIC_len (struct RIC_instr *p)

Variables

static hrecordhtable [TABSIZE]
char * op_code_table []
static char field_buf [OCLENGTH+1]
long avail_loc


Define Documentation

#define AT_END   (*p == '\0' || *p == '\n' || *p == ';')

Referenced by parse_RIC().

#define DEBUG   DEBUG

Definition at line 1 of file RIC.c.

#define hash (  )     ((((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

Definition at line 10 of file RIC.c.

Referenced by gen_RIC(), and write_RIC().

#define NIL   0

Definition at line 22 of file RIC.c.

#define NONE   ((char *)0)

Definition at line 45 of file RIC.c.

#define OCLENGTH   9

Definition at line 8 of file RIC.c.

Referenced by extract_field().

#define skip_blanks   while (*p == ' ' || *p == '\t' || *p == ',') { p++; }

Referenced by parse_RIC().

#define TABSIZE   50

Definition at line 24 of file RIC.c.


Function Documentation

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

struct RIC_instr* cat_RIC ( struct RIC_instr p,
struct RIC_instr q 
) [read]

Definition at line 505 of file RIC.c.

References RIC_instr::next_instr, and RIC_nil.

struct RIC_instr* copy_RIC ( struct RIC_instr p  )  [read]

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 
)

Definition at line 465 of file RIC.c.

References ASSERT, IDT, LDN, and MAXLOC.

genl_RIC ( FILE *  f,
int  op,
char *  label 
)

Definition at line 453 of file RIC.c.

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

Definition at line 48 of file RIC.c.

References add_RIC_table(), AL, AR, C0, C1, C2, C3, C4, DCL_ADDR, DCL_DBL_FLOAT, DCL_FLOAT, DCL_INT, DEA, DEAD, ET, GF, GFU, LIVE, N_OP_CODES, NONE, NP, NSC, ONS, op_code_table, OPT, PT, RL, RS, SK, SP, STSZ, T1, T2, TL, and UN.

Referenced by main().

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

struct RIC_instr* RIC_inst_args ( struct RIC_instr p,
long  n 
) [read]

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.

struct RIC_instr* RIC_inst_rs ( struct RIC_instr p,
long  n 
) [read]

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


Variable Documentation

long avail_loc

Definition at line 15 of file extract_sig.c.

char field_buf[OCLENGTH+1] [static]

Definition at line 113 of file RIC.c.

Referenced by extract_field(), and parse_RIC().

hrecord* htable[TABSIZE] [static]

Definition at line 27 of file RIC.c.

char* op_code_table[]

Definition at line 4 of file op_codes.c.


Generated on Fri Jan 25 10:39:50 2008 for russell by  doxygen 1.5.4