[comp.windows.ms.programmer] MS Windows compatible YACC and LEX

ges@stbimbo.UUCP (Gerald Sullivan) (12/05/90)

Is anyone out there aware of yacc and lex clones that produce
MS Windows compatible code. In other words I am looking for
yacc and lex that produce code that can be linked to Windows
applications. I would be happy to hear about any other parser
generators that produce Windows compatible code.

Thanks
Jerry Sullivan

papa@pollux.usc.edu (Marco Papa) (12/05/90)

In article <256@stbimbo.UUCP> ges@stbimbo.UUCP (Gerald Sullivan) writes:
>Is anyone out there aware of yacc and lex clones that produce
>MS Windows compatible code. In other words I am looking for
>yacc and lex that produce code that can be linked to Windows
>applications. I would be happy to hear about any other parser
>generators that produce Windows compatible code.

Lex and Yacc have really nothing to do with Windows, so your question should be
something like "is there a lex/yacc package that works with compilers that can
be used to build Windows applications?".  The answer is yes. I'm building such
an application. I'm using MKS Lex/Yacc.  You can get a good deal on the 
package from either Programmer's Paradise of Programmer's Shop.  Discounted
price is around $200.  I'm fully satisfied with this product.

-- Marco



-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Xerox sues somebody for copying?" -- David Letterman
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

rommel@lan.informatik.tu-muenchen.dbp.de (Kai-Uwe Rommel) (12/05/90)

In article <28630@usc> papa@pollux.usc.edu (Marco Papa) writes:
>In article <256@stbimbo.UUCP> ges@stbimbo.UUCP (Gerald Sullivan) writes:
>>Is anyone out there aware of yacc and lex clones that produce
>>MS Windows compatible code. In other words I am looking for
>
>Lex and Yacc have really nothing to do with Windows, so your question should be
>something like "is there a lex/yacc package that works with compilers that can
>be used to build Windows applications?".  The answer is yes. I'm building such
>an application. I'm using MKS Lex/Yacc.  You can get a good deal on the 

flex and GNU bison are also working well with MS C 5.1 or 6.0.

Kai Uwe Rommel

--
/* Kai Uwe Rommel
 * Munich
 * rommel@lan.informatik.tu-muenchen.dbp.de
 */

hughes@maelstrom.Berkeley.EDU (Eric Hughes) (12/05/90)

In article <28630@usc> papa@pollux.usc.edu (Marco Papa) writes: 
>I'm using MKS Lex/Yacc.  You can get a good deal on the package from
>either Programmer's Paradise of Programmer's Shop.  Discounted price
>is around $200.  I'm fully satisfied with this product.

On simtel20 and other sites there are copies of flex and bison for the
PC.  Flex is a replacement for lex and bison is a replacement for
yacc.  There is a restriction on the use of bison-generated scanners,
though.  Otherwise they are free.  I understand that there is a public
domain and unrestricted yacc on a Berkeley distribution, but I don't
know of a port to the PC.

Eric Hughes
hughes@ocf.berkeley.edu

ges@stbimbo.UUCP (Gerald Sullivan) (12/07/90)

In article <28630@usc> papa@pollux.usc.edu (Marco Papa) writes:
>In article <256@stbimbo.UUCP> ges@stbimbo.UUCP (Gerald Sullivan) writes:
>>Is anyone out there aware of yacc and lex clones that produce
>>MS Windows compatible code. In other words I am looking for
>>yacc and lex that produce code that can be linked to Windows
>>applications. I would be happy to hear about any other parser
>>generators that produce Windows compatible code.
>
>Lex and Yacc have really nothing to do with Windows, so your question should be
>something like "is there a lex/yacc package that works with compilers that can
>be used to build Windows applications?".  The answer is yes. I'm building such
>an application. I'm using MKS Lex/Yacc.  You can get a good deal on the 
>package from either Programmer's Paradise of Programmer's Shop.  Discounted
>price is around $200.  I'm fully satisfied with this product.
>
>-- Marco

No, my question is exactly what I asked. Sorry if it was not clear.

Are you linking the parser to your Windows application or just executing
the parser from a Windows application as a DOS "process"? I need to do
the former.

It is my understanding that just
because somthing compiles with MS C does not imply that it will work run
under Windows as part of a Windows application. In other words, y.tab.c 
(the parser source code generated by yacc) produced by MKS yacc may do 
things acceptable under DOS but not Windows (ie segment arithmatic,
requiring incompatible libraries, etc).  I may be mistaken, I am new to 
Windows  and DOS but have used yacc and lex extensively.

