Hi,

I tried using the debugger you sent. But at the 

", text : [" + token.getText() + "]");

portion, I get a java null pointer error..

The string I am passing is 

String expression="//users[login/text()='" + login + "' and password/text()='" 
+ password + "']/id/text() ";

Can it support this type of string?





----- Original Message ----
From: Etienne M. Gagnon <[EMAIL PROTECTED]>
To: Discussion mailing list for the SableCC project 
<[email protected]>
Sent: Sunday, August 3, 2008 4:38:04 PM
Subject: Debug Lexer [Was: ParserException: [1,1] expecting: EOF]

 Hi Lola,

You should first make sure that your lexer behaves as you expect it to
do. Often, errors in the lexer specification lead to syntax errors. Try
a custom debug lexer such as:

class PrintLexer extends Lexer
{
  PrintLexer(PushbackReader reader)
  {
    super(reader);
  }

  protected void filter()
  {
    System.out.println(token.getClass() +
                       ", state : " + state.id() +
                       ", text : [" + token.getText() + "]");
  }
}


Have fun!

Etienne

Lola Oluyomi a écrit : 
Thanks. It works for me as well from command prompt. i.e the
parser and other files are generated.

However, when I try to parse an expression  (from netbeans or command
prompt), I get the error:
[...]


-- 
Etienne M. Gagnon, Ph.D.
SableCC:                                            http://sablecc.org
SableVM:                                            http://sablevm.org 


      
_______________________________________________
SableCC-Discussion mailing list
[email protected]
http://lists.sablecc.org/listinfo/sablecc-discussion

Reply via email to