Question related to partial parsing [message #1724113] |
Sun, 21 February 2016 07:13 |
kimi raikonnan Messages: 145 Registered: June 2015 |
Senior Member |
|
|
I found that xtext fullReparse the file if it found syntax error.
which means that while writing any statement consists of 100 words, the file will be parsed 100 times !!!!!
Because before reaching keystroke number 100 all previous strokes will cause syntax errors
I tried just to comment it out, but is it a suitable solution?
public class PartialParsingHelper implements IPartialParsingHelper {
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public IParseResult reparse(IParser parser, IParseResult previousParseResult, ReplaceRegion changedRegion) {
...
if (newParseResult == null || newParseResult.hasSyntaxErrors()) {
// TODO: Should we reparse if the complete input was parsed?
// on error fully reparse
return fullyReparse(parser, previousParseResult, replaceRegion);
}
}
}
[Updated on: Sun, 21 February 2016 08:21] Report message to a moderator
|
|
|
|
|
|
|
Re: Question related to partial parsing [message #1724287 is a reply to message #1724285] |
Mon, 22 February 2016 19:52 |
kimi raikonnan Messages: 145 Registered: June 2015 |
Senior Member |
|
|
Is it possible not to clear all the links and clear only links which updated due to change in the editor?
Example:
Object A {
x,y,z
}
Object B {
k,j,h
}
As i understand now by and change we will link A,x,y,z and B,k,j,h even if the change was adding new Object C
Object C{
u,i,o
}
and this new object has no effect (will not affect the links already done) by any mean, so we dont have to remove those links in my case at least.
This is small example, please imagine the time will be lost in huge files.
And as i understood from the code after any change all EObject will be replaced not the updated EOBjects only, I mean by adding Object C as shown above, we will create new EObjects for all the identifiers in the editor not Object C only
[Updated on: Mon, 22 February 2016 19:54] Report message to a moderator
|
|
|
Re: Question related to partial parsing [message #1724292 is a reply to message #1724287] |
Mon, 22 February 2016 20:38 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
It's only software; of course it's possible.
But Sven and his team very sensibly avoid the many hazards of manually
coded incremental parsing.
One day the automation around Xtext associated with the ongoing OCL
parsing auto-generation may support accurate auto-generated incremental
parsing; but don't hold your breath.
Regards
Ed Willink
On 22/02/2016 19:52, kimi raikonnan wrote:
> Is it possible not to clear all the links and clear only links which
> updated due to change in the editor?
> Example:
> Object A {
> x,y,z
> }
> Object B {
> k,j,h
> }
>
> As i understand now by and change we will link A,x,y,z and B,k,j,h
> even if the change was adding new Object C
> Object C{
> u,i,o
> }
> and this new object has no effect (will not affect the links already
> done) by any mean, so we dont have to remove those links in my case at
> least.
> This is small example, please imagine the time will be lost in huge
> files ?
>
|
|
|
|
Re: Question related to partial parsing [message #1724403 is a reply to message #1724388] |
Tue, 23 February 2016 17:20 |
|
Yes, I actually regret that we have added partial parsing, since it is very complicated and only pays off with very large documents. For very small ones, it is actually a bit slower (but still super fast, so it doesn't matter)
For Xtend we have even switched it off. We haven't done anything into the direction of partial linking and in general in Xtext the granularity for incremental builds/updates is on a per file basis.
I don't know how big your files really are, but measuring and using a profiler and then optimize where it pays off is the way to go and solves performance issues in 90% of all cases. Also trying to split huge files in smaller ones will help.
|
|
|
Powered by
FUDForum. Page generated in 0.03626 seconds