develooper Front page | perl.macosx | Postings from March 2006

Re: Tokenizing and parsing files

From:
David Ledger
Date:
March 7, 2006 03:52
Subject:
Re: Tokenizing and parsing files
Message ID:
a06100525c032d7247849@[192.168.0.7]
At 15:55 -0700 6/3/06, James Reynolds wrote:
>Over the weekend I tried to find the most elegant solution to 
>tokenizing and parsing POV-Ray scene files, which uses a c-like 
>scripting language.  I came to the conclusion that there are many 
>solutions out there, but in trying to understand them it seems 
>easiest (and take as much time to implement) if I just wrote my own. 
>(I've never studied lexical analysis, but I understand the basic 
>concepts).
>
>Does anyone have any opinions on tokenizing and parsing files?

OSX includes the Unix tools 'lex' and 'yacc' for building compilers 
for your own language. You define the structure of the language you 
want to work with, and 'lex' generates an analyser for it.


David

-- 
David Ledger - Freelance Unix Sysadmin in the UK.
Chair of HPUX SysAdmin SIG of hpUG technical user group (www.hpug.org.uk)
david.ledger@ivdcs.co.uk
www.ivdcs.co.uk



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About