[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Pluging hooks in the parser?
From: |
John W. Eaton |
Subject: |
Pluging hooks in the parser? |
Date: |
Wed, 13 Jun 2007 01:45:14 -0400 |
On 8-Jun-2007, Michael Goffioul wrote:
| Hi,
|
| I wondered how hard it would to have the possibility for external code to
| plug some hooks in the tree evaluator, especially for indexed expressions.
| What I have in mind is to allow the java-like syntax for creating java objects
| or calling static methods, like in:
|
| s = java.lang.String('this is my string');
| java.lang.System.out.println("Hello from there!");
|
| In that context, it would be nice to be able to plug a function into the
| tree evaluator such that if it encounters an error in an indexed expression
| like the above, it passes the "subsref" call (with all the information) to
| that function; if the hook cannot handle that syntax, the tree evaluator then
| issues the normal error.
In the example above, what is the type of "java"? If it is your own
user-defined type, then can't you already do what you want from the
subsref method in that octave_value sub-type?
jwe