Home | History | Annotate | Download | only in zero-one
      1 #!/usr/bin/perl
      2 
      3 use blib;
      4 
      5 use English qw( -no_match_vars );
      6 use ANTLR::Runtime::ANTLRStringStream;
      7 use TLexer;
      8 
      9 use strict;
     10 use warnings;
     11 
     12 my $input = ANTLR::Runtime::ANTLRStringStream->new({ input => '010' });
     13 my $lexer = TLexer->new($input);
     14 
     15 while (1) {
     16     my $token = $lexer->next_token();
     17     last if $token->get_type() == $TLexer::EOF;
     18 
     19     print "type: ", $token->get_type(), "\n";
     20     print "text: ", $token->get_text(), "\n";
     21     print "\n";
     22 }
     23