Esempio n. 1
0
    static void Main(string[] args)
    {
        CSharpLexer lexer = new CSharpLexer(new StringReader(program));

        antlr.IToken token = null;
        while ((token = lexer.nextToken()).Type != CSharpLexer.EOF)
        {
            Console.WriteLine("Token: '{0}', Type: {1}.",
                              token.getText(),
                              TokenClassification.Instance.getTokenType(token.Type)
                              );
        }
    }
Esempio n. 2
0
        public IToken nextToken()
        {
            //string s = lexer.getFilename();

            return(lexer.nextToken());
        }