root / pobysoC-4.0 / src / test-pobyso-02.c @ 287
Historique | Voir | Annoter | Télécharger (1,24 ko)
1 |
/** @file test-pobyso-02.c
|
---|---|
2 |
* Name & purpose
|
3 |
*
|
4 |
* @author
|
5 |
* @date
|
6 |
*
|
7 |
*/
|
8 |
/******************************************************************************/
|
9 |
/* Headers, applying the "particular to general" convention.*/
|
10 |
|
11 |
#include "pobyso.h" |
12 |
|
13 |
/* includes of local headers */
|
14 |
|
15 |
/* includes of project headers */
|
16 |
|
17 |
/* includes of system headers */
|
18 |
|
19 |
/* Other declarations */
|
20 |
|
21 |
/* Internal prototypes */
|
22 |
|
23 |
/* Types, constants and macros definitions */
|
24 |
|
25 |
/* Global variables */
|
26 |
|
27 |
/* Functions */
|
28 |
|
29 |
int
|
30 |
main(int argc, char** argv) |
31 |
{ |
32 |
pobyso_func_exp_t f = NULL;
|
33 |
pobyso_func_exp_t one = NULL;
|
34 |
sollya_lib_init(); |
35 |
pobyso_set_canonical_on(); |
36 |
f = pobyso_parse_string(argv[1]);
|
37 |
if (pobyso_is_function(f))
|
38 |
{ |
39 |
pobyso_autoprint(f); |
40 |
pobyso_set_canonical_on(); |
41 |
pobyso_autoprint(sollya_lib_canonical(f)); |
42 |
} |
43 |
else
|
44 |
{ |
45 |
fprintf(stderr, |
46 |
"%s can't be converted into a functional expression.\n",
|
47 |
argv[1]);
|
48 |
} |
49 |
sollya_lib_clear_obj(f); |
50 |
/* */
|
51 |
one = pobyso_parse_string("1");
|
52 |
if (pobyso_is_function(one))
|
53 |
{ |
54 |
pobyso_is_constant_expression(one); |
55 |
fprintf(stdout, "%s is a function.\n", "1"); |
56 |
} |
57 |
else
|
58 |
{ |
59 |
fprintf(stdout,"%s is not a function.\n", "1"); |
60 |
} |
61 |
sollya_lib_clear_obj(one); |
62 |
|
63 |
sollya_lib_close(); |
64 |
return 0; |
65 |
} /* End main */
|