4.1.4 GNU indent向けの指示を置く場所

gperfの入力ファイルにGNU indentを実行しようとすると、入力ファイルの解釈を制御する‘%%’、‘%{’、‘%}’というgperfの指示を、GNU indentが理解しないことがわかります。そのため、GNU indent向けの指示を挿入する必要があります。具体的には、最も一般的な入力ファイルの構造を次のように仮定します。

declarations part 1
%{
verbatim code
%}
declarations part 2
%%
keywords
%%
functions

‘*INDENT-OFF*’と‘*INDENT-ON*’のコメントは、次のように挿入します。

/* *INDENT-OFF* */
declarations part 1
%{
/* *INDENT-ON* */
verbatim code
/* *INDENT-OFF* */
%}
declarations part 2
%%
keywords
%%
/* *INDENT-ON* */
functions