[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minibasic-1.0 build fails

james@spunkysoftware.com wrote:
> As for my problem, I got Ant installed and working OK. All this XML stuff is
> foreign to me. I confess that I'm a little disappointed that SableCC appears
> to rely on it. It's a good tool, but it complicates things somewhat, for
> newbies at least. Maybe it's really worth putting in the effort from the
> beginning. Maybe SableCC doesn't rely on Ant, but I don't see any
> instructions for using SableCC without it.

If you downloaded the sablecc-x.y.z.tar.gz file, then you should have
found /lib/sablecc.jar already compiled, and ready to put on your
classpath (or wherever you want).  Maybe we should make this clearer in
the installation instructions.

> I've logged all the problems I've had so far for my newbies manual I will
> give to the SableCC project, with answers and how I resolved things,
> including installing and getting Ant working.


> I get an error from Ant:
> C:\sablecc\grammars\minibasic-1.0\build.xml:44: Class
> org.sablecc.ant.taskdef.Sablecc doesn't support the "withtools" attribute

I think this is a bug that Raif Naffah has just fixed.  (This is new,
less tested stuff...)

> I tried editing the file and changing withtools to withtools="off" but I
> just get the same error. Why can't I just change it to withtools="off" ? And
> what are these tools?

These tools are a : pretty printer, a graphical tree view display of the
AST, etc.  Very handy for new programmers that want to get a better idea
of the AST...

>  <property name="build.compiler" value="jikes"/>
> I don't have jikes on my machine. Can I just change it to javac?

You could comment this line and "javac" would be used by default.  I am
unsure of which compiler we should recommend by default: many people
will simply have the JDK installed, but on the other hand, Jikes is open
source, and it would be nice to encourage people to use it, too (and it
is so much faster than javac;-)...

try this:

<!--property name="build.compiler" value="jikes"/-->

> <target name="changelog" description="regenerates the change log">
>     <exec executable="cvs2cl" dir="${basedir}">
>       <arg line="--utc -g -z9 -F TRUNK -S -W 3600 --usermap
> ChangeLog.usermap -I ChangeLog"/>
>     </exec>
>   </target>
> I have no executable called "cvs2cl" on my machine. Can I just comment it
> out?

This is for maintainers.  Ignore this.  [I might at some point go the
other mile and generate custom "distribution" build.xml files without
the maintainer stuff in them.  I'm just short on time these days.]

> Line 28 or thereabouts:
>   <property name="classpath" value="../sablecc/lib/sablecc.jar"/>
> Can I just comment this out? I've already put sablecc.jar on my classpath in
> my autoexec.bat.

Why do you want to comment all these out?  Just don't use them when you
don't need them...

> 2.    Add .java source files, such as the Intepreter, Main class, code
> generator or whatever. Are these the ONLY sources that need to be added? Is
> there any editing to do in /node, /analysis, or whatever?

In fact, the withTools thingy generates a complete, ready to compile and
run program.  This stuff is quite new, and has no other documentation
than the messages about it in the mailing-list archive.

> 3.    Write a build.xml file and stick it in the root directory. Can I find
> out more about build.xml and how to write one generically, if you know what
> I mean, in the Ant docs? Is this what is called the Ant API?

This is only necessary if you want to use Ant for your own project
(which is a good idea). 

> 4.    Run Ant
> 5.    Anything else?

In fact 1 & 2 are the necessary conditions (run sablecc, add a main
class if you didn't use the withTools, compile, and run).

3, 4 & 5 are for Ant users (recommended, as it is convenient for
automatically compiling then packaging files into a .jar file all in a
single command).  You will notice that the start overhead of generated
parsers is much lower when you run your application from a .jar file.

> Thanks for your time guys! By the way I'm telling Richard Stallman about
> SableCC. I will do that when I have a project built with SableCC that I can
> use to show off and impress him (hopefully!) In any case I'll have SableCC
> added to the Free Software Directory if it isn't there already (I'll check
> now) and get some docs put in with GCC-java, since I think this will be a
> good thing for java programmers to know about generally even if they don't
> have needs for a compiler compiler as such. I want to find out how to build
> EXEs of compilers and interpreters built with SableCC using GCC-java on UNIX
> and Visual J++ on Win32. Wish me luck.

Good luck! :)

Etienne M. Gagnon                                    egagnon@j-meg.com
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/