[clug] An EBCDIC lex ?

Eyal Lebedinsky eyal at eyal.emu.id.au
Fri Aug 13 23:42:11 MDT 2010


The lexer includes tables that are numeric and associated with the tokens
that you defined, which is understood as ASCII if you used text values on
an ASCII machine.

If all the rules in your lex (input) file are in EBCDIC (or hex value thereof)
then this should generate a parser for the EBCDIC tokens, which is what you
are after.

Something like what in ASCII will say:
	DIGIT	[0-9]
should now say
	DIGIT	[\xf0-\xf9]
(I think this is how you escape hex in flex input)

This means a hand crafted EBCDIC input but you *can* use an ASCII system to create the scanner.

Does this work for you? Note: I did not try this myself...

cheers
	Eyal

On 14/08/10 13:08, Paul Matthews wrote:
> G'Day All,
>
> At work we a mainframe, not one of these new fancy mainframes with Linux running on it, but the old fashioned TSO, JCL and COBOL type of mainframes.
>
> Recently we gained access to a C compiler (and there was much rejoicing).
>
> Now was going to use lex/flex to help with a little domain specific language. So my cunning plan was to use flex on Linux (i686) to produce the C code. Then cut and paste it to the mainframe. However flex produces lots of tables and other assumptions, that only work on an ASCII platform.
>
> Has anyone seen a flex like tool that can be told to produce EBCDIC?

-- 
Eyal Lebedinsky	(eyal at eyal.emu.id.au)


More information about the linux mailing list