0

I have similar problem as this one. But I am using C version, antlr3c. It is not clear to me how to call getText(). I tried this:

FALL_THROUGH
  : .   { cerr << getText(); }
  ;

But the compiler says getText() not defined.

I then tried:

FALL_THROUGH
  : f=.   { cerr << $f->getText(); }
  ;

But it is also wrong, seems f is defined as an integer.

Any pointer how to get the text value?

Community
  • 1
  • 1
my_question
  • 3,075
  • 2
  • 27
  • 44

1 Answers1

0

Please, try this. This would help:

FALL_THROUGH
  : f=.   { cerr << $f.text; }
  ;

Good luck!

Juan Aguilar Guisado
  • 1,687
  • 1
  • 12
  • 21