Re: [gwt-contrib] Re: Generator, get method body

2013-05-24 Thread Manuel Carrasco Moñino
It seems that the eclipse-jdt-core included in GWT doesnt have certain
classes like ASTParser. I would give a  try including the eclipse
dependency in my pom.xml.


On Fri, May 24, 2013 at 2:35 AM, John A. Tamplin j...@jaet.org wrote:

 On Thu, May 23, 2013 at 7:56 PM, Manuel Carrasco Moñino man...@apache.org
  wrote:

 The ShowcaseGenerator, is actually reading the content of the source
 files and generating .html files, but I want to extract method bodies and
 their javadoc so what I need an AST. So my question is more about how to
 use the gwt ast from a generator.


 The GWT AST is not available to generators, so you will have to build your
 own -- you can use JDT as that is included with GWT.

 --
 John A. Tamplin

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
 ---
 You received this message because you are subscribed to the Google Groups
 GWT Contributors group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-24 Thread Manuel Carrasco Moñino
Good to know. thanks.


On Fri, May 24, 2013 at 6:54 AM, Roberto Lublinerman rlu...@google.comwrote:

 Even if it were accessible to the generators the GWT AST does not contain
 javadocs nor comments.

 Roberto Lublinerman | Software Engineer | rlu...@google.com | 408-500-9148


 On Thu, May 23, 2013 at 5:35 PM, John A. Tamplin j...@jaet.org wrote:

 On Thu, May 23, 2013 at 7:56 PM, Manuel Carrasco Moñino 
 man...@apache.org wrote:

 The ShowcaseGenerator, is actually reading the content of the source
 files and generating .html files, but I want to extract method bodies and
 their javadoc so what I need an AST. So my question is more about how to
 use the gwt ast from a generator.


 The GWT AST is not available to generators, so you will have to build
 your own -- you can use JDT as that is included with GWT.

 --
 John A. Tamplin

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
 ---
 You received this message because you are subscribed to the Google Groups
 GWT Contributors group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
 ---
 You received this message because you are subscribed to the Google Groups
 GWT Contributors group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-24 Thread Roberto Lublinerman
ASTParser should be in eclipse-jdt-core, although there seems to be
different AST representation, GWT uses the one in
org.eclipse.jdt.internal.compiler.ast whereas the ASTParser works in
org.eclipse.jdt.core.dom. JDT has a very thick api to support the eclipse
editor and some simple tasks might become overly complex. I wonder if the
approach you have taken using a much smaller and simpler parser is not
actually better.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-24 Thread John A. Tamplin
On Fri, May 24, 2013 at 6:33 AM, Roberto Lublinerman rlu...@google.comwrote:

 ASTParser should be in eclipse-jdt-core, although there seems to be
 different AST representation, GWT uses the one in
 org.eclipse.jdt.internal.compiler.ast whereas the ASTParser works in
 org.eclipse.jdt.core.dom. JDT has a very thick api to support the eclipse
 editor and some simple tasks might become overly complex. I wonder if the
 approach you have taken using a much smaller and simpler parser is not
 actually better.


When I needed to parse the source to get parameter names from interface
methods (which aren't included in the bytecode), I used
CodeSnippetParsingUtil in JDT and it seemed straightforward enough.

-- 
John A. Tamplin

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-23 Thread Manuel Carrasco Moñino
Hi Roberto, sorry by the delay.

What I'm doing is a generator for presentations. Given a java class with my
example methods, create a set of html slides.

The generator reads the javadoc and the body of the method, and put them in
a hash table into the generated class. Then in client side I can use this
info to insert the code and wording in my slides using gwtquery.

You can see my generator in github [1], focus on parseJava() in line #73.

Right now I'm using japa.parser.JavaParser [2], but I'm wondering if there
is a way to use gwt parsers so as I dont have to import a 3party library.

[1]
https://github.com/manolo/gwt-slides/blob/master/src/main/java/org/gquery/slides/bind/SlidesGenerator.java#L73
[2] https://code.google.com/p/javaparser/


Thanks
- Manolo



On Wed, May 15, 2013 at 2:39 PM, Roberto Lublinerman rlu...@google.comwrote:

 Can you share what you are attempting to do? Generators only get to see
 structure (class hierarchy and method definitions) as far as I know.


 On Sunday, May 12, 2013 3:57:35 AM UTC-7, Manuel Carrasco Moñino wrote:

 Hi all

 Is there a way to get the body of a method in a generator? I've seen
 JMethodBody is used in compile time, but I dont figure out how to get it in
 generators.

 Thanks

  --
 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
 ---
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit Contributors group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-23 Thread John A. Tamplin
On Thu, May 23, 2013 at 5:28 PM, Manuel Carrasco Moñino
man...@apache.orgwrote:

 What I'm doing is a generator for presentations. Given a java class with
 my example methods, create a set of html slides.

 The generator reads the javadoc and the body of the method, and put them
 in a hash table into the generated class. Then in client side I can use
 this info to insert the code and wording in my slides using gwtquery.


That sounds a lot like what Showcase does -- maybe this will help:

https://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/showcase/src/com/google/gwt/sample/showcase/generator/ShowcaseGenerator.java


-- 
John A. Tamplin

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-23 Thread Manuel Carrasco Moñino
Thank John for the link.

The ShowcaseGenerator, is actually reading the content of the source files
and generating .html files, but I want to extract method bodies and their
javadoc so what I need an AST. So my question is more about how to use the
gwt ast from a generator.




On Thu, May 23, 2013 at 11:32 PM, John A. Tamplin j...@jaet.org wrote:

 On Thu, May 23, 2013 at 5:28 PM, Manuel Carrasco Moñino man...@apache.org
  wrote:

 What I'm doing is a generator for presentations. Given a java class with
 my example methods, create a set of html slides.

 The generator reads the javadoc and the body of the method, and put them
 in a hash table into the generated class. Then in client side I can use
 this info to insert the code and wording in my slides using gwtquery.


 That sounds a lot like what Showcase does -- maybe this will help:


 https://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/showcase/src/com/google/gwt/sample/showcase/generator/ShowcaseGenerator.java


 --
 John A. Tamplin

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
 ---
 You received this message because you are subscribed to the Google Groups
 GWT Contributors group.

 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-23 Thread John A. Tamplin
On Thu, May 23, 2013 at 7:56 PM, Manuel Carrasco Moñino
man...@apache.orgwrote:

 The ShowcaseGenerator, is actually reading the content of the source files
 and generating .html files, but I want to extract method bodies and their
 javadoc so what I need an AST. So my question is more about how to use the
 gwt ast from a generator.


The GWT AST is not available to generators, so you will have to build your
own -- you can use JDT as that is included with GWT.

-- 
John A. Tamplin

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gwt-contrib] Re: Generator, get method body

2013-05-23 Thread Roberto Lublinerman
Even if it were accessible to the generators the GWT AST does not contain
javadocs nor comments.

Roberto Lublinerman | Software Engineer | rlu...@google.com | 408-500-9148


On Thu, May 23, 2013 at 5:35 PM, John A. Tamplin j...@jaet.org wrote:

 On Thu, May 23, 2013 at 7:56 PM, Manuel Carrasco Moñino man...@apache.org
  wrote:

 The ShowcaseGenerator, is actually reading the content of the source
 files and generating .html files, but I want to extract method bodies and
 their javadoc so what I need an AST. So my question is more about how to
 use the gwt ast from a generator.


 The GWT AST is not available to generators, so you will have to build your
 own -- you can use JDT as that is included with GWT.

 --
 John A. Tamplin

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
 ---
 You received this message because you are subscribed to the Google Groups
 GWT Contributors group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Re: Generator, get method body

2013-05-15 Thread Roberto Lublinerman
Can you share what you are attempting to do? Generators only get to see 
structure (class hierarchy and method definitions) as far as I know.


On Sunday, May 12, 2013 3:57:35 AM UTC-7, Manuel Carrasco Moñino wrote:

 Hi all

 Is there a way to get the body of a method in a generator? I've seen 
 JMethodBody is used in compile time, but I dont figure out how to get it in 
 generators.

 Thanks


-- 
-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.