();
}
// ---------------------------------------- ----------------------------------- __fastcall TForm1 :: J1Click (TObject * Sender)
{(OpenDialog1-> Execute ())
{-> Lines-> LoadFromFile (OpenDialog1-> FileName);
}
{> MessageBox ("Файл не був вибраний. Спробуйте ще раз!", "Попередження", MB_OK);
}
}
// ---------------------------------------- ----------------------------------- __fastcall TForm1 :: N13Click (TObject * Sender)
{(SaveDialog1-> Execute ())
{-> Lines-> SaveToFile (SaveDialog1-> FileName);
}
{> MessageBox ("Файл не був збережений. Спробуйте ще раз!", "Попередження", MB_OK);
}
}
// ---------------------------------------- ----------------------------------- __fastcall TForm1 :: N6Click (TObject * Sender)
{> CreateForm (__classid (TForm3), & Form3); -> ShowModal ();
}
// ---------------------------------------- ----------------------------------- __fastcall TForm1 :: N8Click (TObject * Sender)
{> CreateForm (__classid (TForm4), & Form4); -> ShowModal ();
}
// ---------------------------------------- ----------------------------------- __fastcall TForm1 :: btnStartClick (TObject * Sender)
{-> Clear (); e = 0; len, level = 0; * str; mas [80] = ""; = Memo1-> Lines-> GetText ( ); = Memo1-> Lines-> Text. Length (); * type = "printf"; k = 0; i = 0, j = 0; {= 0; e = 0; (str [j] == ' 0') break; (str [j ] == 'p')
{+ +; + +; (type [i]! = ' 0')
{(str [j] == type [i]) {j + +; i + +;} {e = 1; error (1); break;}
}
} {error (1); e = 1;
} (e == 0 && str [j]! = '(' && str [j]! = '"' && str [j]! = '%' && str [j]! = ',' && str [j]! = ')' &&! isalpha (str [j]) && str [j] ! = ';' && str [j]! = ' 0') {error (1);} (1)
{(str [j] == '(' | | str [j] == '"' | | str [j] == '%' | | str [j] == ',' | | str [j] == ')' | | str [j] == ';' | | str [j] == ' 0'); j + +;
} = 1; (j! = len)
{(str [j])
{'(': {if (level == 1) {level = 2; j + +; (str [j] == '') j + +; break;} (level> 1) {( mas, "Помилка: Зайвий символ '('"); -> Lines-> Add (mas); [0] = ' 0';} + +; break;} '"': {if (level == 3 | | level> = 5) {
sprintf (mas, "Помилка): Зайвий символ''");
Memo1-> Lines-> Add (mas); [0] = ' 0'; + +; break;} (level == 1) {error (2); level = 3; j + +; break;} (level == 2) {level = 3; j + +; break;} (level == 4) {level = 5; j + +; break;} (level == 3) {error (4) ; level = 5; j + +; break;} + +; break;} '%': {if (level == 1) {error (2); error (3);} (level == 2) error (3) ; j + +; (str [j] == '"' | | str [j] == ' 0' | | str [j] == ',' | | str [j] == ')' | | str [j] == ';')
{error (4); level = 4; break;} (1) {(str [j] == '"' | | str [j] == ' 0' | | str [j] == ',' | | str [j] == ')' | | str [j] == ';')
{level = 4; break;}
{(isdigit (str [j]))
{+ +; (isdigit (str [j])) j + +;} (str [j]! = 'd') {error (4); break;} + +; (str [ j] == '') j + +; ((isdigit (str [j])) | | (isalpha (str [j]))) {error (4); j + +; break;} break;
}} = 4; break;} ',': {if (level == 1) {error (2); error (3); error (4); error (3);} (level == 2) {error (3); error (4); error (3);} (level == 3) {error (4); error (3);} (level == 4) {error ( 3);} + +; (str [j] == '') j + +; (! isalpha (str [j])) {error (5); level = 6; break;} (str [j] == ' 0 '| | str [j] ==' r '| | str [j] ==') '| | str [j] =='; ') {level = 6; break;}
{(str [j] == ',') j + +; (isalpha (str [j]))
{+ +; (1) {((isdigit (str [j])) | | (isalpha (str [j]))) j + +; (str [j] == '+' | | str [j] == '-' | | str [j] == '*' | | str [j] == '/' | | str [j] == ',') {j + +; (! isalpha (str [j])) {error (5);}} ((isdigit (str [j])) | | (isalpha (str [j]))) j + +; ((! isdigit (str [j]) ) && (! isalpha (str [j])) && str [j]! = '+&...