Statistiques
| Révision :

root / pobysoC-4.0 / src / test-pobyso-02.c @ 284

Historique | Voir | Annoter | Télécharger (1,24 ko)

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