-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcgen.h
53 lines (41 loc) · 1.05 KB
/
cgen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef CGEN_H
#define CGEN_H
/*
String streams are handy for using standard C-library
functions to produce formatted strings.
*/
typedef struct sstream
{
char *buffer;
size_t bufsize;
FILE* stream;
} sstream;
void ssopen(sstream* S);
char* ssvalue(sstream* S);
void ssclose(sstream* S);
/*
This function takes the same arguments as printf,
but returns a new string with the output value in it.
*/
char* template(const char* pat, ...);
/*
This is the function used to report errors in the translation.
*/
void yyerror(char const* pat, ...);
/*
This is set to the number of calls to yyerror
*/
extern int yyerror_count;
/* This is output at the head of a c program. */
extern const char* c_prologue;
/*
Make a C string literal out of a PTUC string literal.
Return the corrected string (maybe the same as P).
*/
char* string_ptuc2c(char* P);
/*
Tokenize function arguments upon declaration in order to support
many declarations of the same type seperated by comma.
*/
char* fix_subroutine_idents (char* idents, char* data_type, char* array_size);
#endif