Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / March 2006



Tip: Looking for answers? Try searching our database.

Tokenizing and parsing files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James Reynolds - 06 Mar 2006 22:55 GMT
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?

--

Thanks,

James Reynolds
University of Utah
Student Computing Labs
james@scl.utah.edu
801-585-9811
David Ledger - 07 Mar 2006 06:27 GMT
>Over the weekend I tried to find the most elegant solution to
>tokenizing and parsing POV-Ray scene files, which uses a c-like
[quoted text clipped - 5 lines]
>
>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

Signature

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

Dominic Dunlop - 07 Mar 2006 15:20 GMT
> Over the weekend I tried to find the most elegant solution to  
> tokenizing and parsing POV-Ray scene files, which uses a c-like  
[quoted text clipped - 5 lines]
>
> Does anyone have any opinions on tokenizing and parsing files?

There's more than one way to do it, of course. But a popular Perl  
module is Parse::RecDescent. You'll have to install it yourself, as  
it's not part of the Perl core distribution. If you have not done  
this before, see the  perlmodinstall  man page.

There's a tutorial for Parse::RecDescent at <http://www.perl.com/pub/
a/2001/06/13/recdecent.html>.
Signature

Dominic Dunlop

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.