Re: JCUP Termination

Marat Boshernitsan <maratb@CS.Berkeley.EDU>
18 Dec 2000 12:15:19 -0500

          From comp.compilers

Related articles
JCUP Termination (Nitin Kumar Goel) (2000-12-18)
Re: JCUP Termination maratb@CS.Berkeley.EDU (Marat Boshernitsan) (2000-12-18)
| List of all articles for this month |

From: Marat Boshernitsan <maratb@CS.Berkeley.EDU>
Newsgroups: comp.compilers
Date: 18 Dec 2000 12:15:19 -0500
Organization: University of California at Berkeley
References: 00-12-071
Keywords: Java, lex
Posted-Date: 18 Dec 2000 12:15:19 EST

Nitin Kumar Goel <> writes:

> I am having difficulty getting JCUP (with a JLex Lexer) to terminate
> when reaching an EOF. Instead it throws a
> Java.lang.NullPointerException exception.

The trick is to do the right thing on EOF in the lexer (the default
action is to return null, hence the exception). Look up %eofval in the
Jlex manual.

Marat Boshernitsan.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.