Problem with scopeLinker

Discussions related to Visual Prolog
Post Reply
Martin Meyer
VIP Member
Posts: 232
Joined: 14 Nov 2002 0:01

Problem with scopeLinker

Post by Martin Meyer » 31 Aug 2017 18:24

Hello Thomas,

moving my code to new great VIP version 8 I came across a problem. It reproduces when I start a new 'Console application' project and create a new interface in a new package with contents:

Code: Select all

interface myDomains{@Type}   domains     dom = @Type.   end interface myDomains
In main.pro I replace the open core line so that the code becomes

Code: Select all

implement main     open myDomains{unsigned}   clauses     run() :-         succeed.         % place your own code here   end implement main
Compiling it I get
error c998 : Not implemented: scopeLinker::scopeExpr2Namespace: Scope expressions with arguments
error c218 : Unknown class/interface/namespace 'myDomains{::unsigned}' in pack 'main.pack'
Regards Martin

User avatar
Thomas Linder Puls
VIP Member
Posts: 2333
Joined: 28 Feb 2000 0:01

Post by Thomas Linder Puls » 1 Sep 2017 7:58

Thank you, I can reproduce the problem

We will look at it.
Regards Thomas Linder Puls
PDC

User avatar
Thomas Linder Puls
VIP Member
Posts: 2333
Joined: 28 Feb 2000 0:01

Post by Thomas Linder Puls » 1 Sep 2017 8:15

The (in some sense) real problem is that the myDomains-file has not been included in the main-file.

The reason that it is not included automatically is because the error messages are wrong, it should have been:

<pre>e218 Unknown class/interface/namespace 'myDomains' in pack 'main.pack'</pre>
When the IDE receives such a message from the compiler it will try to solve the problem by inserting an include statements in the pack file.

As a workaround to get the correct include statement inserted you can remove the arguments for one compilation:
This will give the correct errormessage and cause the IDE to insert the include statement, and then you canchange the code back to the correct version again:
We will of course look at the problem anyway.
Regards Thomas Linder Puls
PDC

Martin Meyer
VIP Member
Posts: 232
Joined: 14 Nov 2002 0:01

Post by Martin Meyer » 1 Sep 2017 15:36

I have checked the ph- and pack-files in my 'real' code. However the case seems to be more complicated there.

I have attached a stripped down version of the 'real' code. The compiler throws error c205 : Unknown domain/interface 'mfc\syntax\syntax_t{@Terminal}::abstractSyntaxTree' in pack 'main.pack' on it. Please have a look at it. File rule.ph already contains #include @"mfc\altSyntax\altSyntax.ph". So, what is missing? Maybe am overlooking something. Can you advice how to cure it?
Attachments
buildAll.zip
(13.14 KiB) Downloaded 78 times
Regards Martin

User avatar
Thomas Linder Puls
VIP Member
Posts: 2333
Joined: 28 Feb 2000 0:01

Post by Thomas Linder Puls » 4 Sep 2017 9:57

In this case a work around is to move the abstractSyntaxTree domain from the syntax_t interface to the syntax_t class.

We will of course look for a non-workaround solution as well.
Regards Thomas Linder Puls
PDC

Martin Meyer
VIP Member
Posts: 232
Joined: 14 Nov 2002 0:01

Post by Martin Meyer » 4 Sep 2017 17:36

Thank you! It works now. Actually I moved domain abstractSyntaxTree to an interface named altSyntax which has no scope type variables. Since domain abstractSyntaxTree makes no use of scope type variables it anyway was misplaced in syntax_t{@Terminal}.
Regards Martin

Post Reply