Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Is there incremental parser or partial parser in Xtext or ANTLR(parser strategy in Xtext )
Is there incremental parser or partial parser in Xtext or ANTLR [message #1768037] Thu, 13 July 2017 07:29 Go to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Hi,
I have a problem about Parser strategy in Xtext. I read some source code of Xtext, and I find a class called "PartialParsingHelper" and its function "reparse()".

From the name of "PartialParsingHelper", I think it means just parsing a part of text, not all the text. But after i debug the code, it invokes of "fullReparse()" in the process of "reparse()" in the class "PartialParsingHelper". And it does not process partial parser.

So my question is
1. whether there is partial parser or incremental parser in Xtext
2. which scene will invoke partial parser?
3. do some configurations will tirgger partial parser?
4. or anything else?

I'm looking forward your answer~~~
thank you!!!
Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1768068 is a reply to message #1768037] Thu, 13 July 2017 11:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

can you elaborate what your exact usecase is?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1768138 is a reply to message #1768068] Fri, 14 July 2017 02:19 Go to previous messageGo to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Acctually, we debug the source code of Xtext, we find that in the process of parse, a new parser result will be generated, and the new parser result will take replace of the old parser result.
In our requirement, we need some info of old parser result, we hope the new parser result is based on the old parser result, and it reserves the useful or valid info of old parser result. So maybe increment parser or partial parser can satisfy this requirement.
Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1768140 is a reply to message #1768138] Fri, 14 July 2017 03:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
it depends on the change what is reparsed.
(e.g. debug org.eclipse.xtext.xbase.parser.TokenSequencePreservingPartialParsingHelper.reparse(IParser, IParseResult, ReplaceRegion) while editing)

i dont know of such a thing. what do you mean by "some info"


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 14 July 2017 03:56]

Report message to a moderator

Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1768150 is a reply to message #1768140] Fri, 14 July 2017 07:40 Go to previous messageGo to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Thank you very much!

"some info of old parser result" means the old unchanged info. When editing in the Xtext, there are new editing content and the unchanged old content. The fully parser will parse both the old and new content, and generate the new parser result. But about the old unchanged content, we prefer the old parser result, instead of the new parser result.

According to your advice, we read the code of "org.eclipse.xtext.xbase.parser.TokenSequencePreservingPartialParsingHelper.reparse(IParser, IParseResult, ReplaceRegion)", but in our debug process of editing, it does not invoke "TokenSequencePreservingPartialParsingHelper.reparse()", instead it invokes "org.eclipse.xtext.parser.impl.PartialParsingHelper.reparse(IParser, IParseResult, ReplaceRegion)".

So can you tell me the limit, scene or some configurations, methods to invoke "org.eclipse.xtext.xbase.parser.TokenSequencePreservingPartialParsingHelper.reparse(IParser, IParseResult, ReplaceRegion)".

My sincere thanks
Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1769259 is a reply to message #1768140] Fri, 28 July 2017 10:29 Go to previous messageGo to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Hi, Christian
Cloud you give me more advice about what changes will invoke org.eclipse.xtext.xbase.parser.TokenSequencePreservingPartialParsingHelper.reparse(IParser, IParseResult, ReplaceRegion) or more detail contents about TokenSequencePreservingPartialParsingHelper.reparse(IParser, IParseResult, ReplaceRegion), such as configuration, or anything else?

We need your help, please... Thank you very much!
Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1769262 is a reply to message #1769259] Fri, 28 July 2017 10:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
no i cant.
i just gave you some code pointers to digg yourself

i still not understand why you care about what is reparsed and what not and not leave that to xtext.
thus my question why do you care?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1769408 is a reply to message #1769262] Mon, 31 July 2017 11:20 Go to previous messageGo to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
We are doing a thing that makes Xtext and Sirius use the same only LazylinkingResource. So Xtext and Sirius share the same AST and lazyLinkingResource. When editing in Xtext editor, Xtext will generate a totally new AST, Sirius will change its memory resource(such as aird resource or diagram resource) according to the new AST. Acctually, we just modify some content in the Xtext editor, but all content in the Xtext editor including unmodified content will be reparsed, which we call it fully parser. The fully parser will make Sirius synchronize all content between sirius memory resource and AST, which is time-consume when model scale is large. But if Xtext uses partial parser, the unmodified content will not be parsed, its relative parse result(AST structure) will not be changed, then Sirius just needs to synchronize the modified content beween sirius memory resource and AST. So that is why we care about the reparse content.

so???
Re: Is there incremental parser or partial parser in Xtext or ANTLR [message #1769442 is a reply to message #1769408] Mon, 31 July 2017 15:45 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
sorry i am not that deep with this part of xtext

maybe you should try to contact jan köhnlein or cedric brun wo where talking on xtext/sirius integration on eclipse con france
https://www.eclipsecon.org/france2017/session/integrating-xtext-and-sirius-strategies-and-pitfalls


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Reference output problem.
Next Topic:mismatched input 'test' expecting RULE_ID
Goto Forum:
  


Current Time: Tue Mar 19 11:56:27 GMT 2024

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

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

Back to the top