0

Newbie (or silly) question:

I'm trying to use StringTemplate V4 to convert a language to another one, like C to nuSMV. So far I noticed that I have to "instrumentate" my grammar file (g4) to inform what I'm supposed to replace. For instance:

atom
  :  ID ->  var(id={$ID.text})
  ;

When I try to run that code, I get the following exception in my Eclipse:

syntax error: '->' came as a complete surprise to me while looking for rule element (org.antlr:antlr4-maven-plugin:4.2.2:antlr4:antlr:generate-sources)

What am I doing wrong?

paprika
  • 2,424
  • 26
  • 46

1 Answers1

1

v4 ANTLR does not support ST directly. Sorry. We intend for people to use ST within a listener or visitor.

Terence Parr
  • 5,912
  • 26
  • 32