Comments (3)
For the specific Java classes, a possible solution would be to create a new template file (copy the java ones) and manually translate these classes. This translation can either be a full translation or a half translation where the TXL will be able to properly interpret the rest.
Note that research may have to be made to find a proper Python replacements for the Java specific classes. Also, the after keyword is linked with this issue as the after keyword generates the specific TimerTask java class.
from umple.
Here is some context as to why the features ‘active’ and ‘after’ were left as out of scope for the initial beta. When these keywords are included in Umple code, they will generate Java files that contain nested classes (a class within a class). The nested classes (ex: TimerTask when you use ‘after’) are full of java specific code. These classes are also independent of the Umple code written by the user. Since these classes are always the same, it is simply not worthwhile to update the TXL to parse and translate the code in those classes. Since the focus of our approach was TXL, we decided to leave these classes (and the Umple keywords that generates them) as out of scope given the time constraints we had. We suggest that these classes be translated by hand and inserted in the java intermediate code before TXL translation. These can be wrapped around tags so the TXL can ignore them and not need to parse or translate them like regular code. We followed a similar approach for user functions (functions with user code which can be anything) and it worked quite well. The tags are then removed after the TXL translation, so they do not stay in the final output.
TXL has a feature that allows you to specify what you want it to consider comments. TXL then completely removes these and ignores what’s inside. Ideally, these comments would still be in the output as they help orient users in the generated class and specify from what relations certain methods originate. To translate these comments, the comments will have to parsed and translated along with the regular code. This will take new TXL rules to translate them and changes to the grammar to accept comments wherever they might appear (at a quick glance, making comments [class_body_element] and [statement] might be enough).
TXL is a funny language to work with and when you don’t know what you are doing it can be difficult to locate the source of errors and mistakes. Get familiar with the documentation https://www.txl.ca/txl-docs.html . Maybe write a few practice programs before trying to dive into the existing code.
from umple.
Umple example testing skipped for Python generation. This issue would hopefully allow these examples to be tested (note that as time goes by other examples may be added that are not listed here)
Class Diagrams :
Contains the key word "after()" which generates TimerTask Java specific code :
- Access Control 2 (AccessControl2.ump)
State Machines :
Contains the key word "after()" which generates TimerTask Java specific code :
- Canal Lock (CanalLockStateMachine.ump)
- Dishwasher (Dishwasher.ump)
- Elevator (Elevator_State_Machine.ump)
- Library Load (LibraryLoanStateMachine.ump)
- Telephone Set Modes (TelephoneSystem2.ump)
- Timed Commands (TimedCommands.ump)
- Traffic Lights B (TrafficLightsB.ump)
Contains the "Timer" object which generates a Thread java specific class :
- Microwave Oven (MicrowaveOven2.ump)
- Runway (Runway.ump)
- Security Light (SecurityLight.ump)
Depends on multiple Java specific classes :
- TCP/IP Simulation (TcpIpSimulation.ump)
Can't pinpoint the exact Umple code issue but it is either "Runtime.getRuntime()" or "Thread" which causes the "ConsoleTracer.java" Java specific class to be generated :
- Phones and Lines (Phone.ump)
Manual :
Contains the Java specific Thread class :
- Auto-Transitions1.ump
- Ball_Game.ump
- BcmsBaseConfiguration.ump
- BcmsMultipleCrisis-Multiple-Coordinator-Configuration.ump
- StateMachineActionsandDoActivities1.ump
Contains the Java specific Message class + Threading :
- CodeInjectioninCustomMethods1.ump
- CodeInjectioninEventMethods1.ump
- QueuedStateMachines1.ump
- UnspecifiedEvents2.ump
Contains Java specific classes used to generate HTML :
- BasicTemplates1.ump
- BasicTemplates2.ump
- BasicTemplates3.ump
- HtmlGeneration.ump
Others :
- AroundStatement1.ump (Code Injection)
- AroundStatement2.ump (Code Injection)
- PingPong.ump (Code Injection)
- PooledStateMachines1.ump (Contains Hashmaps)
- StateDependentMethods1.ump (Return nothing on a switch case)
- StateDependentMethods2.ump (Return nothing on a switch case)
- TcpIpSimulation.ump (uses synchronized keyword)
- W082ConflictingModifiers.ump (Code Injection)
from umple.
Related Issues (20)
- Grammar railroad diagram
- Compiler analysis failure when there is a duplicate association in a subclass, and also a further superclass. HOT 8
- Umple Generates Broken Code for Unique Immutable Attributes HOT 7
- Consider creating a GLSP editor for Umple
- Create equivalent to dev-tools core commands for those developing Umple on windows dev-tools-windows HOT 2
- Requirements parsing crashes in certain cases when a requirement indsicated in an implementsReq statement does not have a matching req statement HOT 2
- Requirements problems should raise warnings rather than printing to standard output
- Requirements with the same name should be combined as mixins HOT 1
- Fix and improve the default requirements generator
- displayColour syntax not checked well and can give false error messages HOT 2
- StateTable statemachine test - concurrentAutoTransitionStateTable - test fails due to non-determinism
- Hyperlink Error on Warning 1016
- Requirements should not have to precede req implementation, so implementations should only be checked in second pass
- "Synchronized" keyword translation from Java to Python is incomplete
- Declare usage of PHP dynamic properties in UmpleOnline
- Improve UmpleOnline editing of classes and state machines HOT 1
- Add setup.bat to build and run docker on umpleCodeExecution for windows development
- Make Java code execution available on windows host development environment
- Develop Python execution
- Some Python code generated contains error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umple.