[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lex parsing floating point values
- From: David Olofson <david@...>
- Date: Wed, 28 May 2003 21:45:29 +0200
First post! So, a short introduction:
"Hi! I'm Dave, the Linux audio and real time hacker."
(That'll do for now, 'cause who really cares anyway? :-)
On Wednesday 28 May 2003 15.09, Mike Spencer wrote:
[...]
> i would like to read in floats that could be in various formats:
> e.g.
> 1
> 1.0
> .01
> -1
> -.01
> -1.68587e-007
<rant>
Next, you'll want variables and simple expressions. Then you'll want
correct expression evaluation order and more operators and stuff. And
macros/functions... And... Well, you get the idea! :-)
That's how a C API for waveform rendering turned into a simple text
file format, which eventually became a half finished scripting
language known (or not) as "EEL". (There is at least one other
language by that name, BTW. Mine is *not* the one you've heard of.
:-) This is the scripting engine that turns .agw scripts into sound
in my audio engine Audiality, used in the game Kobo Deluxe. (See .sig
for URLs.)
Now, it seems like I'm ditching EEL and throwing Lua in.
Even if my future plans include running stripts in real time (sub
millisecond worst case latency required) and perhaps specialized
language constructs, I'm much better off hacking Lua to suit my needs
- if I even have to - than wasting more time on my own brand new,
experimental language.
Hacking EEL was fun (well, I'm a bit brain damaged... ;-), but now
I've Been There, Done That, so I'm switching to the "shortest path to
the best solution" strategy.
</rant>
Short version:
As has been sugested, just use Lua to parse your files. It's pretty
much designed for it, AFAICT.
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---