def _build_const_declartions(self, with_init=True):
decls = []<EOL>index_type = self.get_index_type()<EOL>i = <NUM_LIT:2>  <EOL>for k in self.constants:<EOL><INDENT>type_decl = c_ast.TypeDecl(k.name, ['<STR_LIT>'], c_ast.IdentifierType(index_type))<EOL>init = None<EOL>if with_init:<EOL><INDENT>init = c_ast.FuncCall(<EOL>c_ast.ID('<STR_LIT>'),<EOL>c_ast.ExprList([c_ast.ArrayRef(c_ast.ID('<STR_LIT>'),<EOL>c_ast.Constant('<STR_LIT:int>', str(i)))]))<EOL><DEDENT>i += <NUM_LIT:1><EOL>decls.append(c_ast.Decl(<EOL>k.name, ['<STR_LIT>'], [], [],<EOL>type_decl, init, None))<EOL><DEDENT>return decls<EOL>
Generate constants declarations

:return: list of declarations