I want to call yyparse() from a Windows application. Note that it is
not enough to be able to run the parser as a DOS "process" because I need
access to data structures built as a side effect of the parsing process.
I don't think it is possible to pass data structures to a Windows application
from a DOS "process" spawned by the application. I may be wrong.

I am aware of MKS yacc and lex. According to MKS, the output of MKS yacc
is indeed incompatible with Windows. They did not say why. They said that
the parser produced by MKS yacc cannot be linked to a Windows application.
They said it will run as a DOS application under Windows. Unfortunately,
that is not what I need. The MKS person suggested I chek back in 6 months.

Thanks,
Jerry Sullivan

gyugyi@earthsea.stanford.edu (Paul Gyugyi) (12/08/90)

In article <262@stbimbo.UUCP>, ges@stbimbo.UUCP (Gerald Sullivan) writes:

|> Are you linking the parser to your Windows application or just executing
|> the parser from a Windows application as a DOS "process"? I need to do
|> the former.
|> 
...
|> 
|> Thanks,
|> Jerry Sullivan

I'm new to yacc and lex, but maybe this is useful information:
The Actor development system includes a lexical analyzer that works
with YACC output. (or is it lex output?  I'm sorry I don't know
better).  Whatever, the routine you run to generate the tables still
has to run under DOS, and then you take the generated C code and
edit it (with a provided macro) to make it Actor source.  Actor has
a built in something that will take these tables, along with your
input from a command line, and convert it all into actor code which
it then executes.  I think they called it the "data driven lexical
analyzer."

Anyway, I used it to make a small command language for a wargame I'm
writing, which says something about putting powerful tools in the hands
of incompent people :).

--
Paul Gyugyi
gyugyi@earthsea.stanford.edu

papa@pollux.usc.edu (Marco Papa) (12/10/90)

In article <262@stbimbo.UUCP> ges@stbimbo (Gerald Sullivan) writes:
|In article <28630@usc> papa@pollux.usc.edu (Marco Papa) writes:
||In article <256@stbimbo.UUCP> ges@stbimbo.UUCP (Gerald Sullivan) writes:
|||Is anyone out there aware of yacc and lex clones that produce
|||MS Windows compatible code. In other words I am looking for
|||yacc and lex that produce code that can be linked to Windows
|||applications. I would be happy to hear about any other parser
|||generators that produce Windows compatible code.
||
||Lex and Yacc have really nothing to do with Windows, so your question should be
||something like "is there a lex/yacc package that works with compilers that can
||be used to build Windows applications?".  The answer is yes. I'm building such
||an application. I'm using MKS Lex/Yacc.  You can get a good deal on the 
||package from either Programmer's Paradise of Programmer's Shop.  Discounted
||price is around $200.  I'm fully satisfied with this product.
||
||-- Marco
|
|No, my question is exactly what I asked. Sorry if it was not clear.
|
|Are you linking the parser to your Windows application or just executing
|the parser from a Windows application as a DOS "process"? I need to do
|the former.

I'm linking actually "multiple" parser to the window application.  And I am
calling Windows routines from the routines called by the parser. 

|It is my understanding that just
|because somthing compiles with MS C does not imply that it will work run
|under Windows as part of a Windows application. In other words, y.tab.c 
|(the parser source code generated by yacc) produced by MKS yacc may do 
|things acceptable under DOS but not Windows (ie segment arithmatic,
|requiring incompatible libraries, etc).  I may be mistaken, I am new to 
|Windows  and DOS but have used yacc and lex extensively.

This is definitely not true of MKS lex/yacc.  And I can't see why it would be 
true of any other. You'll likely have to create your own gettoken routine,
if you don;t want to use the one provided, but MKS lex allows you to redifine
all the macros to your heart content.

|I want to call yyparse() from a Windows application. Note that it is
|not enough to be able to run the parser as a DOS "process" because I need
|access to data structures built as a side effect of the parsing process.
|I don't think it is possible to pass data structures to a Windows application
|from a DOS "process" spawned by the application. I may be wrong.

I sincerely don't know what you're talking about. But then, I don't use DOS
processes at all.

|I am aware of MKS yacc and lex. According to MKS, the output of MKS yacc
|is indeed incompatible with Windows. They did not say why. They said that
|the parser produced by MKS yacc cannot be linked to a Windows application.
|They said it will run as a DOS application under Windows. Unfortunately,
|that is not what I need. The MKS person suggested I chek back in 6 months.

I guess they don't know what they are talking about either.  BTW, mks LEX/yacc
worked for me with MSC 5.1 and 6.0 and Windows 2.11 and 3.0.

-- Marco



-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Xerox sues somebody for copying?" -- David Letterman
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=