package duplication in SableCC/Eclipse

37 views
Skip to first unread message

Steve Kelem

unread,
Oct 3, 2012, 8:04:04 PM10/3/12
to sab...@googlegroups.com
I'm trying to use a sablecc parser in a project. The generated files appear to be placed in the wrong directory.
I tried to put the parser at the right level in my project:

Package com.mydomain.waves.vcd;

However, when I run sablecc, it generates files in:

com.mydomain.waves.com.mydomain.waves.vcd

The header inside the generated file has the proper hierarchy.

The configuration for SableCC Compiler includes:
Working Directory: ${container_loc}
Arguments: -classpath /opt/sablecc/latest/lib/sablecc.jar org.sablecc.sablecc.SableCC ${resource_name}

This configuration works for the example design in the tutorial, http://www.comp.nus.edu.sg/~sethhetu/rooms/Tutorials/EclipseAndSableCC.html

Thanks for any help you can give,
Steve

Phuc Luoi

unread,
Oct 4, 2012, 10:28:21 AM10/4/12
to sab...@googlegroups.com
In My Project i put the SableCC file in the top directory of the source directory. Somehow:
src
 |-- gramma.sablecc
 |-- org.yourorgranisation.yourproject
     |-- JavaClasse.java


Then I call the SableCC with argument, which have absolute path from src. It works in linux well. I have ever tried in
Windows or eclipse plugin.


 
 


--
-- 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
 
 

Etienne Gagnon

unread,
Oct 5, 2012, 3:55:20 PM10/5/12
to sab...@googlegroups.com
Another solution is to use the "-d" (for destination) command-line option.
sablecc mygrammar.sablecc -d path/to/root/of/hierarchy
The argument should point to the root directory of your source file hierarchy.

Have fun,

Etienne
Etienne Gagnon, Ph.D.
http://sablecc.org
On 2012-10-04 10:28, Phuc Luoi wrote:
In My Project i put the SableCC file in the top directory of the source directory. Somehow:
[...]
Reply all
Reply to author
Forward
0 new messages