Re: [Fwd: [linux-audio-dev] Command parser?]

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [Fwd: [linux-audio-dev] Command parser?]
From: Erik Steffl (esteffl_AT_pbi.net)
Date: Wed Aug 23 2000 - 03:11:02 EEST


  I would like to second the idea of using XML, if nothing else you'll
(the original poster) learn XML which looks like useful skill and I
guess there are some parser for XML available already...

        erik

Maurizio Umberto Puxeddu wrote:
>
> Maurizio Umberto Puxeddu wrote:
> >
> > > > Anyway, now I need a simple language for an audio project. The file
> > > > format would be following.
> > > >
> > > > command1 <float>
> > > > command2 <int> <int> <float>
> > > > command3 <string> <float> <float>
> > > >
> > > > I have started to write a simple parser which finds first command,
> > > > and then reads as many parameters as the command has, and then another
> > > > command. It will exit the program if an error is found. First problem
> > > > is: how to find the commands and parameters? With fscanf(..,"%s",..)
> > > > and fscanf(..,"%f",..), and so on? How about comment lines?
> > > >
> > > > Or should I use Bison? Can Guile be used? Python? What does Guile and
> > > > Python code look a like? Any others? Would they work with the patent
> > > > file problem? I.e., finding a string from an entire file.
> >
> > You should have a look to the Python standard library, in particular
> > mudules like re (regular espressions) and cmd (a framework for command
> > interpreter), but there are modules for audio data handling too!
> > You can write a command line interpreter with history and help (just
> > like ftp or gdb) in 3 minutes. I wrote a IRC client to be embedded in a
> > commercial videogame in few hours using extensively the cmd.Cmd class
> > and regular expressions.
> > Python supports OOP and multithreading and is extensible and embeddable.
> >
> > Have fun,
> > Maurizio Umberto Puxeddu


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Aug 23 2000 - 04:07:07 EEST