Changes for page Code Generation with Xtend
Last modified by Richard Kreissig on 2025/01/30 12:03
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -42,8 +42,14 @@ 42 42 ''' 43 43 {{/code}} 44 44 ))) 45 -1. Decide, which programming language to generate code for. The easiest will probably be Java, but other languages should be fine too. Your code is supposed to generate code that is complete and compilable in your target language. 45 +1. Decide, which programming language to generate code for. The easiest will probably be Java, but other languages should be fine too. Your code is supposed to generate code that is complete and compilable in your target language. Make sure that your code generation supports transformed Turing Machines as well as the sample programs we provide below. 46 46 47 +Here's a few hints as to what your implementation should support: 48 + 49 +* The imperative language supports arrays, which you could implement as lists or arrays. Either way, you should make sure that the generated code does not throw exceptions for reasonable array indices. Ideally, your code makes no assumptions on array sizes. 50 +* You will have to generate some kind of a main method which takes care of initializing input variables, running the program, and printing the result. To initialize input variables, your generated code could ask the user for input on the console. 51 +* Try to ensure that the generated code is readable and properly indented. 52 + 47 47 = Making the Code Generation Available = 48 48 49 49 As in the previous tutorial, add a menu contribution to the {{code language="none"}}...compiler.ui{{/code}} plug-in to make the code generation available in the interface. Since your code generation implementation is expected to work for arbitrary (valid) instances of the programming language model, your menu contribution should be available for all programming language models and their textual representations. (".imperative" and ".pseudo" files) As in the previous tutorial, your handler should create a new file in the same directory as the input file and refresh the folder afterwards to have the file show up in the project explorer.
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -360471 01 +3604711 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/360471 0/Code Generation with Xtend1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/3604711/Code Generation with Xtend