|
1 | 1 |
|
2 |
| -<sub>** This work is being done as part of the Course Fundamentals of computer modeling **</sub> |
| 2 | +<sub>** This work is being done as part of the Course Method development translator **</sub> |
3 | 3 | # MethodsDevelopmentTranslator
|
4 | 4 | <div>
|
5 | 5 | <p>The repository has translator from C to C#, on the language C++</p>
|
6 | 6 | <h3>Syntax Analisator</h3>
|
7 | 7 | <p>Base file: (russian language: Vishnikov Y.M. BalabaevaI.Y. PDF):</p>
|
8 | 8 | [](https://github.com/StrongerProgrammer7/MethodsDevelopmentTranslator/files/10741055/_.pdf)
|
| 9 | +<p> |
| 10 | +<h4> 7 Classes </h4> |
| 11 | +<ul> |
| 12 | +<li>Translator (parent) </li> |
| 13 | +<li>LexicalAnalisator (inherit up, parent) </li> |
| 14 | +<li>LexicalAnalisator (inherit up, parent) </li> |
| 15 | +<li>ReversePolishNotation (inherit up, parent) </li> |
| 16 | +<li>SyntaxAnalisator (inherit up, parent) </li> |
| 17 | +<li>Translate_csharp (inherit up, parent) </li> |
| 18 | +<li>TranslatroFromCToCSharp(inherit up, parent) </li> |
| 19 | +</ul> |
| 20 | +Users should use last class. Last class using next methods: |
| 21 | +<ul> |
| 22 | +<li>lexicalAnalyze</li> |
| 23 | +<li>reversePolishNotAnalyze</li> |
| 24 | +<li>syntaxAnalyze</li> |
| 25 | +<li>translateToCSharp</li> |
| 26 | +</ul> |
| 27 | +</p> |
9 | 28 | <p> Using:
|
10 |
| -<pre>SyntaxAnalisator analisator |
11 |
| -  marshalString(String^ textBox nameFile,std::string namefile) |
| 29 | +<pre>TranslatorFromCToCSharp translator |
| 30 | +  translator.lexicalAnalyze(fileText_C); |
| 31 | +  translator.reversePolishNotAnalyze(); |
| 32 | +  In condition(if) translator.syntaxAnalyze() == true |
| 33 | +  translator.translateToCSharp(); |
12 | 34 | </pre>
|
13 |
| -marshalString -> translate String^ -> std::string <br> |
14 |
| -textBox nameFile -> user input to text box name file<br> |
15 |
| -namefile -> record name file for program |
16 |
| -<pre> analisator.analyze(origin_file,file_save)</pre> |
17 |
| -origin_file -> include language C <br> |
18 |
| -file_save -> save Syntax analyze |
| 35 | +<p> All method save file to folder "translator_file"</p> |
19 | 36 | </p>
|
20 |
| -<h3>Reverse Polish Notation</h3> |
21 |
| -<p>Using: |
22 |
| -<pre>ReversePolishNotation RPN |
23 |
| -  marshalString(String^ textBox nameFile,std::string namefile) |
24 |
| -  RPN.reversePolishNotationAnalyze(file, "RPN.txt")</pre> |
| 37 | +<h3> TODO </h3> |
| 38 | +<p> |
| 39 | +Multiple inheritance is present.<br> The reason for this table decision.<br> |
| 40 | +Solution <br> |
| 41 | +1) What is, and inherit tables (identifiers, constants, etc.)<br> |
| 42 | +2) All classes will be inherited from the same class, as they should be "Translator", |
| 43 | +<br>but then you have to pass in the table constructor, and make them open or apply getters. |
| 44 | +3)Maybe using pattern "Template" |
25 | 45 | </p>
|
26 |
| -<p align="center"><img src="https://user-images.githubusercontent.com/71569051/220768107-19408d38-aa38-4276-893a-e7386115b499.png"></p> |
| 46 | + |
| 47 | +<p align="center"><img src="https://user-images.githubusercontent.com/71569051/232427242-16bbfa23-dd7b-4844-9fc9-bade42491847.png"></p> |
27 | 48 | </div>
|
28 | 49 | <h3>Development tools and Programming Language</h3>
|
29 | 50 | <p align="justify"> Microsoft Visual Studio Profession 2019</p>
|
|
0 commit comments