Home » Modeling » TMF (Xtext) » Is there incremental parser or partial parser in Xtext or ANTLR(parser strategy in Xtext )
| | | |
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 |
jingjing wang 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 #1769408 is a reply to message #1769262] |
Mon, 31 July 2017 11:20 |
jingjing wang 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???
|
|
| |
Goto Forum:
Current Time: Tue Mar 19 11:56:27 GMT 2024
Powered by FUDForum. Page generated in 0.02573 seconds
|