1 #!perl 2 3 use strict; 4 use warnings; 5 6 use ANTLR::Runtime::ANTLRFileStream; 7 use ANTLR::Runtime::TokenRewriteStream; 8 use TLexer; 9 use TParser; 10 11 my $input = ANTLR::Runtime::ANTLRFileStream->new({ file_name => $ARGV[0] }); 12 my $lexer = TLexer->new({ input => $input }); 13 my $tokens = ANTLR::Runtime::TokenRewriteStream({ token_source => $lexer }); 14 my $parser = TParser->new({ input => $tokens }); 15 $parser->program(); 16 print "$tokens\n"; 17