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

Re: minor annoyance



> What became of the suggestion below.
> Do you plan on doing this ? Otherwise I'll modify the main in SableCC to do
> it (it's straightforward, you can even use gnu getopt java package to have
> finer option support)

Agree with you, it's rather simple to do.  Give me a few days, and I'll
do it.  

> The constructor in LexerException should be public. I subclass the generated
> Lexer to overwrite filter(). My subclass is by choice not in the lexer
> package. I want to be able to throw LexerExceptions.

As you wish;-)

Meanwhile, you can do the modifications locally on your own copy of
SableCC, so that you can get on with your work.

Here's what you can do:
(1) [ugly, but effective] hard code your path in ca/.../SableCC.java:

  dir = new File(in.getParent());

Change it to:

  dir = new File("/your/custom/path");

(2) modify ca/.../lexer.txt

...
Macro:LexerException
...
public class LexerException extends Exception
{
/*** ADD "public" in the following line ***/
    public LexerException(String message)
...

Have fun!

Etienne
-- 
----------------------------------------------------------------------
Etienne M. Gagnon, M.Sc.                     e-mail: egagnon@j-meg.com
Author of SableCC:                 http://www.sable.mcgill.ca/sablecc/
----------------------------------------------------------------------