Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, March 2004
Tcl expr in Qt


Message 1 in thread

hello everybody..

is there anything equivalent Qt for the Tcl eval expr command ? i.e. for 
evaluating expressions..

cheers
Sathya


Message 2 in thread

On Mon, 15 Mar 2004, Sathya Krishnamurthy wrote:

> is there anything equivalent Qt for the Tcl eval expr command ? i.e. for
> evaluating expressions..

No. But this is not a Qt specific limitation. It's a general limitation of
C++ as a compiled language. So either you write a function compiling a
code snippet on the fly, find a C++ interpreter or use one of the script
bindings like QSA.

Harri.


Message 3 in thread

Quoting Harri Porten <porten@froglogic.com>:

> On Mon, 15 Mar 2004, Sathya Krishnamurthy wrote:
> 
> > is there anything equivalent Qt for the Tcl eval expr command ? i.e. for
> > evaluating expressions..
> 
> No. But this is not a Qt specific limitation. It's a general limitation of
> C++ as a compiled language. So either you write a function compiling a
> code snippet on the fly, find a C++ interpreter or use one of the script
> bindings like QSA.

Or indeed you write your own expression parser, either by hand or using a lexer
or lexer and parser like [f]lex and yacc/bison.

A+
Paul