Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Extend SourceParser/AST flexibility in DLTK

Hi Roy,

ISourceParser receives content as char[]/String, and encoding is handled before it's called.
Workspace files are read using org.eclipse.dltk.internal.core.util.Util.getResourceContentsAsCharArray(IFile) and encoding is taken from the workspace.
External files at the moment are read as UTF-8.

Btw, I've just committed all my changes.

Regards,
Alex

----- Original Message -----
From: "Roy Ganor" <roy@xxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Sent: Tuesday, February 9, 2010 6:10:53 PM GMT +06:00 Almaty, Novosibirsk
Subject: RE: [Dltk-dev] Extend SourceParser/AST flexibility in DLTK

Hi Alex,
With regards to ISourceParser.parse() method, can you elaborate on how should the parser resolve the encoding of the string/chars?

Thanks for your time,
Roy
-----Original Message-----
From: dltk-dev-bounces@xxxxxxxxxxx [mailto:dltk-dev-bounces@xxxxxxxxxxx] On Behalf Of Alex Panchenko
Sent: Monday, February 08, 2010 4:29 PM
To: DLTK Developer Discussions
Subject: [Dltk-dev] Extend SourceParser/AST flexibility in DLTK

Hi all,

At the moment DLTK suppose that language implementations use standard AST class hierarchy.

We would like to increase DLTK flexibility in this area, so implementations could use any AST.
This is a breaking change, so it would be better to discuss it first.

As the first step in this direction I suggest the following change:

=====

// new interface for parser output
public interface IModuleDeclaration {
  // no methods
}

public interface ISourceParser {
	IModuleDeclaration parse(org.eclipse.dltk.compiler.env.ISourceModule input, IProblemReporter reporter);
}

public class ModuleDeclaration ... implements IModuleDeclaration {
...
}

=====

The additional benefit is that parser now has access to the project via input.getModelElement().getScriptProject()

Are there any objections for this change?

Regards,
Alex
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top