2 Replies Latest reply: Feb 22, 2007 4:37 PM by Joseph Wong RSS

Where's the CAL compiler?

Currently Being Moderated

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?

  • CAL compiler
    Joseph Wong
    Currently Being Moderated

       

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

     

    • Generating Java source and class files
      Joseph Wong
      Currently Being Moderated

      <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>

Actions