[antlr-interest] Re: PERL VS ANTLR

sudip mitra s_mitra8 at yahoo.com
Wed Jan 29 14:53:07 PST 2003


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 jguru.com> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20030129/dfb4c7b4/attachment.html


More information about the antlr-interest mailing list