# KIELER Command Line Compiler

Last modified by cmot on 2023/09/11 16:16
Export
Office Formats
Export as PDF Export as ODT Export as RTF
Other Formats

Select the pages to export:

select all/ none

Legend:
  Created Page
  Modified Extension Page
  Clean Extension Page

Export as HTML

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

1. Enable the Compiler HTTP Server in the KIELER RCA and
2. Download the KielerCompilerConsole (alternati ve Download) as a runnable Java JAR archive and run it.

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:

- - Quick Start Guide (Online Compiler)
  - Quick Start Guide (Local Compiler)
  - Enable the KielerCompiler HTTP Server
    - Non-GUI HTTP Server
  - Using the KielerCompiler.jar from Console
  - Transformation IDs
  - Example Calls
    - Example 1
    - Example 2
    - Example 3

## Quick Start Guide (Online Compiler)

1. Download the KielerCompilerConsole (alternative Download) as a runnable Java JAR archive and save it to some location y on your hard drive
2. Change directory to location y, then type:

    java -jar KielerCompiler.jar compile.sccharts.com -f somescchart.sct -o somescchart.c CODEGENERATION

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 "...").

## Quick Start Guide (Local Compiler)

1. Download KIELER RCA from http://rtsys.informatik.uni-kiel.de/~kieler/files/nightly/sccharts/ extract it to some location x on your hard drive
2. Download the KielerCompilerConsole (alternative Download) as a runnable Java JAR archive and save it to some location y on your hard drive
3. Open console window and change directory to location x, then type:

    kieler -application de.cau.cs.kieler.kico.server.headless -noExit -p 5555 &#x26;

1. Change directory to location y, then type:

    java -jar KielerCompiler.jar 5555 -f somescchart.sct -o somescchart.c CODEGENERATION

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 "...").

## Enable the KielerCompiler HTTP Server

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.

### Non-GUI HTTP Server

Alternatively (after you configured the port) you can start the Kieler Compiler HTTP Server via command line:

    kieler -application de.cau.cs.kieler.kico.server.headless -noExit [-p &#x3c;port&#x3e;] [-d]

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.

## Using the KielerCompiler.jar from Console

Download the KielerCompilerConsole (alternative Download) as a runnable Java JAR archive and start it using java:

    java -jar KielerCompiler.jar &#x3c;host&#x3e;:&#x3c;port&#x3e; [Options] &#x3c;transformationID_1&#x3e; .. &#x3c;transformationID_n&#x3e;

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:

- -f <filename> : Use a specific input file for the main model (and not the console)
- -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!
- -o <filename> : Use a specific output file (and not the console)
- -v : Use verbose compilation, more error messages
- -s: Use strict mode compilation (only apply selected transformations)

## Transformation IDs

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.

Common Transformation IDs | More Transformation IDs
--- | ---
Here are the most common ones:
Transformation ID | Description
--- | ---
REFERENCE | Expand reference states
EXTENDED | All extended SCCharts transformations resulting in a Core SCChart
CORE | All core SCCharts transformations resulting in a Normalized SCChart
SCGRAPH | Transform to an SCG
CODEGENERATION | Generate C code
| 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:

## Example Calls

### Example 1

When calling the KielerCompiler with the ABORT transformation and console output.

### Example 2

Using the KielerCompiler with CODEGENERATION transformation and a specific output file.

### Example 3

Using the KielerCompiler with a non exisiting transformation which generates an error message.

Tags:
Created by cmot on 2014/06/09 18:47

- Comments (0)
- Attachments (7)
- History
- Information

# Quick Links

KIELER on GitHub
RTSYS Homepage

XWiki 14.4.7