Lexing and STk

From: David Fox <fox_at_cat.nyu.edu>
Date: 02 Dec 1996 13:10:52 -0500

It so happened that I wanted to do a lexical analysis of an input file
today, and I discovered that it is not too easy in STk. I tried using
anchored regular expressions (e.g. "^[0-9][0-9]*") to match tokens,
but then I had to chop each matched token off the string using
substring before matching the next token, and substring always mallocs
a whole new string. Perhaps STk should check for the special case of
a substring which extends to the end of the original string, and store
a bit to indicate that it the resulting string is a substring and
doesn't own its data. Or is there a more sensible way of doing this
that I'm not seeing?
David Fox	    http://www.cat.nyu.edu/fox		 xoF divaD
NYU Media Research Lab   fox_at_cat.nyu.edu    baL hcraeseR aideM UYN
Received on Mon Dec 02 1996 - 19:03:54 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST