octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pluging hooks in the parser?


From: John W. Eaton
Subject: Re: Pluging hooks in the parser?
Date: Thu, 14 Jun 2007 01:47:47 -0400

On 13-Jun-2007, Michael Goffioul wrote:

| On 6/13/07, John W. Eaton <address@hidden> wrote:
| > 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?
| 
| "java" has no type. It's even not an object known to octave.
| "java.lang.String" is just a class name (as "java.lang.System"). This
| is basically the problem.
| 
| I know it's possible to "emulate" this by defining a "java" object and using
| the normal subsref mechanism, but not all java classes starts with "java",
| only the standard classes. Basically, it could be anything (or nothing).
| Moreover, if you want to also support "import" (like Matlab does), even
| the emulation is not possible:
| 
| import java.lang.*;
| s = String('my string');
| System.out.println("hello");
| 
| Maybe it's still possible to emulate all this (although it might become very
| tricky). But I thought that a more generic implementation could be based on
| some parser hooks. So I just wanted to know whether this was imaginable.

Yes, I suppose so.  Since this involves symbol lookup, it would
probably be best to work on the object branch or wait until the new
symbol table code is merged with the CVS trunk.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]