#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include "cpp_io.h"
#include "cpp_conv.h"
#include "cpp_token.h"
#include "cc_scan.h"
#include "cc_parse.h"
#include "cc_message_list.h"
#include "cc_code_gen.h"
Functions | |
int | Struct_Declaration (struct _parser *p, char *name) |
handle a struct declaration statement | |
int | Array_Declaration (struct _parser *p, char *typ, int pointer, char *name) |
handle a array declaration statement | |
int | Array_Initialisation (struct _parser *p, char *typ, int pointer, char *name, int dim) |
handle the initialisation of an array declaration statement | |
int | Variable_Declaration (struct _parser *p, char *typ, int pointer, char *name) |
handle a function declaration statement | |
int | Function_Declaration (struct _parser *p, char *typ, int pointer, char *name) |
handle a function declaration statement | |
int | extern_Declaration (struct _parser *p) |
handle a extern declaration statement | |
int | Block (struct _parser *p, struct _item *s) |
handle a function declaration statement | |
int | Data_Declaration (struct _parser *p) |
handle a data declaration statement | |
int | if_Statement (struct _parser *p, struct _item *s) |
handle a if statement | |
int | while_Statement (struct _parser *p, struct _item *s) |
handle a while statement | |
int | break_Statement (struct _parser *p, struct _item *s) |
handle a break statement | |
int | continue_Statement (struct _parser *p, struct _item *s) |
handle a continue statement | |
int | return_Statement (struct _parser *p, struct _item *s) |
handle a return statement | |
int | Assignment_Expression (struct _parser *p, struct _item *sx) |
handle an assignment expression | |
int | Statement (struct _parser *p, struct _item *s) |
handle a statement | |
int | List_Value (struct _parser *p, int sym, struct _item *x) |
handle a list value | |
int | Selector (struct _parser *p, struct _item *x) |
handle a selector | |
int | Logical_Or_Expression (struct _parser *p, struct _item *x) |
handle a logical or expression | |
int | Logical_And_Expression (struct _parser *p, struct _item *x) |
handle a logical and expression | |
int | Conditional_Expression (struct _parser *p, struct _item *x) |
handle a conditional expression | |
int | Simple_Expression (struct _parser *p, struct _item *x) |
handle a simple expression | |
int | Term (struct _parser *p, struct _item *x) |
handle a term | |
int | Factor (struct _parser *p, struct _item *x) |
handle a factor | |
_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 | Parser_Error (struct _parser *p, char *s1, char *s2) |
write a parser error message | |
void | Parser_Warning (struct _parser *p, char *s1, char *s2) |
write a parser warning message | |
void | Parser_Info (struct _parser *p, char *s1, char *s2) |
write a parser info message | |
void | Print_Token (struct _parser *p) |
print a token | |
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 sph) |
rewind to last save point and deliver the tokens again | |
void | Block_Rewind (struct _parser *p) |
disallow rewinding to last savepoint | |
void | Release (struct _parser *p, int sph) |
release last save point | |
int | is_SimpleType (int sym) |
check if a given symbol is a simple (builtin) type | |
int | Declaration_Statement (struct _parser *p, int no_fct) |
handle a declaration statement | |
int | Is_Parameter (struct _object *par) |
check if object is a function parameter | |
int | Is_Type_Equal (struct _type *a, struct _type *b) |
check if two type descriptions are equivalent | |
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 | 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 *f) |
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 | 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 | |
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 |
|
handle a array declaration statement
|
|
handle the initialisation of an array declaration statement
|
|
handle an assignment expression
|
|
handle a function declaration statement
|
|
disallow rewinding to last savepoint
|
|
handle a break statement
|
|
the C compiler parser
|
|
compare the types of two field lists
|
|
handle a conditional expression
|
|
handle a conditional jump
|
|
handle a continue statement
|
|
handle a data declaration statement
|
|
handle a declaration statement
|
|
delete an object from the symbol table
|
|
destroy a field list
|
|
generate code for dual operators: x = y op z;
|
|
handle a extern declaration statement
|
|
handle a factor
|
|
struct field access x = x.y
|
|
find an object
|
|
find an object field
|
|
handle a function declaration statement
|
|
get an unary operator
|
|
get next scanner symbol
|
|
handle a if statement
|
|
array access
|
|
check if object is a function parameter
|
|
check if a given symbol is a simple (builtin) type
|
|
check if two type descriptions are equivalent
|
|
handle a list value
|
|
load a boolean variable onto the stack
|
|
handle a logical and expression
|
|
handle a logical or expression
|
|
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
|
|
write a parser error message
|
|
write a parser info message
|
|
write a parser warning message
|
|
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
|
|
print a token
|
|
store a variable x = y;
|
|
release last save point
|
|
handle a return statement
|
|
rewind to last save point and deliver the tokens again
|
|
handle a selector
|
|
set save point for token saving
|
|
handle a simple expression
|
|
skip symbols until the desired symbol is found or the file has ended
|
|
handle a statement
|
|
store a variable x = y;
|
|
handle a struct declaration statement
|
|
handle a term
|
|
generate code for unary operators: x = op x;
|
|
handle a function declaration statement
|
|
handle a while statement
|