-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
65 lines (59 loc) · 1.33 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "analyser/analyser.h"
#include "formater/formater.h"
#include "utils/tools.h"
/**
* @brief
*
* @param data
* @return char*
* *
* this function will transcript any mathematics
* expression from mathematics to litteral
*/
char *number_transcriptor( char *data )
{
char *result, *err;
result = createSlice( data, "" );
err = analyse( result );
if ( err != NULL )
{
return err;
}
return format( result );
}
/**
* @brief Get the String object
*
* @return char*
* *
* this function will get a string from
* the standart input output
*/
char *getString()
{
char *result, item;
result = createSlice( "", "" );
scanf( "%c", &item );
while ( item != '\n' )
{
result = addSlice( result, ( char[] ){ item } );
scanf( "%c", &item );
}
return result;
}
int main( int argc, char const *argv[] )
{
char *data;
printf( "\n\n" );
printf( ">>> Quelle Expression voulez-vous transcrire?" );
printf( "\n" );
printf( ">>> " );
data = getString();
data = number_transcriptor( data );
printf( ">>> %s", data );
printf( "\n\n" );
return 0;
}