cancel
Showing results for 
Search instead for 
Did you mean: 

Where's the CAL compiler?

Former Member
0 Kudos

Looking at the CAL distribution, I see an interpreter (ICE), development environment (GemCutter), Eclipse integration, but Ido not see a compiler to produce some form of output (class files?). What am I missing?

Accepted Solutions (0)

Answers (1)

Answers (1)

joseph_wong
Discoverer
0 Kudos

The Quark Framework includes a compiler, but it can only be invoked programmatically. It is not currently available as a command line tool.

The CAL compiler compiles CAL source files to a binary representation (known as compiled module information (.cmi) files) and optionally to compressed Java class files (with file extension .lc). If you download the binary distribution of Open Quark, you will find a lecc_runtime directory under Quark/bin/cal/debug/, which contains precompiled binary (.cmi) files for the modules included in the distribution.

Whenever you use one of the 3 environments you mentioned (ICE, Gem Cutter, or the Eclipse integration) to execute CAL code, the compiler is invoked to produce the Java bytecode which is then executed.

For deployment, you can use the Quark Framework to produce JAR files containing compiled CAL modules. These files can be created via the :car command in ICE or the âu20ACu0153Workspace > Export to CAL Archivesâu20AC menu in Gem Cutter. To deploy these JAR files, they just need to be included on the Java classpath, and all of the CAL modules contained therein are made available to the host Java program.

A brief demo on how to create these JAR files can be found at the end of the video âu20ACu0153Walkthrough of some Developer Tool Featuresâu20AC available on the CAL website (starting at time index 21:45).

joseph_wong
Discoverer
0 Kudos

<p>If you are interested in looking at the Java classes generated by the CAL compiler, you can run ICE or Gem Cutter with the VM argument:</p><p> -Dorg.openquark.cal.machine.lecc.source</p><p>By doing so, the compiler will produce Java source files and class files and write them to the subdirectories of the lecc_runtime directory, where they can be viewed. </p>