Exemplo n.º 1
0
int
main (int argc, char **argv) 
{

  // faire en sorte qu'interactive_mode = 0 lorsque le shell est distant 
  
  if (interactive_mode)
    {
      using_history();
    }
  else
    {
      //  mode distant 
    }
  
  while (1){
    if (my_yyparse () == 0) {  /* L'analyse a abouti */   
      afficher_expr(ExpressionAnalysee);
      status = evaluer_expr(ExpressionAnalysee);
      //printf("Salut %s",ExpressionAnalysee->type);
      fflush(stdout);
      expression_free(ExpressionAnalysee);
    }
    else {
      /* L'analyse de la ligne de commande a donn� une erreur */
    }
  }
  return 0;
}
Exemplo n.º 2
0
int
main (int argc, char **argv) 
{
	if(argc == 2)
		interactive_mode = 0;

  // faire en sorte qu'interactive_mode = 0 lorsque le shell est distant 
  if (interactive_mode)
    {
      using_history();
    }
  else
    {
      //  mode distant 
    }
  
  while (1){
    if (my_yyparse () == 0) {  /* L'analyse a abouti */   
      // afficher_expr(ExpressionAnalysee);
      
      //printf("\n%s\n", ExpressionAnalysee->arguments[0]);

      evaluer_expr(ExpressionAnalysee);
      //echo(LongueurListe(ExpressionAnalysee->arguments), ExpressionAnalysee->arguments);
      
      // printf("\n%s\n", choices[4]);
      fflush(stdout);
      expression_free(ExpressionAnalysee);
    }
    else {
      /* L'analyse de la ligne de commande a donné une erreur */
    }
  }
   wait(NULL);
  return 0;
}