EPIC development

2009-02-17
2013-05-20
  • Zaid Sheikh
    Zaid Sheikh
    2009-02-17

    I would like to know how the EPIC plug-in has been built. For example, did the developers use an existing framework for plug-in development, what APIs they used etc.

    Also how does EPIC do parsing and syntax coloring using the perl interpreter? ( I mean does EPIC call the perl interpreter every time for syntax coloring , or if not, how does it do that.)

    I have downloaded the source code, but am a bit lost there. I need some guidance on what-is-where in the source code.

     
    • There used to be a developers guide but cannot find an active URL.

      I have a cached copy it is a little thin but has:

      (I have no idea if the information below is still current)

      Hacking EPIC in 15 Minutes

      EPIC ships with complete source code. If you wish to debug now, or try a quick fix, this short list of steps is for you:

         1.

            Install the ANTLR plug-in through its update site - follow installation instructions.
         2.

            Install the version of EPIC that you wish to hack (you probably already have).
         3.

            Set the default compiler compliance level to 1.4, both for the source code and for class files (Window->Preferences..., then Java->Compiler).
         4.

            Choose File->Import..., then External Plug-ins and Fragments, then Projects with source folders.
         5.

            From the left pane, choose org.epic.* plug-ins, click Add, then Finish. You now have EPIC's source code in your workspace.
         6.

            Choose Toggle ANTLR project nature from the context menu on the project org.epic.perleditor.
         7.

            Choose Project->Clean... and select org.epic.* projects. This step should build all projects without errors.
         8.

            Choose Run->Debug..., create a launch configuration of type Eclipse Application, point it to some workspace and click Debug. You can now change the EPIC code and see the results immediately in the launched workbench. For some changes, relaunching the workbench is required.
         9.

            If you wish to distribute your changes (e.g., install them in your real workbench), right-click on plugin.xml in each of the plug-ins and choose PDE Tools->Create Ant Build File... from the context menu. This will create a build.xml file. Right-click on it, choose Run As->Ant Build... and select the target named zip.plugin. This will create an archive which you can unzip under $ECLIPSE_HOME/plugins as a replacement for the original version shipped with EPIC (which you have to delete manually). Run Eclipse with the option -clean to complete the installation. Congratulations, you are now running your own version of EPIC.

      Hope it helps
      Gordon Hutchison.

       
    • Jan Ploski
      Jan Ploski
      2009-02-17

      EPIC was built mostly following the Eclipse API specs and borrowing implementation examples from JDT.

      The syntax coloring is not done using the Perl interpreter. It is done using a custom parser based on ANTLR (see perl.g and classes from it). Because Perl has no language specification apart from its own implementation, EPIC's parser rules are a result of guesswork and fixes of actual bugs experienced by the users.

      The usual approach to understanding any Eclipse plug-in is to start Eclipse in debug mode, set breakpoints at some interesting points and follow from there. The interesting entry points can be found by inspecting user interface and interactions (e.g. find the class in which the label "foo" is output to the screen) or you can just guess from class names (e.g. syntax coloring might occur in classes that contain the word 'syntax' or 'token' etc.). Of course this empirical approach is supplemented by the official API documentation of Eclipse (online help) and inline documentation of EPIC classes/interfaces.

       
    • Zaid Sheikh
      Zaid Sheikh
      2009-02-17

      Thanks for the quick reply. I think that will be all to get me started.