[antlr-interest] [v3] creating shell for interpreter

Fırat KÜÇÜK pismikrop at gmail.com
Tue Sep 26 05:32:50 PDT 2006


ok i found,

import java.io.*;
import org.antlr.runtime.*;
import org.antlr.tool.*;

public class Main {

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

            BufferedReader in = new BufferedReader(new InputStreamReader(
System.in));

            while (true) {
                System.out.print(">>> ");
                CharStream           input  = new ANTLRStringStream(
in.readLine());
                SomeLexer            lexer  = new SomeLexer(input);
                CommonTokenStream    tokens = new CommonTokenStream(lexer);
                SomeParser           parser = new SomeParser(tokens);
                parser.start();
        }
    }
}

26.09.2006 tarihinde Fırat KÜÇÜK <pismikrop at gmail.com> yazmış:
>
> Hi,
>
> i created a simple interpreter.
>
> CharStream        input  = new ANTLRInputStream(new DataInputStream(
> System.in));
> SomeLexer         lexer  = new JavyLexer(input);
> CommonTokenStream tokens = new CommonTokenStream(lexer);
> SomeParser            parser = new JavyParser(tokens);
> parser.start();
> But interpreter evaluates commands only one time. I want to create a
> continuous shell.
> What should i do?
>
> --
> Öğr. Gör. Fırat KÜÇÜK
> ADAMYO Distance Learning
> SAKARYA University / TURKEY




-- 
Öğr. Gör. Fırat KÜÇÜK
ADAMYO Distance Learning
SAKARYA University / TURKEY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060926/f48b9672/attachment-0001.html 


More information about the antlr-interest mailing list