0

I upgraded to MacOS High Sierra and Xcode 9, and now when I run flex (lex / lexical analyzer), it gives no output.

Why, and how can I fix it?

eg, flex -t testfile.lex gives no output (for any valid file). If I change the file so there's an error in it, I will get the error message. Running flex on that same file worked fine on MacOS Sierra and Xcode 8.

1 Answer 1

1

I had the same symptoms. In my case it was a broken install of m4 (left behind by macports, and ahead of the system m4 in my PATH). flex calls m4 behind the scenes. If m4 crashes without output, flex will just exit without an error message.

See if calling m4 from the command line works. If not, there's your culprit.

1
  • Thanks! m4 was working fine for me, but looking into it from your explanation, my issue was also from some broken install left behind by macports (presumably something else flex was calling behind the scenes). Following this fixed it for me: trac.macports.org/wiki/Migration
    – Anon
    Commented Feb 20, 2018 at 18:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .