Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] For use in a UI view, how to get the raw AST from the core?

Hi Gerald,

I suppose you could listen for DLTK model updates, or for platform
resource updates.
If you use this view only in for debugging code, you could re-parse file
for each resource change.

To add resource listener please use following code:
ResourcesPlugin.getDefault().getWorkspace().addResourceChangedListener()

Best regards,
Andrei Sobolev.
> Wish to add a custom UI View that details/uses the raw AST as
> generated through execution of the core ISourceParser#parse.  By raw,
> I mean the native AST generated by my script parser, before it is
> processed into a standard DLTK TypeDeclaration tree.  I can add the
> raw AST as a field to the root TypeDeclaration.  Now just need to have
> some kind of event that the UI view can listen for to pick up the
> TypeDeclaration tree whenever it changes.
>
> I realize this appears similar to the content view, but that view
> appears to be keyed to using ISourceModule (somehow) -- cannot seem to
> trace for certain how it is getting a handle to the root
> TypeDeclaration of the core AST.
>
> Looks like there is a DLTKCore#addElementChangedListener.  Would this
> be the correct DLTK-way of listening for AST parse updates?  If not,
> could you please provide a suggestion about how best to do this.
>
> Thanks,
> Gerald
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
>   



Back to the top