Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » contentProposer on current writing
contentProposer on current writing [message #26172] Fri, 23 January 2009 15:23 Go to next message
Defert Philippe is currently offline Defert PhilippeFriend
Messages: 62
Registered: July 2009
Member
Hi,

how to use the contentProposer during code writing?
Indeed, when writing code, I would like to propose the attributes of an
object when I do CTRL + SPACE.
But the problem is that the parser is triggered and detects an error.
therefore, it does not generate the AST tree.
What would be a correct solution ?:
stop the automatic parser (but then, the tree will not be uptodate)
continue parsing despite syntax errors
another idea?

I think there is a solution because the JDT can do that.
Re: contentProposer on current writing [message #26374 is a reply to message #26172] Tue, 10 February 2009 09:15 Go to previous messageGo to next message
Jin Missing name is currently offline Jin Missing nameFriend
Messages: 100
Registered: July 2009
Senior Member
hi,Defert:
I sugguest you should see the "IMP Users Guide" at [1] first.

[1] http://www.eclipse.org/imp/documentation.php

jin

"Defert Philippe" <defert@bayesia.com>
??????:glcne8$tte$1@build.eclipse.org...
> Hi,
>
> how to use the contentProposer during code writing?
> Indeed, when writing code, I would like to propose the attributes of an
> object when I do CTRL + SPACE.
> But the problem is that the parser is triggered and detects an error.
> therefore, it does not generate the AST tree.
> What would be a correct solution ?:
> stop the automatic parser (but then, the tree will not be uptodate)
> continue parsing despite syntax errors
> another idea?
>
> I think there is a solution because the JDT can do that.
Re: contentProposer on current writing [message #26479 is a reply to message #26172] Tue, 17 February 2009 15:45 Go to previous messageGo to next message
Marc Ollier is currently offline Marc OllierFriend
Messages: 8
Registered: July 2009
Junior Member
Hi

Maybe you could use error recovery features of your grammar compiler (for
example: https://javacc.dev.java.net/doc/errorrecovery.html).

With this, you would get a partial AST that may e good enough for
completion.
But I must admit I haven't tried this myself

Marc
Re: contentProposer on current writing [message #26770 is a reply to message #26172] Tue, 24 February 2009 03:31 Go to previous messageGo to next message
Robert M. Fuhrer is currently offline Robert M. FuhrerFriend
Messages: 294
Registered: July 2009
Senior Member
Defert Philippe wrote:
> Hi,
>
> how to use the contentProposer during code writing?
> Indeed, when writing code, I would like to propose the attributes of an
> object when I do CTRL + SPACE.
> But the problem is that the parser is triggered and detects an error.
> therefore, it does not generate the AST tree.
> What would be a correct solution ?:
> stop the automatic parser (but then, the tree will not be uptodate)
> continue parsing despite syntax errors
> another idea?
>
> I think there is a solution because the JDT can do that.

Yes, the JDT parser does a pretty good job at error recovery, so
they get an AST to work with in spite of a pretty wide variety of
syntax errors.

We're actually working on a semi-automatic error recovery mechanism
for LPG, but in the meantime, you'll need to do it more manually.
I'd suggest posting a query for help on the LPG sourceforge site.

If you're not using LPG, consult your parser generator manuals for
hints on how to get the generated parser to recover. Most parser
generators provide some form of error recovery mechanism.

--
Cheers,
-- Bob

--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
X10: Productive High-Performance Parallel Programming (http://x10.sf.net)
Re: contentProposer on current writing [message #496521 is a reply to message #26770] Tue, 10 November 2009 12:26 Go to previous messageGo to next message
Defert Philippe is currently offline Defert PhilippeFriend
Messages: 62
Registered: July 2009
Member
Hi,

I worked on my grammar, now i have not problem with ast generation.
But i discovered an amazing thing.

on new line,I type the first letter and i do CTRL+SPACE
the CompletionProcessor propose the right stuff.
the CompletionProcessor still open and I type the second letter.
The contentproposer doesn't find the token. after debug, i think the
CompletionProcessor.CompletionProposals(ITextViewer viewer, int offset)
is called before the CompletionProcessor.update(IParseController
parseController, IProgressMonitor monitor).

The result is he has a stroke behind , the
CompletionProcessor.CompletionProposals() work on List of previous tokens.

Philippe



Le 24/02/2009 04:31, Robert M. Fuhrer a écrit :
> Defert Philippe wrote:
>> Hi,
>>
>> how to use the contentProposer during code writing?
>> Indeed, when writing code, I would like to propose the attributes of an
>> object when I do CTRL + SPACE.
>> But the problem is that the parser is triggered and detects an error.
>> therefore, it does not generate the AST tree.
>> What would be a correct solution ?:
>> stop the automatic parser (but then, the tree will not be uptodate)
>> continue parsing despite syntax errors
>> another idea?
>>
>> I think there is a solution because the JDT can do that.
>
> Yes, the JDT parser does a pretty good job at error recovery, so
> they get an AST to work with in spite of a pretty wide variety of
> syntax errors.
>
> We're actually working on a semi-automatic error recovery mechanism
> for LPG, but in the meantime, you'll need to do it more manually.
> I'd suggest posting a query for help on the LPG sourceforge site.
>
> If you're not using LPG, consult your parser generator manuals for
> hints on how to get the generated parser to recover. Most parser
> generators provide some form of error recovery mechanism.
>
Re: contentProposer on current writing [message #496522 is a reply to message #26770] Tue, 10 November 2009 12:27 Go to previous message
Defert Philippe is currently offline Defert PhilippeFriend
Messages: 62
Registered: July 2009
Member
Hi,

I worked on my grammar, now i have not problem with ast generation.
But i discovered an amazing thing.

on new line,I type the first letter and i do CTRL+SPACE
the CompletionProcessor propose the right stuff.
the CompletionProcessor still open and I type the second letter.
The contentproposer doesn't find the token. after debug, i think the
CompletionProcessor.CompletionProposals(ITextViewer viewer, int offset)
is called before the CompletionProcessor.update(IParseController
parseController, IProgressMonitor monitor).

The result is he has a stroke behind , the
CompletionProcessor.CompletionProposals() work on List of previous tokens.

Philippe



Le 24/02/2009 04:31, Robert M. Fuhrer a écrit :
> Defert Philippe wrote:
>> Hi,
>>
>> how to use the contentProposer during code writing?
>> Indeed, when writing code, I would like to propose the attributes of an
>> object when I do CTRL + SPACE.
>> But the problem is that the parser is triggered and detects an error.
>> therefore, it does not generate the AST tree.
>> What would be a correct solution ?:
>> stop the automatic parser (but then, the tree will not be uptodate)
>> continue parsing despite syntax errors
>> another idea?
>>
>> I think there is a solution because the JDT can do that.
>
> Yes, the JDT parser does a pretty good job at error recovery, so
> they get an AST to work with in spite of a pretty wide variety of
> syntax errors.
>
> We're actually working on a semi-automatic error recovery mechanism
> for LPG, but in the meantime, you'll need to do it more manually.
> I'd suggest posting a query for help on the LPG sourceforge site.
>
> If you're not using LPG, consult your parser generator manuals for
> hints on how to get the generated parser to recover. Most parser
> generators provide some form of error recovery mechanism.
>
Re: contentProposer on current writing [message #574820 is a reply to message #26172] Tue, 10 February 2009 09:15 Go to previous message
Jin Missing name is currently offline Jin Missing nameFriend
Messages: 100
Registered: July 2009
Senior Member
hi,Defert:
I sugguest you should see the "IMP Users Guide" at [1] first.

[1] http://www.eclipse.org/imp/documentation.php

jin

"Defert Philippe" <defert@bayesia.com>
??????:glcne8$tte$1@build.eclipse.org...
> Hi,
>
> how to use the contentProposer during code writing?
> Indeed, when writing code, I would like to propose the attributes of an
> object when I do CTRL + SPACE.
> But the problem is that the parser is triggered and detects an error.
> therefore, it does not generate the AST tree.
> What would be a correct solution ?:
> stop the automatic parser (but then, the tree will not be uptodate)
> continue parsing despite syntax errors
> another idea?
>
> I think there is a solution because the JDT can do that.
Re: contentProposer on current writing [message #574863 is a reply to message #26172] Tue, 17 February 2009 15:45 Go to previous message
Marc Ollier is currently offline Marc OllierFriend
Messages: 8
Registered: July 2009
Junior Member
Hi

Maybe you could use error recovery features of your grammar compiler (for
example: https://javacc.dev.java.net/doc/errorrecovery.html).

With this, you would get a partial AST that may e good enough for
completion.
But I must admit I haven't tried this myself

Marc
Re: contentProposer on current writing [message #574987 is a reply to message #26172] Tue, 24 February 2009 03:31 Go to previous message
Robert M. Fuhrer is currently offline Robert M. FuhrerFriend
Messages: 294
Registered: July 2009
Senior Member
Defert Philippe wrote:
> Hi,
>
> how to use the contentProposer during code writing?
> Indeed, when writing code, I would like to propose the attributes of an
> object when I do CTRL + SPACE.
> But the problem is that the parser is triggered and detects an error.
> therefore, it does not generate the AST tree.
> What would be a correct solution ?:
> stop the automatic parser (but then, the tree will not be uptodate)
> continue parsing despite syntax errors
> another idea?
>
> I think there is a solution because the JDT can do that.

Yes, the JDT parser does a pretty good job at error recovery, so
they get an AST to work with in spite of a pretty wide variety of
syntax errors.

We're actually working on a semi-automatic error recovery mechanism
for LPG, but in the meantime, you'll need to do it more manually.
I'd suggest posting a query for help on the LPG sourceforge site.

If you're not using LPG, consult your parser generator manuals for
hints on how to get the generated parser to recover. Most parser
generators provide some form of error recovery mechanism.

--
Cheers,
-- Bob

--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
X10: Productive High-Performance Parallel Programming (http://x10.sf.net)
Re: contentProposer on current writing [message #576839 is a reply to message #26770] Tue, 10 November 2009 12:26 Go to previous message
Defert Philippe is currently offline Defert PhilippeFriend
Messages: 62
Registered: July 2009
Member
Hi,

I worked on my grammar, now i have not problem with ast generation.
But i discovered an amazing thing.

on new line,I type the first letter and i do CTRL+SPACE
the CompletionProcessor propose the right stuff.
the CompletionProcessor still open and I type the second letter.
The contentproposer doesn't find the token. after debug, i think the
CompletionProcessor.CompletionProposals(ITextViewer viewer, int offset)
is called before the CompletionProcessor.update(IParseController
parseController, IProgressMonitor monitor).

The result is he has a stroke behind , the
CompletionProcessor.CompletionProposals() work on List of previous tokens.

Philippe



Le 24/02/2009 04:31, Robert M. Fuhrer a écrit :
> Defert Philippe wrote:
>> Hi,
>>
>> how to use the contentProposer during code writing?
>> Indeed, when writing code, I would like to propose the attributes of an
>> object when I do CTRL + SPACE.
>> But the problem is that the parser is triggered and detects an error.
>> therefore, it does not generate the AST tree.
>> What would be a correct solution ?:
>> stop the automatic parser (but then, the tree will not be uptodate)
>> continue parsing despite syntax errors
>> another idea?
>>
>> I think there is a solution because the JDT can do that.
>
> Yes, the JDT parser does a pretty good job at error recovery, so
> they get an AST to work with in spite of a pretty wide variety of
> syntax errors.
>
> We're actually working on a semi-automatic error recovery mechanism
> for LPG, but in the meantime, you'll need to do it more manually.
> I'd suggest posting a query for help on the LPG sourceforge site.
>
> If you're not using LPG, consult your parser generator manuals for
> hints on how to get the generated parser to recover. Most parser
> generators provide some form of error recovery mechanism.
>
Re: contentProposer on current writing [message #576853 is a reply to message #26770] Tue, 10 November 2009 12:27 Go to previous message
Defert Philippe is currently offline Defert PhilippeFriend
Messages: 62
Registered: July 2009
Member
Hi,

I worked on my grammar, now i have not problem with ast generation.
But i discovered an amazing thing.

on new line,I type the first letter and i do CTRL+SPACE
the CompletionProcessor propose the right stuff.
the CompletionProcessor still open and I type the second letter.
The contentproposer doesn't find the token. after debug, i think the
CompletionProcessor.CompletionProposals(ITextViewer viewer, int offset)
is called before the CompletionProcessor.update(IParseController
parseController, IProgressMonitor monitor).

The result is he has a stroke behind , the
CompletionProcessor.CompletionProposals() work on List of previous tokens.

Philippe



Le 24/02/2009 04:31, Robert M. Fuhrer a écrit :
> Defert Philippe wrote:
>> Hi,
>>
>> how to use the contentProposer during code writing?
>> Indeed, when writing code, I would like to propose the attributes of an
>> object when I do CTRL + SPACE.
>> But the problem is that the parser is triggered and detects an error.
>> therefore, it does not generate the AST tree.
>> What would be a correct solution ?:
>> stop the automatic parser (but then, the tree will not be uptodate)
>> continue parsing despite syntax errors
>> another idea?
>>
>> I think there is a solution because the JDT can do that.
>
> Yes, the JDT parser does a pretty good job at error recovery, so
> they get an AST to work with in spite of a pretty wide variety of
> syntax errors.
>
> We're actually working on a semi-automatic error recovery mechanism
> for LPG, but in the meantime, you'll need to do it more manually.
> I'd suggest posting a query for help on the LPG sourceforge site.
>
> If you're not using LPG, consult your parser generator manuals for
> hints on how to get the generated parser to recover. Most parser
> generators provide some form of error recovery mechanism.
>
Previous Topic:errors in LEGHoverHelper.java
Next Topic:Parser messages in problems view
Goto Forum:
  


Current Time: Thu Mar 28 08:34:35 GMT 2024

Powered by FUDForum. Page generated in 0.05473 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top