Nice TWiki > Dev > NiceCompiler > CompilationAPI TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Dev . { Changes | Index | Search | Go }
The compiler can be called from JVM languages (Nice, Java, ...) by using a high level API, instead of starting a different OS process (application). This is used by the command line compiler, but also by IDEs (EclipsePlugin at the moment), and might be useful in other contexts.

The main file defining the CompilationAPI is interface.nice.

One key argument to the compile method is a bossa.modules.Compilation object, which is used to configure the compilation (what package to compile, where to put the generated jar, ...).

The Compilation also contains a bossa.modules.CompilationListener, which receives messages that report the progress of the compilation. Here is its interface:

public interface CompilationListener
  void error  (Location location, String message);
  void warning(Location location, String message);

  /** A bug occured in the compiler. 
      @param url the adress where a bug report should be submitted.
  void bug(String stackTrace, String url);

  /** Reports the progress of compilation.
      phase can be: parsing, type-checking, generating code, ...
      the package can be null if the phase applies to the whole program 
      (testing dispatch, creating the archive, compiling to native code, ...).
  void progress(String packageName, String phase);

  /** Gives an approximation of how much of the compilation has been completed.
      @param proportion the current progress 
        (0.0 = just started, 1.0 = complete).
  void progress(float proportion);

-- DanielBonniot - 18 Jun 2003

Topic CompilationAPI . { Edit | Attach | Ref-By | Printable | Diffs | r1.1 | More }
Revision r1.1 - 18 Jun 2003 - 14:38 GMT - DanielBonniot
Parents: WebHome > NiceCompiler
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.