-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.c
44 lines (37 loc) · 845 Bytes
/
main.c
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
/*
** The author of this program disclaims copyright.
*/
int main()
{
void* pParser = ParseAlloc (malloc);
/* First input:
** 15 / 5
*/
Parse (pParser, INTEGER, 15);
Parse (pParser, DIVIDE, 0);
Parse (pParser, INTEGER, 5);
Parse (pParser, 0, 0);
/* Second input:
** 50 + 125
*/
Parse (pParser, INTEGER, 50);
Parse (pParser, PLUS, 0);
Parse (pParser, INTEGER, 125);
Parse (pParser, 0, 0);
/* Third input:
** 50 * 125 + 125
*/
Parse (pParser, INTEGER, 50);
Parse (pParser, TIMES, 0);
Parse (pParser, INTEGER, 125);
Parse (pParser, PLUS, 0);
Parse (pParser, INTEGER, 125);
Parse (pParser, 0, 0);
ParseFree(pParser, free);
return 0;
}
/* Local Variables: */
/* c-basic-offset: 4 */
/* tab-width: 4 */
/* indent-tabs-mode: t */
/* End: */