4

We are using ANTLR 3.5.2 on linux to generate a parser in C. We have been able to compile and link the generated C parser and the ANTLR C runtime on z/OS with the LE C compiler. Of course, we'd like the parser to be able to work in the EBCDIC environment.

What do we need to set or modify to get this to happen? Is it easier to run ANTLR on MVS to get code that runs on MVS, or can we continue to generate code on Linux and run (with minor modifications) on z/OS? Thanks very much, Tony

  • 1
    Googling "antlr z/os" comes up with this link https://groups.google.com/forum/#!topic/il-antlr-interest/U5P7berIQO8 which seems relevant. The principle appears to have a Stack Overflow ID, and may show up with a more direct answer. – cschneid Feb 25 '15 at 21:20
  • It's relevant for sure. Will try what Jim Idle is suggesting. I understand this to mean, compile for ascii and use ebcdic/ascii conversion for i/o. Will comment on the results after we try this. Thanks! – user3803240 Feb 25 '15 at 22:52

1 Answers1

2

You can switch the code page of the generated files to EBCDIC Latin-1 using:

 ??=pragma filetag ("IBM-1047")

Then your parser will be searching for the EBCDIC characters at the correct code points. You might want to give the generated file a good eyeballing to see if ANTLR has generated explicit ASCII ordinals (e.g. using 0x13 instead of a CR symbolic) and you might need to fix those up, but it shouldn't.

Joe Zitzelberger
  • 4,168
  • 1
  • 26
  • 40