[antlr-interest] Re: PERL VS ANTLR

cintyram <cintyram at yahoo.com> cintyram at yahoo.com
Wed Jan 29 15:52:20 PST 2003


i am sure perl can be used for this ..
you simply have to match every thing between  a specified number of
slashes .. doesnt matter even if it is a newline ;
also perl allows you to red the whole file as one string ;
and you can do such gymnastics;
ofcourse it is  easy to write an antlr grammar for this too; 
are you just comparing or really trying to solve the problem ?
cheers
ram

--- In antlr-interest at yahoogroups.com, sudip mitra <s_mitra8 at y...> wrote:
> 
> I had this data format for a text file director/ age /title
/remuneration in one part of the file ... here is the interesting part :
> donald / 34/ ceo,cfo, this,that / $4578900 
> mcdonald/67/
titles......................................................titles
........still more titles/ $567888
> the first one  is a nice line delimited very well with '/'  and so
easy pickings by simple file i/o
> the second line which follows it and occupies the next line for the
same format... this is the problem ..so can perl solve this ??? or
ANTLR is better ...(I am not using it as a language blah blah ....:-)  )
>  
>  Terence Parr <parrt at j...> wrote:
> On Wednesday, January 29, 2003, at 11:10 AM, cintyram 
> wrote:
> 
> > you are right, and i stand corrected ;
> > my answer was not comprehensive enough to state that antlr does not
> > support all cfgs but only predicated LL ; on the other hand , though i
> > must admit to my being not the expert on this, LR grammars can be
> > represented by an equivalent LL grammar ;
> > i remember having done some exercises on this in the compiler theory
> > class ;
> 
> Actually LR(k) is only as strong as LL(k) if you put actions on the 
> left-edge of every production, forcing the LR parser to know where it's 
> at on the left-edge just like an LL(k) parser.
> 
> The thing to remember is that all languages are "turing complete" so 
> can implement pretty much anything, however, you should focus on 
> efficiency of expression. ANTLR is a domain-specific language designed 
> to make building parsers/translators easier. PERL for the most part 
> makes you implement parsers by hand. Also, isn't PERL optimized to 
> work on a line-by-line basis? Can it easily match an HTML tag, for 
> example, spanning 5 lines?
> 
> Ter
> --
> Co-founder, http://www.jguru.com
> Creator, ANTLR Parser Generator: http://www.antlr.org
> Lecturer in Comp. Sci., University of San Francisco
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/ 
> 
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list