[Top][All Lists]

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

Re: Is there a command that shows the C-code the interpreter creates?

From: Ian McCallion
Subject: Re: Is there a command that shows the C-code the interpreter creates?
Date: Tue, 16 Apr 2019 20:12:33 +0100

On Tue, 16 Apr 2019 at 18:42, GoSim <address@hidden> wrote:
> The Bison parser implementation file is C code which defines a function named
> yyparse which implements that grammar. This function does not make a
> complete C program: you must supply some additional functions. One is the
> lexical analyzer. Another is an error-reporting function which the parser
> calls to report an error. In addition, a complete C program must start with
> a function called main; you have to provide this, and arrange for it to call
> yyparse or the parser will never run. See Parser C-Language Interface.
> from:
> I am assuming this is someting that you do? Somehow you are running the
> code, can't you just make it available? I will try to solve the differing
> variable problem and create a m-file compiler which everyone wants.
> Are you running it line by line? How do you run your c-code?

I think there is a terminological misunderstanding here. Clearly,
during Octave execution, functions are parsed when first encountered
and the parser output is cached as a data structure in memory.  These
cached data structures could be considered as compiled code (and could
be the starting point of your compiler) but obviously no-one with
knowledge of Octave internals thinks this way, whence the

For what its worth, a decade or so ago I had access to Matlab and
experimented briefly with their compiler. From memory the compiled C
code consisted almost entirely of function calls to a large runtime
library containing entry points to do such things as "add". Could this
be your first step? It would have no significant performance advantage
but the basis for further development.

Cheers... Ian

reply via email to

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