-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpretty_print.h
34 lines (22 loc) · 1.01 KB
/
pretty_print.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
#ifndef PRETTYPRINT_H
#define PRETTYPRINT_H
#include "cmplr.h"
#define MAXLINE 128
struct pp_line {
char text[81];
int y_pos;
};
struct pp_buf {
struct pp_line lines[MAXLINE];
int n_lines;
};
struct pp_buf * create_pp_buffer();
void pp_print_char(struct pp_buf * buf, char ch, int x, double y);
void pp_print_buffer(struct pp_buf * buf);
void pp_print_expression(Node * ast, int * x, double * y, double * ULim, double * LLim, struct pp_buf * buf);
void pp_print_product(Node * ast, int * x, double * y, double * ULim, double * LLim, struct pp_buf * buf);
void pp_print_power(Node * ast, int * x, double * y, double * ULim, double * LLim, struct pp_buf * buf);
void pp_print_fraction(Node * ast, int * x, double * y, double * ULim, double * LLim, struct pp_buf * buf);
void pp_print_integer(Node * ast, int * x, double * y, double * ULim, double * LLim, struct pp_buf * buf);
void pp_print_var(Node * ast, int * x, double * y, double * ULim, double * LLim, struct pp_buf * buf);
#endif