SableCC and Object Macro Plugin for Maven.

71 views
Skip to first unread message

Hong Phuc Bui

unread,
Feb 18, 2013, 9:57:39 AM2/18/13
to sab...@googlegroups.com
Hi,

For some days I just have write the two plugins because of my need. Now
I just want to share them
in community.

Project: https://github.com/verylazyboy/maven-plugin/

POM example:
https://github.com/verylazyboy/maven-plugin/blob/master/plugin-user-test/pom.xml

I just redistribute the binary of SableCC 3.7 and ObjectMarco 4 beta 4 hier
https://github.com/verylazyboy/mvn-repo

These artifacts are necessary for the plugin.

I hope they could be useful for someone.

Best wish.
Hong Phuc

Paweł Cesar Sanjuan Szklarz

unread,
Feb 18, 2013, 10:09:41 AM2/18/13
to sab...@googlegroups.com
Great, thank you!



Hong Phuc

--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en
--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Gonzalo Ortiz Jaureguizar

unread,
Feb 19, 2013, 4:23:00 AM2/19/13
to sab...@googlegroups.com
I am going to try to use this plugin on my enterprise parsers next weeks. As I told you in private, this new plugin is a huge improve, but I think we can improve two things:
  • We need to "commit" that to mvn central repositories.
  • I think we can make the plugin configuration easier, allowing only one grammar per execution (and not a map of them).
    • If some concrete project need to have more than one grammar, it is possible to execute the plugin n-times.




2013/2/18 Paweł Cesar Sanjuan Szklarz <paw...@gmail.com>

--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

Hong Phuc Bui

unread,
Feb 19, 2013, 4:55:56 AM2/19/13
to sab...@googlegroups.com
Well I can see your post on google groups so it's no more private. Well, just a joke. :)
This is new for me:
>    it is possible to execute the plugin n-times.
I don't known it before. The new version will be released on this weekend with new configuration like your idea. (in my github mvn-repo)
with this feature

> We need to "commit" that to mvn central repositories.
I have no idea how can I commit something in mvn central repositories.
Some more questions are
+ Whom can can contact to?
+ Which requirement must the plugin pass to get to the central repositories ?
+ Can I just "publish" the jar files in central repo? Because the plugin need the sablecc.3.x.jar as
a library.

I can maintain the plugin bis end of life of SableCC version 3.x, but I cannot maintain the distribution
of SableCC in mvn central repository.

I think I will write the same plugin for SableCC 4 in next time.

Can I ask you how your organization use maven repository? directly or over a repository manager like
Artifactory (http://www.jfrog.com/home/v_artifactory_opensource_overview) or Nexus (http://www.sonatype.org/nexus/) I personally like Artifactory and we (my organization) use artifactory
to manage maven repository, because some libraries do not support maven distribute and we have also internal libraries, which cannot be published.




On 02/19/2013 10:23 AM, Gonzalo Ortiz Jaureguizar wrote:
I am going to try to use this plugin on my enterprise parsers next weeks. As I told you in private, this new plugin is a huge improve, but I think we can improve two things:
  • We need to "commit" that to mvn central repositories.
  • I think we can make the plugin configuration easier, allowing only one grammar per execution (and not a map of them).
    • If some concrete project need to have more than one grammar, it is possible to execute the plugin n-times.


2013/2/18 Paweł Cesar Sanjuan Szklarz <paw...@gmail.com>
Great, thank you!


On Mon, Feb 18, 2013 at 3:57 PM, Hong Phuc Bui <phuc...@gmail.com> wrote:
Hi,

For some days I just have write the two plugins because of my need. Now I just want to share them
in community.

Project: https://github.com/verylazyboy/maven-plugin/

POM example:
https://github.com/verylazyboy/maven-plugin/blob/master/plugin-user-test/pom.xml

I just redistribute the binary of SableCC 3.7 and ObjectMarco 4 beta 4 hier
https://github.com/verylazyboy/mvn-repo

These artifacts are necessary for the plugin.

I hope  they could be useful for someone.

Best wish.

Hong Phuc

--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en
--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en
---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alexander Ryzhov

unread,
Feb 19, 2013, 5:08:29 PM2/19/13
to sab...@googlegroups.com
I agree with Gonzalo on both points.
I read about the process of committing to the central Maven repository, and basically there are two conditions:

1. You must be the owner of the project to to that;
2.  Your project must be hosted in one of the "approved" systems.

Hong Phuc, no offense, but your effort doesn't satisfy either one of the conditions.

See here for more info: http://maven.apache.org/guides/mini/guide-central-repository-upload.html

As I understand, the right path to commit SableCC to Central Maven repository is:
1. Mavenize SableCC build.
2. Automate artifact publishing to an approved location (neither git, nor sourceforge is an approved one but codehaus is);
3. The way you commit to Central Maven repository is by filing a ticket, and they will set up a periodic synchronization between your published location and the central maven repository.

On the second point, grammar-specific configuration could be useful. I've been working on a SableCC Maven plugin for generating a GWT-compliant parser, and I was planning to eventually make this plugin available to public. If we can fine-tune config parameters for each grammar, it would enable merging the two plugins together. On the other hand, the grammar file already contains some parameters that belong to configuration, such as package name, and if Etienne continues going that route, configuration won't be necessary.

Regards,
Alexander

Hong Phuc Bui

unread,
Feb 20, 2013, 4:24:00 AM2/20/13
to sab...@googlegroups.com
Hi Alexander,
thanks for your feedback.

I think I will/can not commit SableCC to maven repository.
I'm just the owner of the maven plugin. All I can do is try to publish the
maven plugin in maven central repository and redistribute the SableCC in
my maven repository,
which is hosted in github.

So the first thing I can do is try to host my plugin in codehaus, try to
sign my plugin with
PGP. I'll try it today.

With my plugin you can also configurate the output directory for each
grammar by using the
tag <destination>. By default the output directory is
"generated-sources/sablecc/"

Other options are not supported. Please see the comment in the source file:
https://github.com/verylazyboy/maven-plugin/blob/master/sablecc-maven-plugin/src/main/java/de/htwds/sableccmavenplugin/SableccCaller.java

I also agree with Gonzalo about the point of improvement the
configuration of the plugin. I will implement
it in this weekend.

Best wish
Hong Phuc

Gonzalo Ortiz Jaureguizar

unread,
Feb 20, 2013, 4:31:47 AM2/20/13
to sab...@googlegroups.com
I don't think that the process is as strict as Alexander suggests. There is already a sablecc plugin on mvn central repositories uploaded by a person who is not the author of the project and Etienne (the author) was looking for people who manage the maven plugin.

I think the easier way to upload a project to mvn central repositories is to use a Sonatype OSS license.

In my opinion the best situation for the project would be that Etienne apply for a license Sonatype OSS license (we can help him with that) and then use that license (and the Nexus repository provided) to upload last version of SableCC-library and SableCC-plugin to mvn.


2013/2/20 Hong Phuc Bui <phuc...@gmail.com>
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+unsubscribe@googlegroups.com.

Lucas Satabin

unread,
Feb 20, 2013, 4:52:06 AM2/20/13
to sab...@googlegroups.com
Hi All,

It seems that my old address cannot write to the list without moderation.
I just wanted to say that it is quite easy now to publish to the maven central repository.
The new guidelines are here [1]

Every project can be published to the central repository, no matter where it is hosted (I published several of my projects there that are all hosted on github)
For the ownership of the project, it is probably best to have the approval of the author to avoid potential conflicts even if I cannot remember of any constraint on this from sonatype.

You can also publish ant based projects, the link mentioned above [1] explains how to do it.

Regards
Lucas

[1] https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

Hong Phuc Bui

unread,
Feb 20, 2013, 4:54:20 AM2/20/13
to sab...@googlegroups.com
Well, an other approach could be, that the plugin loads SableCC.jar as the runtime from
net (sourceforce/github, or local harddisk or somewhere) and uses Reflection to access
the SableCC.main() or other methods to compile the grammar file. So the user of the plugin
can configure the URL pointing to the file sablecc.jar, and uses the version he like.

Just an ad-hoc idea. May be it is to complex to implement. (Think about firewall, proxy, version consistence)
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

Gonzalo Ortiz Jaureguizar

unread,
Feb 20, 2013, 5:21:19 AM2/20/13
to sab...@googlegroups.com
Well... people who use maven use it because it is simple and standard. I don't think that use strange ways like donwload the library from other place is a good idea.

I can't talk for other SableCC users, but the thing I want is to have an standard plugin in mvn repositories, write a simple xml section and download all necesary libraries automatically. I already wait for it a lot of months, I think I can wait a some more.

peter lavalle

unread,
Feb 20, 2013, 6:23:36 AM2/20/13
to sab...@googlegroups.com
If you "fork" the project (adding a POM is forking) Sonatype will (probably) be happy to have you (you should use your own groupId)

It's a bit ... long

(I'm quite happy with the existing codehaus plugin and SableCC 3.2, but if you publish SableCC 3.7 I'll switch)

-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

lucassat

unread,
Feb 20, 2013, 2:28:13 AM2/20/13
to sab...@googlegroups.com
Hi Alexander,

Actually the up-to-date guidelines can be found here now:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

There is no problem hosting a project on Github and publish it to the
maven central repository (I publish several of my projects in maven
central repository, and they are all hosted on github).
I see also no constraint on the ownership of the project to publish to
maven central repository, but it is better if the owner of the project
agrees, this can avoid some potential conflict in the future.

There is also instructions how to publish to this repository using ant.

Best regards,
Lucas

On Tue, 19 Feb 2013 14:08:29 -0800 (PST), Alexander Ryzhov
<aryz...@gmail.com> wrote:
> I agree with Gonzalo on both points.
> I read about the process of committing to the central Maven
> repository, and basically there are two conditions:
>
> 1. You must be the owner of the project to to that;
> 2. Your project must be hosted in one of the "approved" systems.
>
> Hong Phuc, no offense, but your effort doesn't satisfy either one of
> the conditions.
>
> See here for more info:
> http://maven.apache.org/guides/mini/guide-central-repository-upload.html
> [1]
>
> As I understand, the right path to commit SableCC to Central Maven
> repository is:
> 1. Mavenize SableCC build.
> 2. Automate artifact publishing to an approved location (neither git,
> nor sourceforge is an approved one but codehaus is);
> 3. The way you commit to Central Maven repository is by filing a
> ticket, and they will set up a periodic synchronization between your
> published location and the central maven repository.
>
> On the second point, grammar-specific configuration could be useful.
> I've been working on a SableCC Maven plugin for generating a
> GWT-compliant parser, and I was planning to eventually make this
> plugin available to public. If we can fine-tune config parameters for
> each grammar, it would enable merging the two plugins together. On the
> other hand, the grammar file already contains some parameters that
> belong to configuration, such as package name, and if Etienne
> continues going that route, configuration won't be necessary.
>
> Regards,
> Alexander
>
> --
> -- You received this message because you are subscribed to the
> SableCC group. To post to this group, send email to
> sab...@googlegroups.com. To unsubscribe from this group, send email
> to sablecc+u...@googlegroups.com. For more options, visit this
> group at https://groups.google.com/d/forum/sablecc?hl=en [2]
> ---
> You received this message because you are subscribed to the Google
> Groups "SableCC" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to sablecc+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out
> [3].
>
>
>
> Links:
> ------
> [1]
> http://maven.apache.org/guides/mini/guide-central-repository-upload.html
> [2] https://groups.google.com/d/forum/sablecc?hl=en
> [3] https://groups.google.com/groups/opt_out

Etienne Gagnon

unread,
Feb 20, 2013, 7:46:23 AM2/20/13
to sab...@googlegroups.com
Hi Hong Phuc, Gonzalo, Alexander, Lucas, and Peter,

OK, I've read your messages. What would you want me to do to help you setting up Maven for SableCC 3.7? What approval should I give you? I am really willing to help, but I do not want to have to learn about the Maven stuff; I really want to leave that stuff to you.

Restriction: The current svn repository for SableCC 3.x cannot be made public. (I do not really want to waste time arguing about this: it is a messy situation because the repository contains code unrelated to SableCC which shouldn't be made public). If absolutey necessary, I can start a new Git repository with from a SableCC 3.7 snapshot. (The code in that repository would have to be rebased once the complete history is reconstructed[*]).

If I understand well, eventually, for SableCC 4, things will be much simpler, as the code is already in a Git repository published on GitHub.

So, what do I have to do or what approval should I give?

Thanks!

Etienne
[*] It is my intention to publish the complete SableCC 3.x history in a Git repository. So far, I have reconstructed the history up to version 2.13 (see http://sablecc3.sablecc.org/log/). As the history spans across various source control systems (PRCS, CVS, Subversion), it is not a simple task to do. In particular, CVS did not have a clean concept of project-wide commits. Also, I do not want to reconstruct an approximate history, as I would get using some existing repository migration scripts.

Etienne Gagnon, Ph.D.
http://sablecc.org
On 2013-02-20 04:52, Lucas Satabin wrote:
Hi All,

It seems that my old address cannot write to the list without moderation.
I just wanted to say that it is quite easy now to publish to the maven central repository.
The new guidelines are here [1]

Every project can be published to the central repository, no matter where it is hosted (I published several of my projects there that are all hosted on github)
For the ownership of the project, it is probably best to have the approval of the author to avoid potential conflicts even if I cannot remember of any constraint on this from sonatype.
[...]

Lucas

unread,
Feb 20, 2013, 8:34:57 AM2/20/13
to sab...@googlegroups.com
Hi Etienne,

Well, I guess it is sufficient that we know you agree with somebody else publishing sablecc into maven central repository, what you just did :)
It is also easier (from the sonatype and permissions on repository point of view) if only one person is responsible for publishing it.
I guess the groupId is/will be "org.sablecc" (if you agree with the use of this namespace for projects related to sablecc...), one just has to file a ticket on sonatype's JIRA to ask for its creation if it does not already exist (which seems to be the case). Then this person will be able to publish any project under this groupId (sablecc as library, sablecc maven plugin, objectmacro maven plugin, ...).

It is probably what Hong Phuc planned to do?

Regards,
Lucas


2013/2/20 Etienne Gagnon <ega...@j-meg.com>

Hong Phuc Bui

unread,
Feb 20, 2013, 9:01:29 AM2/20/13
to sab...@googlegroups.com
Hi Lucas,
I don't have plan to publish sablecc library in the central maven repository.
I just plan to publish my maven plugins in the maven central repository (instead of github repository),
and improve them. But I don't have time to
maintain other artifacts. I think it is relative fast to publish an artifact in mvn central repository.
But it needs time to maintain the artifact and someone must update it.

I think man uses usually in large organization an internal maven repository to re-distribute libraries, which
the authors do not provide a POM. (like artifactory or sonatyp's nexus). We use artifactory and have no
need of a distribution of sablecc in the central maven repository. We just put the sablecc-3.7.jar into our
artifactory server. Every member in our tearm use the artifactory server as "the central", which is easy and quick to archive by modifying the ~/.m2/setting.xml to override the central repository's URL.
And we are really happy with this solution.

Best wish.
Hong Phuc

Peter A. LaValle

unread,
Feb 20, 2013, 10:46:44 AM2/20/13
to sab...@googlegroups.com
I tried (for about 45 minutes) to scrape it ... I think that the scraping works, but my grammar / the old plugin aren't liking SableCC 3.7

Does anyone have an example grammar? I keep getting a NullPointerException
> Caused by: java.lang.NullPointerException
>         at org.sablecc.sablecc.MacroExpander.apply(MacroExpander.java:76)
>         at org.sablecc.sablecc.GenUtils.createInvalidToken(GenUtils.java:173)
>         at org.sablecc.sablecc.GenUtils.outStart(GenUtils.java:80)
>         at org.sablecc.sablecc.analysis.DepthFirstAdapter.caseStart(DepthFirstAdapter.java:36)
>         at org.sablecc.sablecc.node.Start.apply(Start.java:37)
>         at org.sablecc.sablecc.SableCC.processGrammar(SableCC.java:263)



Etienne Gagnon

unread,
Feb 20, 2013, 10:52:06 AM2/20/13
to sab...@googlegroups.com
Hi Peter,

This looks like missing *.txt files in package org/sablecc/sablecc. Are
you using an official sablecc.jar or one that you have reconstructed?

Etienne

Etienne Gagnon, Ph.D.
http://sablecc.org

Peter A. LaValle

unread,
Feb 20, 2013, 11:08:46 AM2/20/13
to sab...@googlegroups.com
Hello Etienne


I'm using a reconstructed jar*

The plugin was putting the .txt files (and the .java files) in the wrong folder ... rather embarrassing. It "works for me" now.

I'll see if I can fork the CodeHaus Maven Plugin to use the reconstructed jar ...



(*the degen plugin works by extracting .java files from a zip file, and telling Maven they're generated sources)


--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Bui Hong Phuc

unread,
Feb 21, 2013, 4:02:00 PM2/21/13
to sab...@googlegroups.com
Hi all,
I had not yet try to publish the plugins in the central maven repository, just only read some doc. I'll try it
in this weekend.

Etienne, could you please make a "facade" method in the class SableCC? I explain it below.

During I has tried to integrate the SableCC with some external system like Netbeans and Maven, I have found that
the method "SableCC.main(String[] argv)" does not throw any exceptions but just call System.exit(1) to tell
the user that something is wrong in the grammar file(s) or arguments.

If I call this method in maven as a plugin,
the maven process just quits silently. Of course the error message is printed in screen, but I cannot get the error
programmatically any make some convenient task, for example print "BUILD FAIL"  on screen, throw
Mojo exception to tell maven process that the build was not success, ect.

In Netbeans I could not get any info that the build  was fail or success and therefore I could not change the status
text in the status bar.

So in both cases I used the method SableCC.processgrammar(String file, String directory). It throws exceptions
to signal that something was wrong. I can catch them and do necessary task. But with this method
I cannot set the options  "--inline-max-alts" and some others. Since they are private I can access them through
the method main(String[] argv).

I think the implementation in the class ObjectMacro.java /SableCC.java version 4 is more extensible. I can use the method
 public static void compile(String[] arguments)/processCommandLine(String[] arguments) to compile the files with options,
catch exceptions and write the appropriate tasks for each exceptions in each system, like Netbeans or Maven.

I hope my explain is not so complex and understandable.

Best Wish,
Hong Phuc.

Bui Hong Phuc

unread,
Feb 21, 2013, 4:50:52 PM2/21/13
to sab...@googlegroups.com
Hi Peter,
ObjectMacro is a template framework to generate codes from template. More about can be found here:
http://sablecc.org/wiki/ObjectMacro

I use it to generated SQL code for each Database and I'm quite happy. It is shipped with SableCC 4. You don't
need it if you just want a parser generator.

The Maven SableCC plugin is just for SableCC, nothing relevant with ObjectMacro. For ObjectMacro there is other plugin.

Best Wish,
Hong Phuc

On 02/21/2013 10:32 PM, Peter A. LaValle wrote:
Hello,

    I use SableCC to generate the parser for compilers.
    I do not know what ObjectMacro would do in a project built with Maven.

    What do you use it for?

Peter

Etienne Gagnon

unread,
Feb 21, 2013, 5:57:35 PM2/21/13
to sab...@googlegroups.com
Hi Hong Phuc,

Yes, I will work on it.

Thanks for your contribution to the project,

Etienne

Etienne Gagnon, Ph.D.
http://sablecc.org
Le 2013-02-21 16:02, Bui Hong Phuc a écrit :
[...]

Etienne, could you please make a "facade" method in the class SableCC? I explain it below.

During I has tried to integrate the SableCC with some external system like Netbeans and Maven, I have found that
the method "SableCC.main(String[] argv)" does not throw any exceptions but just call System.exit(1) to tell
the user that something is wrong in the grammar file(s) or arguments.

If I call this method in maven as a plugin,
the maven process just quits silently. Of course the error message is printed in screen, but I cannot get the error
programmatically any make some convenient task, for example print "BUILD FAIL"  on screen, throw
Mojo exception to tell maven process that the build was not success, ect.

In Netbeans I could not get any info that the build  was fail or success and therefore I could not change the status
text in the status bar.

So in both cases I used the method SableCC.processgrammar(String file, String directory). It throws exceptions
to signal that something was wrong. I can catch them and do necessary task. But with this method
I cannot set the options  "--inline-max-alts" and some others. Since they are private I can access them through
the method main(String[] argv).

I think the implementation in the class ObjectMacro.java /SableCC.java version 4 is more extensible. I can use the method
 public static void compile(String[] arguments)/processCommandLine(String[] arguments) to compile the files with options,
catch exceptions and write the appropriate tasks for each exceptions in each system, like Netbeans or Maven.
[...]

Bui Hong Phuc

unread,
Feb 23, 2013, 6:06:10 PM2/23/13
to sab...@googlegroups.com
Hi Maven fans, and not fans
I've released new maven plugin in my github repo. THe configuration is
improved
like sugession from Gonzalo. Thanks you. The plugin is now smaller,
maybe faster
if I can fork the execute-tag to compile more than once grammar each times.

And it was signed with gpg by ... me.

I've even try to publish my plugins in sonatype (maven central), but I
must wait
some days for and ID or ticket or whatever, so that I has a access to
the repos.
(I'm not sure, I think so).

So, have a nice weekend.

Bui Hong Phuc

unread,
Feb 23, 2013, 6:07:36 PM2/23/13
to sab...@googlegroups.com
Hi Etienne,
tell me when you are finish and I'll upgrade the plugins.
Thank you.
Hong Phuc

Gonzalo Ortiz Jaureguizar

unread,
Feb 25, 2013, 4:18:04 AM2/25/13
to sab...@googlegroups.com
Great news!

Thank you!


2013/2/24 Bui Hong Phuc <phuc...@gmail.com>
Hi Maven fans, and not fans
I've released new maven plugin in my github repo. THe configuration is improved
like sugession from  Gonzalo. Thanks you. The plugin is now smaller, maybe faster
if I can fork the execute-tag to compile more than once grammar each times.

And it was signed with gpg by ... me.

I've even try to publish my plugins in sonatype (maven central), but I must wait
some days for and ID or ticket or whatever, so that I has a access to the repos.
(I'm not sure, I think so).

So, have a nice weekend.

On 02/20/2013 11:21 AM, Gonzalo Ortiz Jaureguizar wrote:
Well... people who use maven use it because it is simple and standard. I don't think that use strange ways like donwload the library from other place is a good idea.

I can't talk for other SableCC users, but the thing I want is to have an standard plugin in mvn repositories, write a simple xml section and download all necesary libraries automatically. I already wait for it a lot of months, I think I can wait a some more.

--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+unsubscribe@googlegroups.com.

Phuc Luoi

unread,
Mar 5, 2013, 8:47:43 AM3/5/13
to sab...@googlegroups.com
Hi Gonzala,

can you upvote my plugin in central repo, so that is can be published in mvn central repo?
https://issues.sonatype.org/browse/OSSRH-5488?focusedCommentId=181601#comment-181601
You need to registry.


On Monday, February 25, 2013 10:18:04 AM UTC+1, Gonzalo Ortiz Jaureguizar wrote:
Great news!

Thank you!


2013/2/24 Bui Hong Phuc <phuc...@gmail.com>
Hi Maven fans, and not fans
I've released new maven plugin in my github repo. THe configuration is improved
like sugession from  Gonzalo. Thanks you. The plugin is now smaller, maybe faster
if I can fork the execute-tag to compile more than once grammar each times.

And it was signed with gpg by ... me.

I've even try to publish my plugins in sonatype (maven central), but I must wait
some days for and ID or ticket or whatever, so that I has a access to the repos.
(I'm not sure, I think so).

So, have a nice weekend.

On 02/20/2013 11:21 AM, Gonzalo Ortiz Jaureguizar wrote:
Well... people who use maven use it because it is simple and standard. I don't think that use strange ways like donwload the library from other place is a good idea.

I can't talk for other SableCC users, but the thing I want is to have an standard plugin in mvn repositories, write a simple xml section and download all necesary libraries automatically. I already wait for it a lot of months, I think I can wait a some more.

--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en

--- You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.

Peter A. LaValle

unread,
Mar 5, 2013, 8:52:15 AM3/5/13
to sab...@googlegroups.com
I have an alternative, already in central;

It works as-expected I think
<build>
    <plugins>
        <plugin>
            <groupId>com.peterlavalle</groupId>
            <artifactId>sablecc-maven-plugin</artifactId>
            <version>3.7</version>

            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>


You received this message because you are subscribed to a topic in the Google Groups "SableCC" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sablecc/SmACbelVDfQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to sablecc+u...@googlegroups.com.

Gonzalo Ortiz Jaureguizar

unread,
Mar 5, 2013, 9:55:52 AM3/5/13
to sab...@googlegroups.com
How many plugins are we going to have? ^_^

Today we have almost 3 different plugins in central (the older one, the Peter's and the Phuc's)... what is going to happend if tomorrow all plugins are peter and phuc abandon their plugins? Are we going to have to wait until someone develop a new plugin and we are going to change our pom to use it (maybe with a different interface)?

I really think that it should be good for the SableCC project to have only one plugin under the umbrella of org.sablecc group id, approved by the community and mantained by someone who is close to the project.

A SableCC Maven Plugin is just one simple Java class and one pom.xml file. It is very easy to maintain if the community has access to the repositories and Etienne (or someone close to SableCC project) is the person who upload it in central repositories.

2013/3/5 Peter A. LaValle <peter....@gmail.com>

Hong Phuc Bui

unread,
Mar 5, 2013, 10:08:25 AM3/5/13
to sab...@googlegroups.com
Hi,
my plugin is not yet in central, and as I said, I will maintain my plugin as long as the SableCC 3.x lives.
I want to publish my plugin in maven central because somebody think it could be useful, but if it is
not so, I think I don't need to publish it in central maven. My github repository is really OK for my demand.

I don't think it is a good idea to "enforece" Etienne or some else to maintain code from other people.

Peter A. LaValle

unread,
Mar 5, 2013, 10:19:14 AM3/5/13
to sab...@googlegroups.com
Phuc responded faster than me. We're seeing (in essence) the problem with porting a project to Maven (or any platform / tool) There isn't an "official" version, just everybody sharing what works for them

I'm in central now, with 3.7 and only have the CodeHause design. If I get hit by a bus (or whatever) someone else should be able to use my (or Phuc's) project as a stepping stone to build a 4.0 version. (update groupIds, change URLs)
I really don't understand what the ObjectMacro plugin does ... sorry. I haven't made any effort to read it or understand it

If Etienne / SableCC.org wants to officially bless one plugin or the other, changing the groupId to read "sablecc.org" isn't very hard. If they choose Phuc's I'll keep my mouth shut ;)

Gonzalo Ortiz Jaureguizar

unread,
Mar 5, 2013, 10:36:22 AM3/5/13
to sab...@googlegroups.com
I don't want to enforce to Etienne to maintain code from other people. But I think Maven has an impressive support for automatic source generation and it is, with difference, the best way to use SableCC or any other compiler compiler. So it could be great and, in my opinion, very important, to have oficial support. I belive that the maintain cost is going to be almost priceless and it should be very productive.

Etienne don't want to do it and I understand him. I work in academic world and it is normal to not invest time in support task. But in this case it is an very easy work with a lot of beneficial points.

Michael Mast

unread,
Mar 6, 2013, 3:07:36 PM3/6/13
to sab...@googlegroups.com

I tend to agree.  And there is some precedence for this within the SableCC project.  SableCC does have a class (classes?) to make SableCC appear as an Ant task, so why not one for Maven?

Bui Hong-Phuc

unread,
Mar 9, 2013, 7:37:34 AM3/9/13
to sab...@googlegroups.com
So,
I've successfully released the plugin and a redistribution of SableCC
3.7 in Maven-like style
in Sonatype. The plugin needs the sablecc 3.7 to perform sablecc phase.
You can, however
use sablecc like a library if you like.
I must wait for some time, so that the plugin is synced in central maven
repository. For people
who want to test them, I've wrote a small example of setting.xml here:
https://github.com/verylazyboy/sablecc-maven-plugin/blob/master/samplesetting.xml
This setting should not need later, when the the artifacts in sonatype
are synced with the
maven central repo.

To Peter:
I don't think mine or yours are better. I think open source should be
colorful and
versatile. I just do what I can.

Best Wish and have a nice weekend
Hong Phuc

PS: For people, who are care about security: Because of an error (my
error) the user name in
the artifacts does not match 100% to my name. My first name is Hong Phuc
and family name
is Bui. In the repo they are Hong and Phuc Bui.
Reply all
Reply to author
Forward
0 new messages