Re: Dynamic Interpretation

new topic     » topic index » view thread      » older message » newer message

Timothy Hemphill wrote:

> I'm trying to make a Euphoria program that
> interprets user input dynamically, LISP-like. As
> in, the user enters a string that is a Euphoria
> statement, and the program interprets it, making
> kind of a running mini-program that the user edits
> as they go along. Has anyone thought of this kind
> of thing before, or actually implemented it?

I wrote a full Euphoria interpreter some time back (in Euphoria, of course)
that would run a good chunk of Euphoria DOS programs. It wasn't interactive,
though, and had a show-stopping bug. I finally tracked down one of the major
bugs a couple of days ago, but Robert decided that posting it wouldn't be in
his best interest. smile

I also started an (unreleased) BASIC interpreter that's more along the lines
of what you're talking about, where you can interactively enter instructions
(and blocks of code) and have them execute on the fly. I didn't get around
to coding support for subs or functions in it, though. At one point I was
dreaming of writing a shareware replacement for QBasic that would run in
Windows, but I got sidetracked writing Win32Lib instead.

Finally, after years of wishing that Euphoria had a yacc-like parser, I've
finally given in and started coding one. I'm about 75% done with the basic
stuff - it reads the source file, and auto-generates a Euphoria parser from
the grammar. The resulting code is a bit limited (no look-ahead, no
backtracking, no left/right hand associations), but it's pretty cool
anyway.I hope to have something presentable within a week or less.

If you are interested in either of the first two projects (Euphoria or Basic
interpreters), let me know, and I'll email them to you.

-- David Cuny

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu