Netbeans and EOF

Posted by sqlnoob on Stack Overflow See other posts from Stack Overflow or by sqlnoob
Published on 2010-06-12T16:06:43Z Indexed on 2010/06/12 16:13 UTC
Read the original article Hit count: 460

Filed under:
|
|
|

Hey there,

Java, ANTLR and Netbeans newbie here.

I have installed a jdk and netbeans. I started a new project on netbeans 6.8 and i have added the antlr-3.2.jar as a library. I also created a lexer and parser class using AntlrWorks. These classes are named ExprParser.java and ExprLexer.java. I copied them into a directory named path-to-netbeans-project/src/parsers.

I have a main file:

package javaapplication2;

import org.antlr.runtime.*;
import parsers.*;

public class Main {

    public static void main(String[] args) throws Exception{

        ANTLRInputStream input = new ANTLRInputStream(System.in);
        ExprLexer lexer = new ExprLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        ExprParser parser = new ExprParser(tokens);
        parser.prog();

    }

}

The application builds fine. The book I'm reading says I should run the program and type in some stuff and then press Ctrl+Z (I'm on windows) to send EOF to the console. Problem is that nothing happens when I press Ctrl+z in the netbeans console. When I run from the command line, ctrl+z works fine.

This is probably WAY too much information, but I can't figure it out. Sorry. Probably not a good idea to learn 3 new technologies at once.

© Stack Overflow or respective owner

Related posts about java

Related posts about netbeans