[MLton] A few mllex patches

Matthew Fluet fluet at tti-c.org
Wed Nov 7 18:11:07 PST 2007


On Wed, 7 Nov 2007, Florian Weimer wrote:
> * Matthew Fluet:
>
>> I wonder if the "%largefile" directive would be better as a
>> "%posint {identifier}" directive to allow setting an arbitrary integer
>> structure for the yypos variable.  You could acheive the effect of the
>> "%largefile" directive with "%posint Int64", but you could also
>> conveniently do "%posint Position" or "%posint LargeInt".
>
> The idea behind %largefile was that different SML implementations
> could choose different types (some might want to use Int63 instead of
> Int64, for instance).  But I'm fine with %posint as well because the
> %largeint approach is unlikely to work out in practice.

I think it is best to consider ml-lex as a separate tool, not tied to a 
particular implementation.  In which case, I think the %posint directive 
works well, because you can say "%posint MyYYPosInt" in the .lex file, and 
then use whatever mechanism one chooses to coordinate between 
implementation differences to bind the structure of choice to MyYYPosInt, 
without needing to change the .sml files generated from the .lex file.




More information about the MLton mailing list