1=head1 NAME 2 3design.pod - ANTLR::Runtime Design Document 4 5=head1 ABSTRACT 6 7This document describes the design of the C<ANTLR::Runtime> Perl 5 port. 8 9=head1 OVERVIEW 10 11C<ANTLR::Runtime> is the port of the runtime part for ANTLR to Perl 5. ANTLR's 12primary target language is Java. This port tries to mimic this implementation 13very closely, which hopefully makes it easier to port. The parts visible to 14Perl users should be perlish if possible - at least as a secondary interface. 15 16=head1 Basic Porting Considerations 17 18Java is built on two basic concepts: Objects and Exceptions. If there's a 19good match for those features most other things should fall into place. 20 21=head2 OO 22 23C<ANTLR::Runtime> uses C<Object::InsideOut> for OO modelling. 24 25=head3 Packages 26 27The Java package C<org.antlr.runtime> maps to the Perl 5 package 28C<ANTLR::Runtime>. 29 30=head3 Classes 31 32Each Java class maps to a Perl 5 class with the same name. 33 34=head2 Exceptions 35 36C<Exception::Class> should meet our needs and is used by C<Object::InsideOut> 37too. 38 39=head2 Types 40 41Here's a list of Java types and how they should map to Perl. 42 43=over 44 45=item byte, short, int, long, float, double, String 46 47Use a Perl scalar. 48 49=item C<java.util.List> 50 51Use a reference to a Perl array. 52 53=item C<java.util.Map> 54 55Use a reference to a Perl hash. 56 57=back 58 59=head1 SEE ALSO 60 61L<http://www.antlr.org/> 62 63 64=head1 AUTHOR 65 66Ronald Blaschke (ron@rblasch.org) 67