Re: [eclipse-clp-users] vsc-prolog (VS Code extension) supports eclipseclp now

From: Joachim Schimpf <jschimpf_at_...311...>
Date: Sun, 17 Sep 2017 18:57:37 +0100
Hi Arthur,

On 17/09/17 16:53, Arthur Wang wrote:
> Hi all,
> 
> Several weeks ago, I published an extension of VS Code to support prolog, 
> initially for swi-prolog. Now I have extended some features for eclipseclp. You 
> are welcome to have a try if you use VS Code and eclipseclp. Visit the 
> repository for details: https://github.com/arthwang/vsc-prolog__

Thank you very much for this contribution, I have added a link at
http://eclipseclp.org/software/index.html


> 
> By the way, I came across some difficulties when tried to implement advanced 
> features such as "find all references", "refactor predicates" and "debugger". I 
> have not found any equivalents of swi-prolog such as prolog_codewalk, 
> prolog_trace_interception in eclipseclp documents.

This is of course highly non-standard functionality, but I would
expect that ECLiPSe provides what you need, in some form or other.

For cross-referencing, have a look at library(xref), which reads a
source file and generates a call graph.  It is built on top of
the generic library(source_processor), which is also underlies
the ECLiPSe compiler and other source processing tools.

See:
http://eclipseclp.org/doc/bips/lib/xref/index.html
http://eclipseclp.org/doc/bips/lib/source_processor/index.html


It is also possible to intercept the tracer, although this is
less well documented.  Here is an example:

% Begin file my_tracer.ecl
:- import sepia_kernel.
my_trace_line_handler(_, trace_line{port:Port,frame:tf{goal:Goal}}) :-
         printf("My trace: port=%w, goal=%w%n", [Port,Goal]).
:- set_event_handler(252, my_trace_line_handler/2).
% End file my_tracer.ecl


Compile the above file and see the customized tracer output:

[eclipse 1]: [my_tracer].
my_tracer.ecl compiled 392 bytes in 0.00 seconds
Yes (0.08s cpu)

[eclipse 2]: trace((X is 3+4, writeln(x=X))).
My trace: port=call, goal=X is 3 + 4
My trace: port=exit, goal=7 is 3 + 4
My trace: port=call, goal=writeln(x = 7)
x = 7
My trace: port=exit, goal=writeln(x = 7)



> 
> Any suggestions and helps are greatly appreciated.
> 
> With best regards,
> 
> Arthur Wang


Cheers,
Joachim
Received on Sun Sep 17 2017 - 17:57:48 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:21 CEST