Flex on MSDOS and C block structure

Charles Marslett chasm at killer.UUCP
Fri May 13 00:55:16 AEST 1988


Keywords: flex for MSDOS
Newsgroups: comp.sources.d,comp.lang.c
 
Well I just finished making flex (Fast lex from Vern Paxson) work (more
or less) under PCDOS 3.3.  The reason for this posting is to raise
another 'C' question and to ask if others have had luck running flex
on non-unices (This posting is a plagarism of John Campbell's discussing
VMS, in case it looks familiar!).
 
My 'C' question is
 
  Flex has two register variables, yy_curst andyy_sym declared in a nested
  block beginning with the label "get_next_token".  That block is reentered
  at the label "find_rule" when an action is "REJECT"ed and the code appears
  to presume the variable yy_curst is unchanged.  Does the ANSI standard (or
  K&R for that matter) have anything to say about exiting a context and
  reentering it saving (or not saving) the state of local variables?  Might
  the fact that this code seems to work almost everywhere imply that Unix
  and VMS (AT&T derived?) C compilers allocate local variables on the
  entry to the function, rather than entry to the block? Enquiring minds
  want to know (-; .
 
Commentary w.r.t. flex on MSDOS systems:
 
  Two of the same basic changes were made to enable flex work on MSDOS as
  were made for VMS:  the long symbols in flexdef.h and the names of the
  files needed to be changed (differently I'm sure). Also, I had to define
  SV and allocate a larger stack than Microsoft presumes (2048 bytes!!) --
  the largest I could get the linker to take was 40960 bytes (0xA000).  I
  also might mention that I am running with the Microsoft 5.1 C compiler.
  
>> MUCH THANKS TO VERN PAXSON, KEVIN GONG, VAN JACOBSON, ET.AL.!!!!!!  
 
and to John Campbell for organizing my thoughts!
-- 
Charles Marslett
chasm at killer.UUCP
 



More information about the Comp.lang.c mailing list