0

ツリー変換でantlrトークンをキャメルケースのStringTemplate属性に変換するための最良のパターン(言語に依存しない、再ターゲット可能な生成コード用)は何ですか? 例: 私の DSL には MY_FIELD 定義があり、StringTemplate の出力には myField が必要です。

4

1 に答える 1

0

In your parser you could set the text of the Token, and that should flow through to the StringTemplate. Something like this grammar fragment should work:

my=MY_FIELD { $my.setText("myField"); }

于 2013-02-15T19:10:37.507 に答える