NetBeans IDE 7.0 Prolog Editor

I created a Prolog Editor for NetBeans IDE 7.0, which meant no more than updating the GeeWhiz Prolog Editor. It provides a few cool features, as can be seen below:

I have also installed the Prolog Editor into other applications on the NetBeans Platform, where it works fine, too. In a NetBeans Platform application, you can also take a JEditorPane and bind it to the "text/x-prolog" MIME type provided by the Prolog Editor, which will enable the syntax coloring to be applied to your JEditorPane.

Get it here. Feedback welcome.

Comments:

Perhaps the Navigator entries should be named "sift/2", "remove/3", etc., perhaps with subnodes for the cases.

Posted by Jesse Glick on July 25, 2011 at 02:11 AM PDT #

Hi,

because we try out tuProlog in a Project for validation and data transfer, the Prolog editor comes in handy and works quite well. There is a bug in the editor with lists in lists like:

evalRights(Val, [ [Val, Right] | Tail], Default, Right).

where the ... [Val, Right] ... does seem to break the syntax highlighting/checking. I couldn't find the source code for the recent version of the plugin but only something tagged version "1.5" which seemed to be meant for Netbeans 6.x. Any hints where/how to get it?

Thanks,
Christoph

Posted by guest on July 25, 2011 at 06:35 PM PDT #

Hi Christoph, get the sources here:

http://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.0/misc/Prolog

Feel free to join the project and commit your changes.

Posted by Geertjan on July 25, 2011 at 10:21 PM PDT #

Cool! Not sure this is the right place, but I am getting an error trying to compile my prolog programs in NB 7.0.1:
Output of running /opt/local/bin/swipl -c /Users/samueljoseph/Code/prolog/TestNBProlog/src/sieve.pro is:

% library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,928 bytes
% /Users/samueljoseph/Code/prolog/TestNBProlog/src/sieve.pro compiled 0.01 sec, 3,160 bytes
% /opt/local/lib/swipl-5.10.4/library/listing compiled into prolog_listing 0.00 sec, 39,472 bytes
ERROR: '$mark_executable'/1: file `a.out' does not exist (No such file or directory)

write permissions perhaps ...? I wasn't allowed to add comments to the geewhiz site to submit bug reports ... :-(

Posted by Sam Joseph on August 22, 2011 at 03:46 AM PDT #

I noticed that (on NB 701, anyway), the visualization code is broken. I also notice this code seems to use the now-deprecated GLF (I think these are related, since the AST class returns null for its root node because it can no longer import ParserManagerImpl). (I really loved [what I understood of] the idea behind the GLF, but I suppose it was had to get it to perform well??)

What would it take to update this module? Which APIs should it use instead? I'd be willing to take a stab, but have found that knowing which of the language/parser extension mechanisms is the right one to be difficult to keep up with.

Posted by Chris on November 23, 2011 at 04:52 AM PST #

Bravo! It is very useful!

Posted by Igor Maznitsa on December 28, 2011 at 06:32 AM PST #

Hi Geertjan, this is a really good work!
I'm hoping to see something similar to support jb oss Rules DRL syntax. Do you think that you can guides us implementing that kind of plug in for NB? I think that with something to start with plus some guidance we can do the rest of the work, the Rules project is getting a lot of attention right now and it will be great to support it.
Another related questions is the support for BPMN2 models, do you know something about that?
Cheers

Posted by salaboy on January 11, 2012 at 03:36 AM PST #

installed this plug-in v2 on NetBeans 7.1, Win 7 64bit, Java 1.6.0_29. Creating a new Prolog files causes an error (missing license file it says) and the View - Show Prolog Diagram does not work (no Prolog file to view it says). The compilations seem to work but how do i run? Run - Run File is greyed out.
thanks

Posted by guest on March 03, 2012 at 04:42 PM PST #

Same here, how do I actually RUN the program after compilation?
Any advice would be greatly appreciated, thanks

Posted by Timo on March 23, 2012 at 01:25 AM PDT #

Getting some errors.. Could you provide some more introduction on configuring the plugin please? Would be awesome!

Output of running "C:\Program Files (x86)\pl\bin\swipl" -c [...]\src\family1.pro is:

% [...]\src\family1.pro compiled 0.00 sec, 6 clauses
% autoloading qsave:current_foreign_library/2 from c:/program files (x86)/pl/library/shlib
% autoloading prolog_autoload:portray_clause/1 from c:/program files (x86)/pl/library/listing
% autoloading prolog_autoload:clause_info/4 from c:/program files (x86)/pl/library/prolog_clause
% autoloading prolog_debug:backtrace/1 from c:/program files (x86)/pl/library/prolog_stack
% autoloading oset:reverse/2 from c:/program files (x86)/pl/library/lists
% autoloading prolog_autoload:clause_name/2 from c:/program files (x86)/pl/library/prolog_clause
% Autoloader: iteration 1 resolved 10 predicates and loaded 6 files in 0.062 seconds. Restarting ...
% Autoloader: loaded 10 files in 2 iterations in 0.078 seconds
ERROR: '$mark_executable'/1: file `a.out' does not exist (No such file or directory)

Posted by guest on April 25, 2012 at 02:57 PM PDT #

when i run my program i have this error
Error occurred running Prolog compiler. Check options.
In the main menu go to 'Tools / Options / Miscellaneous / Prolog'.
Command string is swipl -c C:\Users\user\Documents\NetBeansProjects\NewProject\src\sieve.pro

Posted by guest on May 17, 2012 at 12:51 AM PDT #

I have the same probleme, i have the message : Error occurred running Prolog compiler. Check options.
In the main menu go to 'Tools / Options / Miscellaneous / Prolog'.
Command string is swipl -c C:\Users\user\Documents\NetBeansProjects\NewProject\src\sieve.pro

Posted by Fukoro on May 20, 2012 at 08:23 AM PDT #

In Netbeans 7.2 RC1 Prolog plugin installs fine.
New Project gives an example of sieve.pro with support files.
Clicking Run on project produces:

nt -f "C:\\Documents\\User\\Desktop\\PrologTest" -Dignore.failing.tests=true test
init:
Deleting: C:\Documents\User\Desktop\PrologTest\build\built-jar.properties
deps-jar:
Updating property file: C:\Documents\User\Desktop\PrologTest\build\built-jar.properties
compile:
Created dir: C:\Documents\User\Desktop\PrologTest\build\test\classes
compile-test:
Created dir: C:\Documents\User\Desktop\PrologTest\build\test\results
No tests executed.
test-report:
test:
BUILD SUCCESSFUL (total time: 0 seconds)

Clicking Run produces dialog with message:
<No main classes found>

Posted by guest on July 05, 2012 at 02:54 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today