Hide last authors
cmot 24.1 1 [[image:http://rtsys.informatik.uni-kiel.de/confluence/download/attachments/9470914/KiCoConsole1.jpg?version=6&modificationDate=1402352899000&api=v2||class="confluence-link"]]
cmot 10.1 2
cmot 9.1 3 The KIELER Compiler Console is a pure Java program that together with a KIELER RCA allows to call the KIELER Compiler from the console. For using the KIELER Compiler Console you need to
cmot 4.1 4
cmot 32.1 5 1. Enable the Compiler HTTP Server in the KIELER RCA and
cmot 29.1 6 1. Download the [[KielerCompilerConsole>>url:http://git.rtsys.informatik.uni-kiel.de:7990/projects/KIELER/repos/semantics/browse/standalone/KielerCompiler.jar?at=1c807c15f863b699d96d97038501663608d0f2bf&raw||shape="rect"]] ([[alternati>>attach:KielerCompiler.jar]][[ve Download>>attach:KielerCompiler.jar]]) as a runnable Java JAR archive and run it.
cmot 7.1 7
cmot 32.1 8 In the following we give a short quick start guide and describe the details for both, the enabling of the HTTP server and the possible command line calls of KiCo from the command line:
cmot 7.1 9
cmot 8.1 10
11
cmot 7.1 12 {{toc/}}
13
cmot 10.1 14
cmot 4.1 15
cmot 35.1 16 == Quick Start Guide (Online Compiler) ==
cmot 12.1 17
cmot 24.1 18 1. Download the [[KielerCompilerConsole>>url:http://git.rtsys.informatik.uni-kiel.de:7990/projects/KIELER/repos/semantics/browse/standalone/KielerCompiler.jar?at=1c807c15f863b699d96d97038501663608d0f2bf&raw||shape="rect"]] ([[alternative Download>>attach:KielerCompiler.jar]]) as a runnable Java JAR archive and save it to some location y on your hard drive
cmot 35.1 19 1. Change directory to location y, then type:
20
21
22 {{{java -jar KielerCompiler.jar compile.sccharts.com -f somescchart.sct -o somescchart.c CODEGENERATION}}}(((
23 where somescchart.sct must be a valid SCChart modeled with the KIELER SCCharts editor. You should find the generated c code in the file somsschart.c. Be sure that somescchart.sct is also located in directory y (or give the full path in "...").
24 )))
25
26 == Quick Start Guide (Local Compiler) ==
27
cmot 37.1 28 1. Download KIELER RCA from [[http:~~/~~/rtsys.informatik.uni-kiel.de/~~~~kieler/files/nightly/sccharts/>>url:http://rtsys.informatik.uni-kiel.de/%7Ekieler/files/nightly/sccharts/||shape="rect"]] extract it to some location x on your hard drive
cmot 35.1 29 1. Download the [[KielerCompilerConsole>>url:http://git.rtsys.informatik.uni-kiel.de:7990/projects/KIELER/repos/semantics/browse/standalone/KielerCompiler.jar?at=1c807c15f863b699d96d97038501663608d0f2bf&raw||shape="rect"]] ([[alternative Download>>attach:KielerCompiler.jar]]) as a runnable Java JAR archive and save it to some location y on your hard drive
cmot 12.1 30 1. Open console window and change directory to location x, then type:
31
32
cmot 31.1 33 {{{kieler -application de.cau.cs.kieler.kico.server.headless -noExit -p 5555 &}}}
cmot 12.1 34 1. Change directory to location y, then type:
35
36
cmot 27.1 37 {{{java -jar KielerCompiler.jar 5555 -f somescchart.sct -o somescchart.c CODEGENERATION}}}(((
cmot 12.1 38 where somescchart.sct must be a valid SCChart modeled with the KIELER SCCharts editor. You should find the generated c code in the file somsschart.c. Be sure that somescchart.sct is also located in directory y (or give the full path in "...").
39 )))
40
cmot 21.1 41
42
cmot 34.1 43 == Enable the KielerCompiler HTTP Server ==
cmot 10.1 44
cmot 39.1 45 Before you can use the KielerCompiler.jar from the console, you need to start the KIELER RCA and activate the HTTP Server. After downloading the KIELER SCCharts RCA (as descibed in the paragraph before), activate the sever as illustrated in the figure below. This is done using the button at 1. shown in the screenshot below. When pressing it the windows shown at 2. is displayed and allows to enable or disable the server and also to modify the default port of 5555. Whenever the server was enabled and is started, you will see its job running at 3. in the lower region of the KIELER RCA. When you enabled the server in previous runs of the KIELER RCA it will automatically started when you run KIELER again.
cmot 10.1 46
47 [[image:attach:KiCoConsole0.jpg]]
48
cmot 32.1 49 === Non-GUI  HTTP Server ===
cmot 10.1 50
cmot 32.1 51 Alternatively (after you configured the port) you can start the Kieler Compiler HTTP Server via command line:
cmot 10.1 52
cmot 31.1 53 {{{kieler -application de.cau.cs.kieler.kico.server.headless -noExit [-p <port>] [-d]}}}
cmot 10.1 54
cmot 32.1 55 This will start a background process with the KIELER Compiler HTTP Server. Optionally you can specify a (new) listening port for the HTTP server using "-p <port>" or  "–port <port>",e.g. "-p 5555". The option -d or ~-~-debug enables the debug mode with verbose debug output messages.
cmot 10.1 56
cmot 22.1 57
cmot 21.1 58
cmot 32.1 59 == Using the KielerCompiler.jar from Console ==
cmot 10.1 60
cmot 24.1 61 Download the [[KielerCompilerConsole>>url:http://git.rtsys.informatik.uni-kiel.de:7990/projects/KIELER/repos/semantics/browse/standalone/KielerCompiler.jar?at=1c807c15f863b699d96d97038501663608d0f2bf&raw||shape="rect"]] ([[alternative Download>>attach:KielerCompiler.jar]]) as a runnable Java JAR archive and start it using java:
cmot 4.1 62
63 {{{java -jar KielerCompiler.jar &#x3c;host&#x3e;:&#x3c;port&#x3e; [Options] &#x3c;transformationID_1&#x3e; .. &#x3c;transformationID_n&#x3e;}}}
64
cmot 33.1 65 In the above screenshot you see the KielerCompiler options when calling with no/too few parameters. The host or the port are mandatory parameters. By default the port **5555** is used and the default host is **localhost**. If you specify the port you do not need to specify localhost, if you specify the host you do not need to specify 5555. The following options are available:
cmot 4.1 66
cmot 30.1 67 * -f <filename> : Use a specific input file for the main model (and not the console)
68 * -i <filename> : Include additional input files that are referenced by the main model, note that the order for using multiple -i options is important: Use the order -i file1 -i file2 if file1 has references to file2 but file2 has NO references to file1!
cmot 4.1 69 * -o <filename> : Use a specific output file (and not the console)
70 * -v : Use verbose compilation, more error messages
71 * -s: Use strict mode compilation (only apply selected transformations)
cmot 5.1 72
cmot 22.1 73
cmot 21.1 74
cmot 18.1 75 == Transformation IDs ==
cmot 13.1 76
cmot 18.1 77 In order to use the KIELER Compiler from the command line you need to know the ID of the transformations you would like to apply.
cmot 13.1 78
cmot 38.1 79 (% class="wrapped" %)
cmot 13.1 80 |=(((
cmot 18.1 81 Common Transformation IDs
82 )))|=(((
83 More Transformation IDs
84 )))
85 |(((
cmot 19.1 86 Here are the most common ones:
cmot 18.1 87
cmot 38.1 88 (% class="wrapped" %)
cmot 18.1 89 |=(((
cmot 13.1 90 Transformation ID
91 )))|=(((
92 Description
93 )))
94 |(((
95 REFERENCE
96 )))|(((
97 Expand reference states
98 )))
99 |(((
100 EXTENDED
101 )))|(((
102 All extended SCCharts transformations resulting in a Core SCChart
103 )))
cmot 18.1 104 |(((
cmot 13.1 105 CORE
cmot 18.1 106 )))|(((
cmot 13.1 107 All core SCCharts transformations resulting in a Normalized SCChart
108 )))
cmot 18.1 109 |(((
cmot 13.1 110 SCGRAPH
cmot 18.1 111 )))|(((
cmot 13.1 112 Transform to an SCG
113 )))
cmot 19.1 114 |(% colspan="1" %)(% colspan="1" %)
115 (((
116 CODEGENERATION
117 )))|(% colspan="1" %)(% colspan="1" %)
118 (((
119 Generate C code
120 )))
cmot 18.1 121 )))|(((
cmot 38.1 122 (% class="content-wrapper" %)
123 (((
uru 26.1 124 In order to get other transformation IDs you can use the KIELER Compiler Selection View. It will show the transformation ID for each transformation or transformation group as a tooltip text that will show up if you place and hold the mouse over the transformation node as shown below:
cmot 13.1 125
cmot 17.1 126 [[image:attach:TRANSFORMATIONIDs.jpg]]
cmot 18.1 127 )))
cmot 38.1 128 )))
cmot 17.1 129
cmot 18.1 130
131
132
133
cmot 15.1 134 == Example Calls ==
cmot 5.1 135
cmot 10.1 136 === Example 1 ===
cmot 6.1 137
cmot 5.1 138 [[image:attach:KiCoConsole2.jpg]]
139
140 When calling the KielerCompiler with the ABORT transformation and console output.
141
142
143
cmot 10.1 144 === Example 2
145 [[image:attach:KiCoConsole3.jpg]] ===
cmot 5.1 146
147 Using the KielerCompiler with CODEGENERATION transformation and a specific output file.
148
149
150
cmot 10.1 151 === Example 3
152 [[image:attach:KiCoConsole4.jpg]] ===
cmot 5.1 153
cmot 9.1 154 Using the KielerCompiler with a non exisiting transformation which generates an error message.