Hmm, this sounds easy. Just #define your own lex YYINPUT macro which
converts ebcdic to ascii. This could be done in a 256 char table with
YYINPUT defined as ebcdic2ascii[getchar()]. All you have to supply is
the proper conversion table. Have a look at oak.oakland.edu (former
simtel archive) in msdos/txtutl there is ebc2asc.arc for example.