IMP FAQ

These questions and answers were originally developed for the Eclipse 3.1 release of IMP (then SAFARI) and are in the process of being updated to apply to the IMP release for Eclipse 3.2.  Most of the material here should be relevant to the Eclipse 3.2 release and we will be working to update any parts that may be outdated.  

We're also still in the early stages of developing this page.  If you have any suggestions for questions that you'd like to see answered here, please let us know!  (Contact information is availble through the Team page.)

FAQ are organized under the following headings:
On Installing IMP
On Running IMP
On Running LPG
On Running an IMP-based IDE
On Running X10DT
Miscellaneous

On Installing IMP

Q.  Prerequisites:  Are there prerequisite features that I need to install before I install IMP?
A.  Yes, you will need recent versions (possibly the most current versions) of the Polyglot compile framework and the LPG (LALR Parser Generator) runtime.  The IMP features will not install unless these are installed first (or at the same time).

Q.  Prerequisites:  Where can I find the prerequisite features to download?
A.  Each of the the prerequisites has its own Eclipse update site from which the respective feature can be installed using the Eclipse Update Manager.  Look on the Software page of this web site, under Installation, the location of these sites and instructions on using the Eclipse Update Manager.

Q.  Installing IMP:  Where can I find a version of IMP that I can install?
A.  IMP is available through an Eclipse update site on SourceForge.net.  The Eclipse Update Manager can be used to easily install  IMP from this site.  The location of the update site and Instructions for accessing it can be found on the Software page of this web site, under Installation.

Q.  Obtaining IMP source:  Where can I find the IMP source?
A.  The IMP source is available on SourceForge.net:  http://sourceforge.net/projects/eclipse-imp/

On Running IMP

Q. I see that I need to create my IMP IDE in a plugin project. Is there any particular sort of plugin project that I need?
A. The default values that you get when you create a new plugin project (File -> New -> Project ... -> Plugin-Project) are almost exactly what you need.

On the first page of the New Plug-in Project wizard, you do want the default project contents, you do want to create a Java project, and you do want to create a OSGi bundle manifest.

On the second page, you can set the plugin properties in whatever way is appropriate. You defnintely want to generate a plugin-class, and this class will make contributions to the UI. If your IDE project will have the same name as your language, then you should not edit the name of the plug-in class. If your project will have a different name from your language, then you will need to edit the plugin-class name (see elsewhere in the FAQ and other documentation about this). You do not want to create a rich-client application.

On the third page, you do not want to create a plug-in using one of the templates.

This will give you a perfectly good plugin project for IMP.

Q. What JVM does IMP require?
A. Safari will not work in an Eclipse that is running on a JVM before 5.0. Assuming that you have a version 5.0 JVM installed on your computer, you can assure that Eclipse runs with this JVM by using the -vm argument when Eclipse is invoked.

Q. IMP can't load a wizard class: When I try to run the first IMP wizard, the "Programming language descriptor" wizard,I immediately get an error pop-up that says "The selected wizard could not be started..."; why couldn't the wizard be started?
A. This message will occur if you are running Eclipse with a version of the JVM that predates 5.0. You must run IMP in an Eclipse workbench that is running on JVM 5.0 or later.

Q. Can't start "Programming language descriptor" wizard: When I run the Eclipse "New" wizard (File -> New), select "Programming language descriptor", and click "Next", nothing happens. There is no visible effect, no error message, and the "Next" button remains enabled. What has happened?
A. One possible cause is that no plug-in project is selected. The "Programming language descriptor" wizard (and all IMP wizards) must be executed in the context of a selected project, and this project must be a plug-in project. Usually this is hard to avoid, but when you first start Eclipse it comes up with no project selected. If you invoke the "Programming language descriptor" wizard in this state nothing constructive will happen.

We should provide better feedback about this. In the meantime, you can see an indication of the error by looking in the Error Log for the workbench in which you tried to run the wizard. If you did this in a runtime workbench, then you may also see a stack trace for an IllegalArgumentException in the console for the parent workbench.

Q.  "Singleton" error in MANIFEST.MF file:  When I run the "Programming language descriptor" wizard, I end up with a plugin manifest file (META-INF/MANIFEST.MF) that is marked with an error; what does that signify and what should I do?
A.  This happens sometimes (not always) and we don't really know why (anyone with an answer, please let us know!).  Actually, the manifest file has been generated (or updated) correctly, but Eclipse hasn't recognized that.  This is easily fixed.  If you look at the manifest file in the plugin manifest editor and right click on the error annotation on the left, you should see a pop-up menu with a quick fix; selecting this should fix the problem.  Alternatively, if you make some trivial change in the file (e.g., adding and removing a blank space) and then save the file, that will also prompt Eclipse to remove the error annotation.
Q.  Compile errors when an LPG wizard is run:  When I run the "New LPG Grammar and Parser Wrapper Wizard", the skeleton grammar specifications are generated, and the IMP classes for the parser wrapper and AST node locator are generated, but the generated classes have compile errors--what's wrong?
A. The compile errors are likely due to dependencies on Java classes that the LPG builder was supposed to generate from the grammar specifications (like the parser, lexer, and AST node types).  The errors mean that the LPG builder didn't run.  When you install IMP, the LPG builder included with IMP should be enabled and should run automatically whenever an LPG grammar file is generated or modified.  Sometimes this doesn't happen in a new workspace (perhaps especially in a runtime--or level 2--workspace).

To kick-start the LPG builder in this case you may need to run LPG initially as an external tool.  See the section "On Running LPG" below.  In our experience, once LPG has been run manually on a project the LPG builder begins to run automatically in response to further changes to grammar files in the project.

Q.  LPG builder doesn't run:  When I run one of the wizards that generates LPG grammar files, the LPG builder doesn't run and so the parser, lexer, and AST classes (if I've asked for those) don't get generated.
Q. Wizard doesn't finish: I am able to run a particular wizard and fill in the fields, but when I click on the "Finish" button nothing seems to happen. There is no error message and the wizard remains enabled. Why does nothing happen?
A. Probably there has been some internal error in the wizard. You may be able to find some indication of the problem in either of two different places. Check the Error Log of the workbench in which you are trying to run the wizard. Also, if the workbench is a runtime workbench, then you may see an exception and stack track reported in the console for the parent workbench.

If IMP did not put up an error message or diagnostic report, then it would be a help to us if you would file a bug report about this problem (if there doesn't seem to be one for it already).

Q. I'm generating services for my IDE, and I noticed that my plugin project has two plugin classes. Is that okay?
A. No, you should only have one plugin class. One easy way to end up with two is to give your language a different name than the name of the project in which you're developing your IDE. It is perfectly fine to do this, but then you need to take measures to assure that the plugin project and IMP agree on the name of one plugin class.

Suppose that your plugin project is called "fooIDE"; then by default Eclipse will name the plugin class "fooIDE.FooIDEPlugin". Now suppose that your language is called "fooLang". When you create a new IMP programming language description, IMP will by default create a plugin class "fooLang.FooLangPlugin". If you know that the name of your language will be different from the name of your IDE project (and you know what both names are), then one way to avoid the problem is to edit the default project plugin name when you create the plugin project.

Unfortunately, the IMP new "Programming language descriptor" wizard doesn't currently offer the same opportunity to change the name of the name of the plugin class that IMP generates, but we can look into changing that.

Of course, the other thing you can do is to give your plugin project and language the same name, if that's not a big inconvenience.

If you've moved beyond the stage of creating your project and defining your language, and you would prefer not to start over with that, you can try editing the metadata in your project to change the plugin associated with the project. Open the plugin.xml file in the Plug-in Manifest Editor and go to the Overview tab. Under General Information, browse for the langauge plugin class, select that, and save the plugin.xml file. (For IMP purposes, the language plugin class is the one you need as it will have the IMP specific information.) This may be enough to get the appropriate plugin class properly aligned with both the language and project. (We don't know of anything more that would need to be adjusted, but we haven't tried this very often.)

Q. After I run the JikesPG Grammar and Parser Wizard, the generated ParseController contains several compile errors because the import "lpg" cannot be resolved. What should I do?
A. When you run the JikesPG Grammar and Parser Wizard, a dependency on lpg.runtime is added to the plugin.xml file for your IDE project. However, it seems that Eclipse does not necessarily recoginze that the dependency has been added. To prompt Eclipse to recognize the new dependency, go to the Dependencies tab in the plugin.xml file for the project, make an insignificant change to the dependency list (for example, move the lpg.runtime dependency up and down), and then save the plugin.xml file. This should prompt Eclipse to recognize the new dependency, which in turn should cause the project to be rebuilt, and the compile errors should disappear.
(The above question addresses a problem with the version of IMP (or SAFARI) that runs on Eclipse 3.1.  We believe that we have fixed this in the IMP release for Eclipse 3.2, but if you see something like this with that version please let us know.)

Q. I ran the "Poor Man's Compiler" wizard for my IDE, and a compiler was generated, but I don't get any compiling in my development project. What should I do?
A. The compiler is ordinarily invoked by the builder. If you have run the Incremental Builder wizard for your IDE, then the generated code for the builder should contain a couple of commentd-out lines that would call the compiler. If you un-comment these lines, the compiler will be invoked from your builder. Note: When you uncomment the lines, you may see that the compiler class is not recognized--there is no import statement for it. You will need to provide the import statement for the builder class to compile with these lines (try CTRL-Shift-O).

If you have done the above and it still doesn't seem that the compiler is running automatically, be sure that your builder is running automatically. For more about that, see the previous question.


On Running LPG

Q.  I'm having trouble running LPG on my non-Windows system; what's wrong?
A.  At present (September 2007) LPG development is focusing on the Windows version and only the LGP executable for Windows is up-to-date.  If you want to run LPG on a non-Windows system, there are two possible alternatives.  One is to download the LPG source from the LPG project on SourceForge (http://sourceforge.net/projects/lpg/) and build it on your local system.  The other is to run the Windows version of LPG on your system under a Windows emulator, if you have one.  See the LPG documentation page for more information.

Q.  How do I run LPG as an external tool in Eclipse?
A.  To do this, you need to have the project lpg.runtime.java imported into your workspace.  (You can obtain the project lpg.runtime.java from the CVS repositoroy for the LPG project on SourceForge:  http://lpg.cvs.sourceforge.net/lpg/, CVS connection information:  pserver:anonymous@lpg.cvs.sourceforge.net:/cvsroot/lpg.)  This project contains both the LPG executable (in the folder "lpgexe") and the Eclipse launch configuration (in the folder ".launchConfigurations).  When this project is in your workspace, the launch configuration should be recognized automatically and should be available through the External Tools menu.   (To open the External Tools dialog, navigate "Run" -> "External Tools" -> "External Tools ..."; you should then find LPG under "Programs")

To run LPG as an external tool on a specific grammar specification (a ".g" file), select the grammar file and then invoke LPG from the External Tools dialog.   You can find more information on running LPG as an external tool in the LPG documentation.

On Running an IMP-based IDE

Q. I ran the Incremental Builder wizard for my IDE, and a builder was generated, but I don't get any building in my development project. What should I do?
A. For Eclipse to invoke the builder automatically on a development project, it has to be associated with the project. There is documentation about this in the IMP User's Guide and cheat sheets. The simple fix is to run the Nature Enabler wizard on your IDE project. Then go to your development project and right-click on the project. You should see a menu item that says "Enable languagename Builder" (which was created by the wizard). Selecting that item should enable your builder to run automatically on that project.

Q. I have generated "Poor Man's Compiler" and the compiler is running, but the Java code generated by the compiler has a Java compile error due to a call to a parameterless "main" function (and I didn't even write a parameterless "main" function!). What should I do?
A. The basic Poor Man's Compiler generates Java code that automatically includes a call to a parameterless "main" function so that the generated code can be executed. To make your code executable, you actually should write a parameterless "main" function (that in turn calls a "real" function in your code).

If you really don't want a parameterless main function in the generated Java code, then you should probably modify the generated Poor Man's Compiler code to prevent that.


On Running X10DT

Q.  I've installed IMP/X10DT, but I see no syntax highlighting and there's nothing in the Outline View. What gives?
A.  You need to be running Eclipse on a Java 5 VM. To do that, either make sure that the default VM on your system is a Java 5 VM, or use the '-vm' command-line option (which takes a fully-qualified path to the javaw.exe executable) to the eclipse.exe launcher. [Note that this option must appear in the command line before any "-vmargs" option.]

On Windows, there are two ways to do this: (1) if you launch eclipse using a shortcut, you can add the '-vm' option by editing the shortcut's "Target" field (on the "Shortcut" page of the shortcut's properties dialog), or (2) in any case, you can add this option to the file eclipse.ini in the same directory as the eclipse.exe executable.

Q.  I've installed IMP/X10DT, and I'm running on a Java 5 VM, but I see no syntax highlighting and there's nothing in the Outline View. What gives?
A.  Eclipse "kindly" remembers the editor last used on any given file, and will occasionally decide to revert back to the ordinary text editor. So: right-click on the file in the Package Explorer, and select "Open With..." => "IMP Editor". You should get your highlighting and outline back.
Q.  How do I add "X10 project" and "X10 class" to the "New" menu?
A.  To do this, go to "Window" => "Customize Perspective ..."  On the "Shortcuts" tab, select "New" in the "Submenus" pull-down and check the box labeled "X10" under "Shortcut Categories."
Q.  Is it possible to create an X10 working set?
A.  Not at this time.  We will be looking into this.  In the meantime, you may be able to achieve the effects you need by using one of the other types of available working sets. Java working sets may most precisely match what you would expect in an X10 working set.  Resource working sets will also let you group X10 (and other) elements.  Plug-in working sets will let you group any X10 plug-ins you may have.

Miscellaneous

Q.  Naming:  I see references to "SAFARI" and "UIDE"--what do these mean?
A.  "SAFARI" is the former name of IMP.  As "SAFARI", IMP was demonstrated at several conferences, and so that name was fairly widely disseminated.  Although we haven't managed to eradicate it totally from our code base and documentation, "SAFARI" should be totally supplanted by "IMP."

"UIDE", or "Universal IDE", is the former name of SAFARI.  Before we adopted the name "IMP", "SAFARI" was intended to totally supplant "UIDE", but we never finished with that.  You may still see references to UIDE in our code and documentation, but these should be replaced by "IMP."

UIDE grew out of an earlier project that had yet another name, but that name doesn't appear anywhere in the IMP code base or documentation, insofar as we know, so we're not going to say anything more about it.

Q.  Naming:  Is there a difference between JikesPG and LPG?
A.  No.  "LPG" is the current name for what was formerly known as "JikesPG."  We're working to update occurrences of the latter to the former but we probably haven't caught them all yet.





Get Firefox!