Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Documentation?

Hi,

you may also look into the sourcecode of LunarEclipse (http:// lunareclipse.sf.net). I'm also using an ANTLR 3.0 Parser to generate the AST for Lua.

Perhapes this helps.

Regards,

Nicolai Mainiero

Am 09.07.2007 um 04:11 schrieb Jae Gangemi:


umm - probably - i haven't gotten that far w/ my parser yet - i'm off looking at debugger integration b/c that's more important to me right now.

from what i have seen, you need to use the IProblemReporter instance to get those error messages displayed. the ruby and python parsers use them, but you'll need to dig a little deeper to find out how.

On 7/8/07, Mark Mandel <mark.mandel@xxxxxxxxx> wrote: Okay,

I'm pretty sure that is starting to make a certain amount of sense.

If I want to start grassroots - so essentially, have a editor, and the
only thing it did was return what errors there were with the current
file, according to my ANTLR grammar, is there an example of that
anywhere around I can look at?

Form there, I think I will be able to build up.

Mark

On 7/9/07, Jae Gangemi < jgangemi@xxxxxxxxx> wrote:
> well - antlr is going to build tokens, and those tokens get turned into
> larger AST type objects.
>
> i guess for now, think about how you would handle things if you just had a > the lexer - you'd need to look at each token individually and know based > upon the CF language, what constituents a method, etc. and then create the
> corresponding dltk token class to represent it.
>
> if you wrote a lexer w/ general rule sets, then there should be a way to > plug into that and still create dltk tokens and more complex ast objects
> that get fed into the overall ModuleDeclaration object.
>
> take a look at the tcl implementation, that may also help shed some light.
>
>
> On 7/8/07, Jae Gangemi < jgangemi@xxxxxxxxx> wrote:
> >
> > well - antlr is going to build tokens, and those tokens get turned into
> larger AST type objects.
> >
> > i guess for now, think about how you would handle things if you just had > a the lexer - you'd need to look at each token individually and know based > upon the CF language, what constituents a method, etc. and then create the
> corresponding dltk token class to represent it.
> >
> > if you wrote a lexer w/ general rule sets, then there should be a way to > plug into that and still create dltk tokens and more complex ast objects
> that get fed into the overall ModuleDeclaration object.
> >
> > take a look at the tcl implementation, that may also help shed some
> light.
> >
> >
> >
> >
> > On 7/8/07, Mark Mandel < mark.mandel@xxxxxxxxx> wrote:
> > >
> > > Well that's where I get confused actually.
> > >
> > > I have a parser that generates for me ANTLR AST for ColdFusion code.
> > >
> > > Now I'm actually wondering if need to generate my AST from ANTLR, and
> > > then somehow convert it into this moduleDeclaration?
> > >
> > > Or failing that, somehow interweave my current parser implementation,
> > > and then pretty much seem to ignore the AST it generates?
> > >
> > > I've looked at the PythonSourceParser, and quite frankly, I get a
> > > little bit lost working out where ANTLR ends, and the DLTK
> > > implementation begins...
> > >
> > > I feel like I'm going to have to double handle some stuff, which I am
> > > willing to do, I'm just stuck on what is the best approach.
> > >
> > > I'm probably swallowing too large a pill, as I've not built a eclipse > > > plugin before, as well as trying to wrap my head around dltk, since
> > > this seems to be the best tool for the job, I'm up for it.
> > >
> > > Mark
> > >
> > > On 7/9/07, Jae Gangemi < jgangemi@xxxxxxxxx > wrote:
> > > >
> > > >   well - what do you mean by integrate?
> > > >
> > > >   i tried to write an antlr parser for perl and gave up for a
> different
> > > > route, but what i did learn was this:
> > > >
> > > > if all you built was a lexer, then you need to walk the tokens
> yourself and
> > > > ultimately construct a ModuleDeclaration object. if you built a parser
> as
> > > > well, then you should be able to work in the construction of the
> > > > ModuleDeclaration directly into that implementation.
> > > >
> > > > look at the parse method in the PythonSourceParser - from there you
> can
> > > > see where the python parser hooks in.
> > > >
> > > >   hope that helps some
> > > >
> > > > On 7/8/07, Mark Mandel < mark.mandel@xxxxxxxxx> wrote:
> > > > >
> > > > > Thanks for the heads up...
> > > > >
> > > > > I'm trying to work through the Python example, as they both use an > > > > > ANTLR grammer (tho the example they give is ANTLR 2.7, whereas I'm
> > > > > using 3.0)...
> > > > >
> > > > > I'm struggling to work out how to take my ANTLR parser and integrate > > > > > it with the dltk parser... there seems to be a fair amount of work
> on
> > > > > top to get things going in that area.
> > > > >
> > > > > I'm going to keep plugging through the python example, but if anyone > > > > > has any direction to take on where to look for these details, please
> > > > > let me know,
> > > > >
> > > > > On 7/9/07, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:
> > > > > >
> > > > > > that sounds pretty cool. i've been developing against the source
> head
> > > > > > since i'm still pretty far off from a release (it also allows me
> to
> > > > submit
> > > > > > things back as well) - once i get closer to a release, i'll worry
> about
> > > > > > tying myself to a release.
> > > > > >
> > > > > > feel free to peruse my source as well for another example
> > > > > > ( http://code.google.com/p/perlipse/ - the parser
> isn't
> > > > > > gonna work for you if you try to run it b/c you'll need some extra
> perl
> > > > > > modules installed, and it's tied to concrete script paths, my next
> > > > cleanup
> > > > > > todo) - but all good otherwise. :)
> > > > > >
> > > > > > if anyone is interested in devoting some cycles to a perl
> plugin, do
> > > > let
> > > > > > me know :)
> > > > >
> > > > > --
> > > > > E: mark.mandel@xxxxxxxxx
> > > > > W: www.compoundtheory.com
> > > > > _______________________________________________
> > > > > dltk-dev mailing list
> > > > > dltk-dev@xxxxxxxxxxx
> > > > > https://dev.eclipse.org/mailman/listinfo/dltk-dev
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > -jae
> > > > _______________________________________________
> > > > dltk-dev mailing list
> > > > dltk-dev@xxxxxxxxxxx
> > > > https://dev.eclipse.org/mailman/listinfo/dltk-dev
> > > >
> > > >
> > >
> > >
> > > --
> > > E: mark.mandel@xxxxxxxxx
> > > W: www.compoundtheory.com
> > > _______________________________________________
> > > dltk-dev mailing list
> > > dltk-dev@xxxxxxxxxxx
> > > https://dev.eclipse.org/mailman/listinfo/dltk-dev
> > >
> >
> >
> >
> > --
> > -jae
>
>
>
> --
> -jae
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
>
>


--
E: mark.mandel@xxxxxxxxx
W: www.compoundtheory.com
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



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



Back to the top