IMP error recovery [message #21537] |
Wed, 18 June 2008 07:06 |
Eclipse User |
|
|
|
Originally posted by: hasanp87.hotmail.com
Hi,
I am using IMP-LPG to generate an IDE for a language.However,I face the
following problems regarding error recovery.
1 My parser(probably diagnose parser) keeps on parsing my source code as
long as the script is an error.I do not want this to occur while my user
is still writing the complete syntax.
This is necessary for providing content assist at every possible stage
while the syntax is completed.I have used the recovery option by
lpg.However,its not possible to have a recovery token at every stage.
2 Also,is there a way to locate the previous token from my present
controller position for content assist.
Thanks
|
|
|
Re: IMP error recovery [message #22205 is a reply to message #21537] |
Wed, 02 July 2008 21:36 |
Stan Sutton Messages: 121 Registered: July 2009 |
Senior Member |
|
|
Hi Hasan,
I'm not an expert on this, but I will try to get you some information.
First, I am not sure I understand the first question. Can you clarify?
(It sound both like you want parsing to go on and that you do not want
it to go on.)
Second, if your current controller position can be related to a token,
then here is a way to get the previous token:
IToken t; //...
int index = t.getTokenIndex();
int previousIndex = t.getPrsStream().getPrevious(index);
IToken previous = t.getPrsStream().getTokenAt(previousIndex);
I don't know if you have seen these, but there are examples of
content-assist services in the IMP source repository that may provide
useful examples. There is some discussion about examples in the IMP
User's Guide.
Regards,
Stan
Hasan wrote:
> Hi,
> I am using IMP-LPG to generate an IDE for a language.However,I face
> the following problems regarding error recovery.
>
> 1 My parser(probably diagnose parser) keeps on parsing my source code as
> long as the script is an error.I do not want this to occur while my user
> is still writing the complete syntax.
> This is necessary for providing content assist at every possible stage
> while the syntax is completed.I have used the recovery option by
> lpg.However,its not possible to have a recovery token at every stage.
>
> 2 Also,is there a way to locate the previous token from my present
> controller position for content assist.
> Thanks
>
>
|
|
|
Re: IMP error recovery [message #571939 is a reply to message #21537] |
Wed, 02 July 2008 21:36 |
Stan Sutton Messages: 121 Registered: July 2009 |
Senior Member |
|
|
Hi Hasan,
I'm not an expert on this, but I will try to get you some information.
First, I am not sure I understand the first question. Can you clarify?
(It sound both like you want parsing to go on and that you do not want
it to go on.)
Second, if your current controller position can be related to a token,
then here is a way to get the previous token:
IToken t; //...
int index = t.getTokenIndex();
int previousIndex = t.getPrsStream().getPrevious(index);
IToken previous = t.getPrsStream().getTokenAt(previousIndex);
I don't know if you have seen these, but there are examples of
content-assist services in the IMP source repository that may provide
useful examples. There is some discussion about examples in the IMP
User's Guide.
Regards,
Stan
Hasan wrote:
> Hi,
> I am using IMP-LPG to generate an IDE for a language.However,I face
> the following problems regarding error recovery.
>
> 1 My parser(probably diagnose parser) keeps on parsing my source code as
> long as the script is an error.I do not want this to occur while my user
> is still writing the complete syntax.
> This is necessary for providing content assist at every possible stage
> while the syntax is completed.I have used the recovery option by
> lpg.However,its not possible to have a recovery token at every stage.
>
> 2 Also,is there a way to locate the previous token from my present
> controller position for content assist.
> Thanks
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02128 seconds