Advertisement
Guest User

Compositi_Pseudo

a guest
Jul 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. string s ="NOME_CIRCUITO_COMB instance (.a = m, .b = n, .c = a, .x = FF1) ";
  2. s=s.substr(s.find('(')+1,s.find(')')-s.find('('));
  3. cout<<s<<endl;
  4. istringstream in(s);
  5. string conversion;
  6. bool foundClose;
  7. do{
  8. getline(in,conversion,',');
  9. if(conversion.find(')')!=string::npos){
  10. foundClose=true;
  11. conversion=conversion.substr(0,conversion.find(')'));
  12. }
  13. cout<<conversion<<endl;
  14. string firstPart;
  15. string secondPart;
  16. firstPart=conversion.substr(conversion.find('.')+1,conversion.find('=')-conversion.find('.')-1);
  17. secondPart=conversion.substr(conversion.find('=')+1,conversion.find('\0'));
  18. cout<<firstPart<<endl;
  19. cout<<secondPart<<endl;
  20. if(firstPart.isInputofFirst()) {
  21. if(secondPart.isInputofSecond()) {
  22. for (int i = 0; i < list.size(); ++i) {
  23. if (list.elem[i].name == firstPart)
  24. list.elem[i].setName(secondPart);
  25. }
  26. }else{
  27. parseExpr(firstPart+" = "+secondPart);//in questo parser,una volta arrivati all'"=" bisogna andare a cercare il nodo
  28. //first Parte chiamarlo con l'operatore della funzione
  29. }
  30. }else if(firstPart.isOutputofFirst){
  31. f(secondPart.isOutputofSecond()) {
  32. for (int i = 0; i < list.size(); ++i) {
  33. if (list.elem[i].name == firstPart)
  34. list.elem[i].setName(secondPart);
  35. }
  36. }else{
  37. parseExpr(firstPart+" = "+secondPart);//in questo parser,una volta arrivati all'"=" bisogna andare a cercare il nodo
  38. //first Parte chiamarlo con l'operatore della funzione
  39. }
  40. }
  41. }while(!foundClose);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement