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