Skip to content

StrongerProgrammer7/MethodsDevelopmentTranslator

Repository files navigation

** This work is being done as part of the Course Method development translator **

MethodsDevelopmentTranslator

The repository has translator from C to C#, on the language C++

Base file: (russian language: Vishnikov Y.M. BalabaevaI.Y. PDF):

[](https://github.com/StrongerProgrammer7/MethodsDevelopmentTranslator/files/10741055/_.pdf)

6 Classes

  • Translator (parent)
  • LexicalAnalisator (inherit up, parent)
  • ReversePolishNotation (inherit up, parent)
  • SyntaxAnalisator (inherit up, parent)
  • Translate_csharp (inherit up, parent)
  • TranslatroFromCToCSharp(inherit up, parent)
Users should use last class. Last class using next methods:
  • lexicalAnalyze
  • reversePolishNotAnalyze
  • syntaxAnalyze
  • translateToCSharp

Using:

TranslatorFromCToCSharp translator;
     translator.lexicalAnalyze(fileText_C);
     translator.reversePolishNotAnalyze();
     In condition(if) translator.syntaxAnalyze() == true
     translator.translateToCSharp();

All method save file to folder "translator_file"

TODO

Multiple inheritance is present.
The reason for this table decision.
Solution

  1. What is, and inherit tables (identifiers, constants, etc.)
  2. All classes will be inherited from the same class, as they should be "Translator",
    but then you have to pass in the table constructor, and make them open or apply getters
  3. Maybe using pattern "Template"

Development tools and Programming Language

Microsoft Visual Studio Profession 2019

Language C++, C++/CLI (Windows forms)