-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Pedro Victor Arouck Melo edited this page Dec 17, 2019
·
28 revisions
You need to create a package for the language on src/plantToCode/dataToCode
and implement the following interfaces:
- classToCode.py
- fileNameToCode.py
- inheritanceToCode.py
- interfaceToCode.py
- languageInterface.py
- methodModifierToCode.py
- methodToCode.py
To see a practical example, go to src/plantToCode/dataToCode/toPython
The method is located at src/plantToCode/write_files.py
def select_language(language: str) -> LanguageInterface:
language_writer: LanguageInterface
if language == "python":
language_writer = LanguagePython()
elif language == "java":
language_writer = LanguageJava()
else:
raise ValueError("This language is not implemented")
return language_writer
To use our solution there are some rules:
- It only accept Class5 class box and Interface2 interface box;
- Classes and Interfaces names should be in bold;
- Attributes must have a name and a type sepparated by :
- To use inheritances and implementations, you must use these arrows:
- To use interfaces you have to erase attributes fiels, using backspace until it erases the hr line like the image bellow: