www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Eclipse plugin

reply Ary Manzana <ary esperanto.org.ar> writes:
Hello!

Is anyone interested in making a *great* eclipse plugin? A plugin 
similar to JDT.

I know some IDEs out there exist, but none of them is really powerful. 
For example I think DDT is dead, or out of date.

My intentions are:

- To use Walter's code to make the parsing and build a model, since it's 
the only safe way to guarantee compliance with the current DMD compiler. 
Then diffing changes in the source should make changes in the plugin 
quite simple. (not to use ANTLR, for instance)
- To document every public class, so that other people can join the 
project "easily". I took a look at the DDT code and I found just a 
little bit of comment... :-(
- To use an architecture similar to the one JDT uses. DDT tried this, 
but I don't know what happened (most of the classes are empty!)... For 
example PHPEclipse uses many of JDT classes and interfaces (redefining 
them)... even keeping the same names! (i.e. IJavaElement)
- To make things with patience. First do the parsing (port the parser), 
build a model and have an outline. Second singal syntax errors. Third 
signal simple semantic errors (I believe method "semantic" of Dsymbol... 
maybe "semantic2" and "semantic3" uses relationships between modules). 
Fourth, copy JDT architecture. Fifth, add renaming, refactoring, 
autocomplete, quick fixes, etc. ... In the middle of those points be 
able to compile everything :-P

With patience I mean: take a deep look at how JDT is done, then put 
yourself to program.

Fourtunately, I've already ported most of the parser (for D 0.168) to 
Java, I already build a model, have an outline view and singal simple 
syntax errors. Not just the line number, but the exact positions where 
the error is present. Also the plugin compiles automatically your code, 
but I still don't know how to link everything automatically (I'm missing 
some rule, I guess). And nothing more: I'm currently reading a lot of 
code from the JDT core plugin, and some Walter's code.

I think a D plugin for eclipse would be of big utility to the D 
community. Since I started programing in Java with Eclipse I totally 
forgot about compiling, getting errors, fixing them, having to 
"find/search" to do refactoring, etc. And programming like that is so, 
so fast you only have to focus on your code, really.

I know, Walter, you think an IDE is something non-essential. But for big 
projects it is *really* helpful.

A good IDE, and some good core libraries, is what missing here (IMHO).

Is anyone interested?
Oct 30 2006
next sibling parent reply Walter Bright <newshound digitalmars.com> writes:
Ary Manzana wrote:
 I know, Walter, you think an IDE is something non-essential. But for big 
 projects it is *really* helpful.
 
 A good IDE, and some good core libraries, is what missing here (IMHO).
 
 Is anyone interested?
I don't use IDEs. But their usefulness to others is immense, and getting an Eclipse plugin for D to work would be a big contribution to the D community. So yes, I'm interested.
Oct 30 2006
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Walter Bright wrote:
 Ary Manzana wrote:
 I know, Walter, you think an IDE is something non-essential. But for 
 big projects it is *really* helpful.

 A good IDE, and some good core libraries, is what missing here (IMHO).

 Is anyone interested?
I don't use IDEs. But their usefulness to others is immense, and getting an Eclipse plugin for D to work would be a big contribution to the D community. So yes, I'm interested.
I've played with Eclipse a little bit, and though I wasn't blown away by it when compared with Visual Studio, it is *far* better than no IDE at all. But I didn't see on your list the thing I would find most useful: debugger support. Actually I could do without a full-blown IDE if there were just a decent visual debugger. For writing code I'm fine with emacs, but debugging via printfs is annoying. And don't go telling me about that crashy WinDbg thing -- it's just not up to snuff. Regardless of my personal preferences, I agree that an Eclipse plugin is probably the fastest and best way to get a full-fledged D IDE up and running in the short term. --bb
Oct 30 2006
next sibling parent reply "Frank Benoit (keinfarbton)" <benoit tionex.removethispart.de> writes:
 Actually I could do without a full-blown IDE if there were just a decent
 visual debugger.  For writing code I'm fine with emacs, but debugging
 via printfs is annoying.  And don't go telling me about that crashy
 WinDbg thing -- it's just not up to snuff.
Oh yes. A working debugger would be so great. Showing variable values in gdb/ddd. And a working backtrace.
Oct 30 2006
parent reply Chad J <gamerChad _spamIsBad_gmail.com> writes:
Frank Benoit (keinfarbton) wrote:
Actually I could do without a full-blown IDE if there were just a decent
visual debugger.  For writing code I'm fine with emacs, but debugging
via printfs is annoying.  And don't go telling me about that crashy
WinDbg thing -- it's just not up to snuff.
Oh yes. A working debugger would be so great. Showing variable values in gdb/ddd. And a working backtrace.
I have seen posts on here from people who have written and posted backtrace implementations. shinichiro.h wrote one that I tried out, even seems maintained since it's at v0.169 compatability (good job shinichiro!). Here is a link to that post: http://www.digitalmars.com/d/archives/digitalmars/D/32313.html I installed it and within about 10 mins had working backtrace. Works with exceptions, access violations, asserts, and I dunno what else. The only thing it hasn't worked for me on so far was when I created an error in a second thread - it couldn't backtrace that for whatever reason. Apparently Maxime Larose also made a working backtrace implementation, though I couldn't find the download link. http://www.digitalmars.com/d/archives/digitalmars/D/22967.html It really bugs me that this exists and seems so trivial to install, yet it is not included in phobos. This could have saved me many many hours of debugging time. Yet it isn't in by default. wth??
Oct 30 2006
parent reply "Frank Benoit (keinfarbton)" <benoit tionex.removethispart.de> writes:
 shinichiro!).  Here is a link to that post:
 
 http://www.digitalmars.com/d/archives/digitalmars/D/32313.html
I think it only works on win32? I didn't say that, but I use linux, so I cannot use or test this solution :(
Nov 01 2006
parent reply Chad J <gamerChad _spamIsBad_gmail.com> writes:
Frank Benoit (keinfarbton) wrote:
shinichiro!).  Here is a link to that post:

http://www.digitalmars.com/d/archives/digitalmars/D/32313.html
I think it only works on win32? I didn't say that, but I use linux, so I cannot use or test this solution :(
Bummer :( Even so, I still think phobos should have backtrace on windows since it has been done already and is also very helpful. Hopefully someone will do a linux version at some point.
Nov 01 2006
parent Lars Ivar Igesund <larsivar igesund.net> writes:
Chad J wrote:

 Frank Benoit (keinfarbton) wrote:
shinichiro!).  Here is a link to that post:

http://www.digitalmars.com/d/archives/digitalmars/D/32313.html
I think it only works on win32? I didn't say that, but I use linux, so I cannot use or test this solution :(
Bummer :( Even so, I still think phobos should have backtrace on windows since it has been done already and is also very helpful. Hopefully someone will do a linux version at some point.
Well, actually, generally gdb is able to provide the backtrace without any particular help from DMD. For some reason, it works better without debug info turned on in later versions (but without line numbers). -- Lars Ivar Igesund blog at http://larsivi.net DSource & #D: larsivi
Nov 01 2006
prev sibling parent reply Ary Manzana <ary esperanto.org.ar> writes:
Bill Baxter escribió:
  > Actually I could do without a full-blown IDE if there were just a 
decent
 visual debugger.  For writing code I'm fine with emacs, but debugging 
 via printfs is annoying.  And don't go telling me about that crashy 
 WinDbg thing -- it's just not up to snuff.
I agree. Well, making the debug thing is the most difficult part, but it would be very nice to have it, although right now I'm not feeling capable of doing that (I know little about compilers, debuggers, etc.). Eclipse provides a framework to hook some debug stuff, so I guess it won't be (that) hard to do it. Well, I've cleaned up a bit the code and here it is: http://www.esperanto.org.ar/d/descent.ui.zip Umm... Uncompress everything in the eclipse directory, and everything should work. In the plugins directory there are three jars (core, ui and tests... I forgot to mention I made a lot of tests), source code included, so you can take a look and not feel that scared (the most important is descent.core). Before starting you should know the plugin compiles with "dmd" only, and it searches it in the environment path (I only tried it in Windows). I put an option in a property page to change it, but I couldn't get to get it working :-( Go to File -> New -> Project -> D -> D project, enter a location and hit it. You should see a "src" folder in the project. There you must create the d files (File -> New -> File -> foo.d). While you write the file, if you stop typing you should see error markers appearing, as well as the outline view being updated. If you save the file you should see *all* the errors, since I parse dmd output (I will drop these once the plugin gets all the errors by itself). Also, obj and di files are created when saving, so compiling is faster. Well... that's all for now. I know it's less (maybe?) than what DDT has, but maybe it's a bit more organized, and it uses incremental building (just for single files, not for projects yet). The next step would be to understand the semantic routines and add them to the code. I guess I won't have to copy all the source code since I only need to get errors, not to compile anything... I wonder if making a visitor would be easier to get the semantics done...? Any ideas...?
Oct 30 2006
parent reply Walter Bright <newshound digitalmars.com> writes:
Ary Manzana wrote:
 Well, I've cleaned up a bit the code and here it is:
 
 http://www.esperanto.org.ar/d/descent.ui.zip
It'd be nice if you could put together a web page about it explaining what it is, how to use it, basically what your post said. A web page would make it much more findable and popular, and perhaps can help attract developers to help expand it.
Oct 30 2006
parent reply jcc7 <technocrat7 gmail.com> writes:
== Quote from Walter Bright (newshound digitalmars.com)'s article
 Ary Manzana wrote:
 Well, I've cleaned up a bit the code and here it is:

 http://www.esperanto.org.ar/d/descent.ui.zip
It'd be nice if you could put together a web page about it explaining what it is, how to use it, basically what your post said. A web page would make it much more findable and popular, and perhaps can help attract developers to help expand it.
That's a good idea. A proper web page is a good way to show how serious of an effort this project is. (Not to say that I don't believe it's a serious project, but that a good web page can be a great means of advertisement.) Speaking of advertisement, I created a wiki page for it based on a couple of Ary's newsgroup posts since it sounds like such a cool project. I'm not what the name of this new Eclipe project is, but I set up the wiki page as: http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI
Oct 31 2006
parent reply Ary Manzana <ary esperanto.org.ar> writes:
jcc7 wrote:
 == Quote from Walter Bright (newshound digitalmars.com)'s article
 Ary Manzana wrote:
 Well, I've cleaned up a bit the code and here it is:

 http://www.esperanto.org.ar/d/descent.ui.zip
It'd be nice if you could put together a web page about it explaining what it is, how to use it, basically what your post said. A web page would make it much more findable and popular, and perhaps can help attract developers to help expand it.
That's a good idea. A proper web page is a good way to show how serious of an effort this project is. (Not to say that I don't believe it's a serious project, but that a good web page can be a great means of advertisement.) Speaking of advertisement, I created a wiki page for it based on a couple of Ary's newsgroup posts since it sounds like such a cool project. I'm not what the name of this new Eclipe project is, but I set up the wiki page as: http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI
Thanks a lot!! I'm considering putting the code into dsource. I'm going on a trip for the weekend so next week I'll do this. Also I'll make a list of things done and (a short list of) things to be done, similar to the "future" page on digitalmars. As anyone tried the plugin? I'm looking for some feedback...
Oct 31 2006
next sibling parent Walter Bright <newshound digitalmars.com> writes:
Ary Manzana wrote:
 jcc7 wrote:
 Speaking of advertisement, I created a wiki page for it based on a 
 couple of Ary's
 newsgroup posts since it sounds like such a cool project. I'm not what 
 the name of
 this new Eclipe project is, but I set up the wiki page as:
 http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI
Thanks a lot!! I'm considering putting the code into dsource. I'm going on a trip for the weekend so next week I'll do this. Also I'll make a list of things done and (a short list of) things to be done, similar to the "future" page on digitalmars. As anyone tried the plugin? I'm looking for some feedback...
Also, please add a link from your project page to the wiki page jcc7 set up.
Oct 31 2006
prev sibling parent reply Charlie <charlies nowhere.com> writes:
 As anyone tried the plugin? I'm looking for some feedback...
I can't get it to work, I unzip the package , it expands to features/descent.ui_1.0.0.jar plugins/*core* plugins/*tests* plugins/*ui* But I don't see any option to choose D Project. I'm really looking forward to trying this plugin, I would love to see a plugin on par with PHPEclipse - and think it would draw allot of attention to D to have a great eclipse plugin. Ary Manzana wrote:
 jcc7 wrote:
 == Quote from Walter Bright (newshound digitalmars.com)'s article
 Ary Manzana wrote:
 Well, I've cleaned up a bit the code and here it is:

 http://www.esperanto.org.ar/d/descent.ui.zip
It'd be nice if you could put together a web page about it explaining what it is, how to use it, basically what your post said. A web page would make it much more findable and popular, and perhaps can help attract developers to help expand it.
That's a good idea. A proper web page is a good way to show how serious of an effort this project is. (Not to say that I don't believe it's a serious project, but that a good web page can be a great means of advertisement.) Speaking of advertisement, I created a wiki page for it based on a couple of Ary's newsgroup posts since it sounds like such a cool project. I'm not what the name of this new Eclipe project is, but I set up the wiki page as: http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI
Thanks a lot!! I'm considering putting the code into dsource. I'm going on a trip for the weekend so next week I'll do this. Also I'll make a list of things done and (a short list of) things to be done, similar to the "future" page on digitalmars. As anyone tried the plugin? I'm looking for some feedback...
Oct 31 2006
parent reply Charlie <charlies nowhere.com> writes:
Ok I see, I have to first install DDT , then unzip the package.

Then it gives me *two* D project options, and only the icon is different.

After finding out that the open folder with the D is the descent project 
type I get it working, and the parser works great!  I would think this 
is one of the hardest parts so its cool to see how far you've developed it.

I didn't get highlighted errors as I typed however.

This looks like its going to be a great project.

Charlie

Charlie wrote:
  > As anyone tried the plugin? I'm looking for some feedback...
 
 I can't get it to work, I unzip the package , it expands to
 
 features/descent.ui_1.0.0.jar
 plugins/*core*
 plugins/*tests*
 plugins/*ui*
 
 But I don't see any option to choose D Project.
 
 I'm really looking forward to trying this plugin, I would love to see a 
 plugin on par with PHPEclipse - and think it would draw allot of 
 attention to D to have a great eclipse plugin.
 
 Ary Manzana wrote:
 jcc7 wrote:
 == Quote from Walter Bright (newshound digitalmars.com)'s article
 Ary Manzana wrote:
 Well, I've cleaned up a bit the code and here it is:

 http://www.esperanto.org.ar/d/descent.ui.zip
It'd be nice if you could put together a web page about it explaining what it is, how to use it, basically what your post said. A web page would make it much more findable and popular, and perhaps can help attract developers to help expand it.
That's a good idea. A proper web page is a good way to show how serious of an effort this project is. (Not to say that I don't believe it's a serious project, but that a good web page can be a great means of advertisement.) Speaking of advertisement, I created a wiki page for it based on a couple of Ary's newsgroup posts since it sounds like such a cool project. I'm not what the name of this new Eclipe project is, but I set up the wiki page as: http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI
Thanks a lot!! I'm considering putting the code into dsource. I'm going on a trip for the weekend so next week I'll do this. Also I'll make a list of things done and (a short list of) things to be done, similar to the "future" page on digitalmars. As anyone tried the plugin? I'm looking for some feedback...
Oct 31 2006
parent reply Ary Manzana <ary esperanto.org.ar> writes:
Charlie escribió:
 Ok I see, I have to first install DDT , then unzip the package.
No, it dosen't depend on DDT. In fact I guess they conflict with each other.
 
 Then it gives me *two* D project options, and only the icon is different.
The one from the descent plugin creates a "src" folder, check this to be sure.
 
 After finding out that the open folder with the D is the descent project 
 type I get it working, and the parser works great!  I would think this 
 is one of the hardest parts so its cool to see how far you've developed it.
 
 I didn't get highlighted errors as I typed however.
Probably because my editor wasn't being used: instead, the DDT editor was used.
 
 This looks like its going to be a great project.
 
 Charlie
 
 Charlie wrote:
  > As anyone tried the plugin? I'm looking for some feedback...

 I can't get it to work, I unzip the package , it expands to

 features/descent.ui_1.0.0.jar
 plugins/*core*
 plugins/*tests*
 plugins/*ui*
Copy what is found in "features" to the "features" folder under eclipse. The same goes for the "plugin" folder. And delete plugins provided by DDT (I guess org.dsource.ddt.*). I guess they conflict with each other. You _should_ see the new D Project option in the "New Project" wizard just doing that... If you get it to work, please leave some answer to some FAQ in: http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI Thanks!
Oct 31 2006
parent Charlie <charlies nowhere.com> writes:
Ok with a fresh eclipse install , it works perfect.  It was that I had 
DDT installed prior to Descent, then used the Manage Configuration to 
uninstall DDT ( after I copied the Descent folders over ) , which also 
deleted descent from the New Project list for some reason.  Trying after 
the DDT uninstall to copy the Descent folders to eclipse continues to 
fail, so people installing Descent make sure DDT is uninstalled first. 
Ill add this to the forum / wiki page.

Awesome job though, highlights errors per file, and a great outline as 
well.  This is going to make life much easier!


Ary Manzana wrote:
 Charlie escribió:
 Ok I see, I have to first install DDT , then unzip the package.
No, it dosen't depend on DDT. In fact I guess they conflict with each other.
 Then it gives me *two* D project options, and only the icon is different.
The one from the descent plugin creates a "src" folder, check this to be sure.
 After finding out that the open folder with the D is the descent 
 project type I get it working, and the parser works great!  I would 
 think this is one of the hardest parts so its cool to see how far 
 you've developed it.

 I didn't get highlighted errors as I typed however.
Probably because my editor wasn't being used: instead, the DDT editor was used.
 This looks like its going to be a great project.

 Charlie

 Charlie wrote:
  > As anyone tried the plugin? I'm looking for some feedback...

 I can't get it to work, I unzip the package , it expands to

 features/descent.ui_1.0.0.jar
 plugins/*core*
 plugins/*tests*
 plugins/*ui*
Copy what is found in "features" to the "features" folder under eclipse. The same goes for the "plugin" folder. And delete plugins provided by DDT (I guess org.dsource.ddt.*). I guess they conflict with each other. You _should_ see the new D Project option in the "New Project" wizard just doing that... If you get it to work, please leave some answer to some FAQ in: http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI Thanks!
Nov 01 2006
prev sibling next sibling parent reply Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
Ary Manzana wrote:
 Hello!
 
 Is anyone interested in making a *great* eclipse plugin? A plugin 
 similar to JDT.
 
 I know some IDEs out there exist, but none of them is really powerful. 
 For example I think DDT is dead, or out of date.
 
 My intentions are:
 
 - To use Walter's code to make the parsing and build a model, since it's 
 the only safe way to guarantee compliance with the current DMD compiler. 
 Then diffing changes in the source should make changes in the plugin 
 quite simple. (not to use ANTLR, for instance)
 - To document every public class, so that other people can join the 
 project "easily". I took a look at the DDT code and I found just a 
 little bit of comment... :-(
 - To use an architecture similar to the one JDT uses. DDT tried this, 
 but I don't know what happened (most of the classes are empty!)... For 
 example PHPEclipse uses many of JDT classes and interfaces (redefining 
 them)... even keeping the same names! (i.e. IJavaElement)
 - To make things with patience. First do the parsing (port the parser), 
 build a model and have an outline. Second singal syntax errors. Third 
 signal simple semantic errors (I believe method "semantic" of Dsymbol... 
 maybe "semantic2" and "semantic3" uses relationships between modules). 
 Fourth, copy JDT architecture. Fifth, add renaming, refactoring, 
 autocomplete, quick fixes, etc. ... In the middle of those points be 
 able to compile everything :-P
 
 With patience I mean: take a deep look at how JDT is done, then put 
 yourself to program.
 
 Fourtunately, I've already ported most of the parser (for D 0.168) to 
 Java, I already build a model, have an outline view and singal simple 
 syntax errors. Not just the line number, but the exact positions where 
 the error is present. Also the plugin compiles automatically your code, 
 but I still don't know how to link everything automatically (I'm missing 
 some rule, I guess). And nothing more: I'm currently reading a lot of 
 code from the JDT core plugin, and some Walter's code.
 
 I think a D plugin for eclipse would be of big utility to the D 
 community. Since I started programing in Java with Eclipse I totally 
 forgot about compiling, getting errors, fixing them, having to 
 "find/search" to do refactoring, etc. And programming like that is so, 
 so fast you only have to focus on your code, really.
 
 I know, Walter, you think an IDE is something non-essential. But for big 
 projects it is *really* helpful.
 
 A good IDE, and some good core libraries, is what missing here (IMHO).
 
 Is anyone interested?
Hi, yes, I'm working on an Eclipse plugin too. I've started very recently (about two weeks ago), so I don't have anything significant to show yet, but I'm doing this as my degree final project, so I will be working on it during all school year. We definitely should talk and see if we can combine efforts, but the approach I was thinking was to build a parser using ANTLR, similar to what the previous eclipse plugins did (Blackbird, DDT). However, you seem to be far ahead of I've done. You say you've converted the whole D frontend to Java? (to descent\internal\core\dom\Parser.java I presume) That must have been a lot of work. I'd actually like to know how long it took for you to do that, and if it's working correctly. I'm gonna take a better look at your code. -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Oct 31 2006
parent reply Ary Manzana <ary esperanto.org.ar> writes:
Bruno Medeiros escribió:
 Ary Manzana wrote:
 Hi, yes, I'm working on an Eclipse plugin too. I've started very 
 recently (about two weeks ago), so I don't have anything significant to 
 show yet, but I'm doing this as my degree final project, so I will be 
 working on it during all school year.
 
 We definitely should talk and see if we can combine efforts, but the 
 approach I was thinking was to build a parser using ANTLR, similar to 
 what the previous eclipse plugins did (Blackbird, DDT). However, you 
 seem to be far ahead of I've done. You say you've converted the whole D 
 frontend to Java? (to descent\internal\core\dom\Parser.java I presume) 
 That must have been a lot of work. I'd actually like to know how long it 
 took for you to do that
About a month and a half? (in my precious little spare time, of course :-P). I don't remember... , and if it's working correctly. I'm gonna take a
 better look at your code.
 
 
Great! I would be very happy to combine efforts. The project now has a webpage in dsource.org: http://www.dsource.org/projects/descent/ There I wrote an explanation about why not to use ANTLR (I started doing that, then I changed to using DMD source code and it was *way* faster and better). I only converted parser.h, parser.c (yes, descent\internal\core\dom\Parser.java) , lexer.h, lexer.c (descent\internal\core\dom\Lexer.java) and the classes/functions referenced there: just the clean model with no semmantic stuff. Porting c++ to Java was not an easy task, especially since Java has no powerful "goto" (oh my, 732 in the whole code), so I had to change some of the code, or duplicate it (I don't want to break anything at first). Is it working ok? Check descent.test.jar. You can find cases to test both the parser and the lexer. I just downloaded the excelent Coverclipse ( http://coverlipse.sourceforge.net/ ): the parser is %65 tested; the lexer %68. That's more than half of it! :-) And it's not just copy-paste and test. The Token class now has two properties to tell its start position and length, as well as every class in the model, since a regular compiler dosen't need it, but a visual does. And I've written nice interfaces to the model (check descent.core.dom). The first step would be to get (close to) %100 test coverage on parser and lexer, then move on to the big (juicy) stuff. Read the last sentence I wrote on the dsource page: wait for me until then :-) (I will write all of these explanations in the webpage, and more, when I'll come back, I promise)
Oct 31 2006
next sibling parent reply Walter Bright <newshound digitalmars.com> writes:
Ary Manzana wrote:
 I only converted parser.h, parser.c (yes, 
 descent\internal\core\dom\Parser.java) , lexer.h, lexer.c 
 (descent\internal\core\dom\Lexer.java) and the classes/functions 
 referenced there: just the clean model with no semmantic stuff. Porting 
 c++ to Java was not an easy task, especially since Java has no powerful 
 "goto" (oh my, 732 in the whole code), so I had to change some of the 
 code, or duplicate it (I don't want to break anything at first).
I deliberately avoided using things like exceptions in it to make it easy to port, but I didn't think about the goto's.
Oct 31 2006
parent reply Ary Manzana <ary esperanto.org.ar> writes:
Walter Bright wrote:

 I deliberately avoided using things like exceptions in it to make it 
 easy to port, but I didn't think about the goto's.
It's ok, you make an excellent use of them. But later in the development process I will need a hand with "Parser::isBasicType", "Parser::parseBasicType" and "Parser::parseDeclDefs(bool)". Just take a look at this: --- int Parser::isBasicType(Token **pt) { // This code parallels parseBasicType() Token *t = *pt; Token *t2; int parens; switch (t->value) { CASE_BASIC_TYPES: t = peek(t); break; case TOKidentifier: t = peek(t); if (t->value == TOKnot) { goto L4; } goto L3; while (1) { L2: t = peek(t); L3: if (t->value == TOKdot) { Ldot: t = peek(t); if (t->value != TOKidentifier) goto Lfalse; t = peek(t); if (t->value != TOKnot) goto L3; L4: t = peek(t); if (t->value != TOKlparen) goto Lfalse; if (!skipParens(t, &t)) goto Lfalse; } else break; } break; case TOKdot: goto Ldot; case TOKtypeof: /* typeof(exp).identifier... */ t = peek(t); if (t->value != TOKlparen) goto Lfalse; if (!skipParens(t, &t)) goto Lfalse; goto L2; default: goto Lfalse; } *pt = t; return TRUE; Lfalse: return FALSE; } --- I was thinking of sending a feature request to Java just for this tiny function :-P
Nov 01 2006
parent reply Walter Bright <newshound digitalmars.com> writes:
Ary Manzana wrote:
 I was thinking of sending a feature request to Java just for this tiny 
 function :-P
Sorry about that <g>. It is pretty awful. But goto roolz. Lack of goto is one reason why I don't program in Java, I don't like languages trying to be my mom. There's no technical reason why Java can't have one, I know, I wrote a Java compiler.
Nov 01 2006
parent reply Sean Kelly <sean f4.ca> writes:
Walter Bright wrote:
 Ary Manzana wrote:
 I was thinking of sending a feature request to Java just for this tiny 
 function :-P
Sorry about that <g>. It is pretty awful. But goto roolz. Lack of goto is one reason why I don't program in Java, I don't like languages trying to be my mom. There's no technical reason why Java can't have one, I know, I wrote a Java compiler.
It does in a limited form via labels and break/continue, but this obviously has far less utility than goto. Sean
Nov 01 2006
parent Walter Bright <newshound digitalmars.com> writes:
Sean Kelly wrote:
 It does in a limited form via labels and break/continue, but this 
 obviously has far less utility than goto.
Some people even eschew break and continue as impure thoughts that must be cast out.
Nov 01 2006
prev sibling parent reply Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
Ary Manzana wrote:
 Bruno Medeiros escribió:
 Ary Manzana wrote:
 Hi, yes, I'm working on an Eclipse plugin too. I've started very 
 recently (about two weeks ago), so I don't have anything significant 
 to show yet, but I'm doing this as my degree final project, so I will 
 be working on it during all school year.

 We definitely should talk and see if we can combine efforts, but the 
 approach I was thinking was to build a parser using ANTLR, similar to 
 what the previous eclipse plugins did (Blackbird, DDT). However, you 
 seem to be far ahead of I've done. You say you've converted the whole 
 D frontend to Java? (to descent\internal\core\dom\Parser.java I 
 presume) That must have been a lot of work. I'd actually like to know 
 how long it took for you to do that
About a month and a half? (in my precious little spare time, of course :-P). I don't remember... , and if it's working correctly. I'm gonna take a
 better look at your code.
Great! I would be very happy to combine efforts. The project now has a webpage in dsource.org: http://www.dsource.org/projects/descent/ There I wrote an explanation about why not to use ANTLR (I started doing that, then I changed to using DMD source code and it was *way* faster and better). I only converted parser.h, parser.c (yes, descent\internal\core\dom\Parser.java) , lexer.h, lexer.c (descent\internal\core\dom\Lexer.java) and the classes/functions referenced there: just the clean model with no semmantic stuff. Porting c++ to Java was not an easy task, especially since Java has no powerful "goto" (oh my, 732 in the whole code), so I had to change some of the code, or duplicate it (I don't want to break anything at first). Is it working ok? Check descent.test.jar. You can find cases to test both the parser and the lexer. I just downloaded the excelent Coverclipse ( http://coverlipse.sourceforge.net/ ): the parser is %65 tested; the lexer %68. That's more than half of it! :-) And it's not just copy-paste and test. The Token class now has two properties to tell its start position and length, as well as every class in the model, since a regular compiler dosen't need it, but a visual does. And I've written nice interfaces to the model (check descent.core.dom). The first step would be to get (close to) %100 test coverage on parser and lexer, then move on to the big (juicy) stuff. Read the last sentence I wrote on the dsource page: wait for me until then :-) (I will write all of these explanations in the webpage, and more, when I'll come back, I promise)
Let me know when you get back. I have a lot of questions, it would be nice if we could exchange IM contacts (MSN, YM?), for now, I'm usually at the D IRC channel (bruno_m). For starters: "Ported most of DMD lexer and parser code. " - What do you mean "most" ? And what task are you planning to do next? My original planning was for me to do first an IDE-decoupled command-line tool that would perform some operations useful-even-outside-of-an-IDE, like code beautification or refactoring. This isn't just for project phased planning or code abstraction, I think it's a worthy goal of itself. Such IDE-decoupled tool could then be used by developers who use another IDE,editor (or none at all). Perhaps it could also be useful (by porting or direct use) to other IDEs in the future. (like Poseidon maybe?) Anyways, I'm gonna keep looking at you code and what it can do, I still have only taken a quick look at it. -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Nov 05 2006
parent reply Ary Manzana <ary esperanto.org.ar> writes:
Bruno Medeiros escribió:
 Let me know when you get back. 
I'm back.
 I have a lot of questions, it would be
 nice if we could exchange IM contacts (MSN, YM?), for now, I'm usually 
 at the D IRC channel (bruno_m).
Which server? I didn't find it. My MSN is asterite ĉe hotmail punkto com.
 For starters: "Ported most of DMD lexer and parser code. " - What do you 
 mean "most" ? And what task are you planning to do next?
In http://www.dsource.org/projects/descent/wiki/WikiStart I added a section below, "How to help?". There you'll find the explantation for "most". Actually, the lexer and parser code are ported, but the source ranges for elements are still missing for a lot of elements, as well as the nice AST interfaces.
 My original planning was for me to do first an IDE-decoupled 
 command-line tool that would perform some operations 
 useful-even-outside-of-an-IDE, like code beautification or refactoring. 
 This isn't just for project phased planning or code abstraction, I think 
 it's a worthy goal of itself. Such IDE-decoupled tool could then be used 
 by developers who use another IDE,editor (or none at all). Perhaps it 
 could also be useful (by porting or direct use) to other IDEs in the 
 future. (like Poseidon maybe?)
Sounds like an interesting project, but I don't like the idea of a plugin using command lines. But that's just me.
 Anyways, I'm gonna keep looking at you code and what it can do, I still 
 have only taken a quick look at it.
If you have any questions, don't hesitate. I suppose the little explanation on the dsource page won't suffice, but taking a look at which lines don't get covered by the tests gives a big hint on what to program next. Ary P.D.: What is the <g> everyone use in their messages?
Nov 06 2006
next sibling parent reply Jesse Phillips <Jesse.K.Phillips+Digitalmars gmail.com> writes:
Ary Manzana wrote:
 Bruno Medeiros escribió:
 Let me know when you get back. 
I'm back.
 I have a lot of questions, it would be
 nice if we could exchange IM contacts (MSN, YM?), for now, I'm usually
 at the D IRC channel (bruno_m).
Which server? I didn't find it. My MSN is asterite ĉe hotmail punkto com.
#D is on FreeNode.
 
 P.D.: What is the <g> everyone use in their messages?
<g> <grin> if I remember correctly.
Nov 06 2006
parent Kyle Furlong <kylefurlong gmail.com> writes:
Jesse Phillips wrote:
 Ary Manzana wrote:
 Bruno Medeiros escribió:
 Let me know when you get back. 
I'm back.
 I have a lot of questions, it would be
 nice if we could exchange IM contacts (MSN, YM?), for now, I'm usually
 at the D IRC channel (bruno_m).
Which server? I didn't find it. My MSN is asterite ĉe hotmail punkto com.
#D is on FreeNode.
 P.D.: What is the <g> everyone use in their messages?
<g> <grin> if I remember correctly.
Party over at #D WOO WOO! Actually, there isnt one right now, but THERE COULD BE!
Nov 07 2006
prev sibling parent reply Lars Ivar Igesund <larsivar igesund.net> writes:
Ary Manzana wrote:

 Bruno Medeiros escribió:
 Let me know when you get back.
I'm back. > I have a lot of questions, it would be
 nice if we could exchange IM contacts (MSN, YM?), for now, I'm usually
 at the D IRC channel (bruno_m).
Which server? I didn't find it. My MSN is asterite ĉe hotmail punkto com.
 For starters: "Ported most of DMD lexer and parser code. " - What do you
 mean "most" ? And what task are you planning to do next?
In http://www.dsource.org/projects/descent/wiki/WikiStart I added a section below, "How to help?". There you'll find the explantation for "most". Actually, the lexer and parser code are ported, but the source ranges for elements are still missing for a lot of elements, as well as the nice AST interfaces.
 My original planning was for me to do first an IDE-decoupled
 command-line tool that would perform some operations
 useful-even-outside-of-an-IDE, like code beautification or refactoring.
 This isn't just for project phased planning or code abstraction, I think
 it's a worthy goal of itself. Such IDE-decoupled tool could then be used
 by developers who use another IDE,editor (or none at all). Perhaps it
 could also be useful (by porting or direct use) to other IDEs in the
 future. (like Poseidon maybe?)
Sounds like an interesting project, but I don't like the idea of a plugin using command lines. But that's just me.
Well if the actual functionality is implemented in small libs, it could be exposed in both ways ... would be smart in any case, no? -- Lars Ivar Igesund blog at http://larsivi.net DSource & #D: larsivi
Nov 07 2006
parent Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
Lars Ivar Igesund wrote:
 Ary Manzana wrote:
 
 Bruno Medeiros escribió:
 Let me know when you get back.
I'm back. > I have a lot of questions, it would be
 nice if we could exchange IM contacts (MSN, YM?), for now, I'm usually
 at the D IRC channel (bruno_m).
Which server? I didn't find it. My MSN is asterite ĉe hotmail punkto com.
 For starters: "Ported most of DMD lexer and parser code. " - What do you
 mean "most" ? And what task are you planning to do next?
In http://www.dsource.org/projects/descent/wiki/WikiStart I added a section below, "How to help?". There you'll find the explantation for "most". Actually, the lexer and parser code are ported, but the source ranges for elements are still missing for a lot of elements, as well as the nice AST interfaces.
 My original planning was for me to do first an IDE-decoupled
 command-line tool that would perform some operations
 useful-even-outside-of-an-IDE, like code beautification or refactoring.
 This isn't just for project phased planning or code abstraction, I think
 it's a worthy goal of itself. Such IDE-decoupled tool could then be used
 by developers who use another IDE,editor (or none at all). Perhaps it
 could also be useful (by porting or direct use) to other IDEs in the
 future. (like Poseidon maybe?)
Sounds like an interesting project, but I don't like the idea of a plugin using command lines. But that's just me.
Well if the actual functionality is implemented in small libs, it could be exposed in both ways ... would be smart in any case, no?
Yes, that's I meant. The (Eclipse) plugin uses the lib directly, not through the command-line. The command-line is just an alternative front-end. -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Nov 08 2006
prev sibling parent reply Walter Bright <newshound digitalmars.com> writes:
I ran across this. Hope it might help.

http://www-128.ibm.com/developerworks/opensource/edu/os-dw-os-ecl-commplgin3.html?S_TACT=105AGX44&S_CMP=HP
Nov 02 2006
parent Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
Walter Bright wrote:
 I ran across this. Hope it might help.
 
 http://www-128.ibm.com/developerworks/opensource/edu/os-dw-os-ecl-commplgin3.html?S_TA
T=105AGX44&S_CMP=HP 
 
 
Already knew, but yes, it's a good article. -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Nov 05 2006