about Octave's syntax

View: New views
4 Messages — Rating Filter:   Alert me  

Parent Message unknown about Octave's syntax

by Eduardo Alejandro Cuesta Llanes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I need the formal Octave's syntax for make a parser...

Thanks

Re: about Octave's syntax

by Jaroslav Hajek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 1, 2009 at 4:08 PM, Eduardo Alejandro Cuesta
Llanes<eacuesta@...> wrote:
> I need the formal Octave's syntax for make a parser...
>
> Thanks
>

That's going to be difficult, it's really full of quirks. I don't
think the grammar is currently written anywhere.


--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

Re: about Octave's syntax

by shaiay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 2, 2009 at 7:27 AM, Jaroslav Hajek<highegg@...> wrote:

> On Wed, Jul 1, 2009 at 4:08 PM, Eduardo Alejandro Cuesta
> Llanes<eacuesta@...> wrote:
>> I need the formal Octave's syntax for make a parser...
>>
>> Thanks
>>
>
> That's going to be difficult, it's really full of quirks. I don't
> think the grammar is currently written anywhere.
>
I suppose the parser itself contains some sort of representation of
the grammar ....

Shai

Re: about Octave's syntax

by David Grundberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eduardo Alejandro Cuesta Llanes wrote:
> I need the formal Octave's syntax for make a parser...
>
> Thanks
>  
The syntax is not documented in a human-readable form (spare the
programmers). There is no BNF-like form for you to read.

If you are interested in a parser, you can just look at the parser
implemented by Octave. It's written using the GNU tools for parser
generation (i.e. compiler compilation). They are called flex and bison.

Lexical analyzer generation (flex input):
http://hg.savannah.gnu.org/hgweb/octave/file/79c4dd83d07f/src/lex.l

Parser generation (bison input):
http://hg.savannah.gnu.org/hgweb/octave/file/79c4dd83d07f/src/parse.y

David