#include "cpp_token.h"
#include "cc_token_list.h"
#include "cc_symtab.h"
#include "cc_code_gen.h"
Classes | |
struct | _parser |
parser administrative variables More... | |
Functions | |
_parser * | Parser_Create (int fd_in, int fd_out, int fd_err) |
create and initialize a new parse | |
void | Parser_Destroy (struct _parser *p) |
destroy a parser and all its components | |
void | GetSymCC (struct _parser *p) |
get next scanner symbol | |
void | SkipToSymCC (struct _parser *p, int sym) |
skip symbols until the desired symbol is found or the file has ended | |
int | SetSavePoint (struct _parser *p) |
set save point for token saving | |
void | Rewind (struct _parser *p, int sp) |
rewind to last save point and deliver the tokens again | |
void | Release (struct _parser *p, int sp) |
release last save point | |
int | cc_parse (struct _parser *p) |
the C compiler parser | |
_object * | NewObj (struct _parser *p, class_t cls, char *ident) |
create a new object node | |
void | DelObj (struct _parser *p, struct _object *o) |
delete an object from the symbol table | |
_object * | Find (struct _parser *p, char *ident, int err) |
find an object | |
_object * | FindField (struct _parser *p, struct _object *list) |
find an object field | |
int | Is_Parameter (struct _object *par) |
check if object is a function parameter | |
int | Compare_Field_Types (struct _parser *p, struct _object *f1, struct _object *f2) |
compare the types of two field lists | |
void | Destroy_Fields (struct _parser *p, struct _object *f1) |
destroy a field list | |
void | Make_Item (struct _parser *p, struct _item *x, struct _object *obj) |
create a named item | |
void | Make_Const_Item (struct _parser *p, struct _item *x, struct _type *typ, int val) |
create a named item | |
void | Make_Link_Item (struct _parser *p, struct _item *x, struct _type *typ, int st, int end, int ret, int wl) |
create a link item | |
void | Make_Void_Item (struct _parser *p, struct _item *x) |
create a void item | |
void | Make_Boolean_Item (struct _parser *p, struct _item *x) |
create a boolean item | |
void | Make_Temp_Item (struct _parser *p, struct _item *x, class_t md, struct _type *ty) |
create a temporary item | |
void | Index (struct _parser *p, struct _item *x, struct _item *y) |
array access | |
void | Field (struct _parser *p, struct _item *x, struct _object *y) |
struct field access x = x.y | |
void | PointerField (struct _parser *p, struct _item *x, struct _object *y) |
struct field access x = x->y | |
void | Load_Boolean (struct _parser *p, struct _item *x) |
load a boolean variable onto the stack | |
void | Store (struct _parser *p, struct _item *x, struct _item *y) |
store a variable x = y; | |
void | Relation (struct _parser *p, int op, struct _item *x, struct _item *y) |
store a variable x = y; | |
int | Get_Unary_Operator (struct _parser *p) |
get an unary operator | |
void | Unary_Operator (struct _parser *p, int op, struct _item *x) |
generate code for unary operators: x = op x; | |
void | Dual_Operator (struct _parser *p, int op, struct _item *x, struct _item *y) |
generate code for dual operators: x = y op z; | |
void | Conditional_Jump (struct _parser *p, struct _item *x) |
handle a conditional jump | |
void | Pre_Increment (struct _parser *p, struct _item *x) |
increment a given variable before its use | |
void | Pre_Decrement (struct _parser *p, struct _item *x) |
decrement a given variable before its use | |
void | Post_Increment (struct _parser *p, struct _item *x) |
increment a given variable after its use | |
void | Post_Decrement (struct _parser *p, struct _item *x) |
decrement a given variable after its use |
|
the C compiler parser
|
|
compare the types of two field lists
|
|
handle a conditional jump
|
|
delete an object from the symbol table
|
|
destroy a field list
|
|
generate code for dual operators: x = y op z;
|
|
struct field access x = x.y
|
|
find an object
|
|
find an object field
|
|
get an unary operator
|
|
get next scanner symbol
|
|
array access
|
|
check if object is a function parameter
|
|
load a boolean variable onto the stack
|
|
create a boolean item
|
|
create a named item
|
|
create a named item
|
|
create a link item
|
|
create a temporary item
|
|
create a void item
|
|
create a new object node
|
|
create and initialize a new parse
|
|
destroy a parser and all its components
|
|
struct field access x = x->y
|
|
decrement a given variable after its use
|
|
increment a given variable after its use
|
|
decrement a given variable before its use
|
|
increment a given variable before its use
|
|
store a variable x = y;
|
|
release last save point
|
|
rewind to last save point and deliver the tokens again
|
|
set save point for token saving
|
|
skip symbols until the desired symbol is found or the file has ended
|
|
store a variable x = y;
|
|
generate code for unary operators: x = op x;
|