Complexity is a central topic in political economy and political science. Starting from the study of gridlock in decision-making in the 1980s, through the delegation studies of the 1990s, to the more recent work on populism and legislation, researchers have tried to measure and study complexity with different approaches. In this paper, we argue that political science and political economy scholarship would benefit from a framework to study complexity, with clear ontological, epistemological and methodological assumptions. We propose a framework based on the Institutional Grammar, commonly used in the study of public policy design, to study complexity. In so doing, we provide a brief introduction to the Grammar that describes its origins and recent developments. Further, we describe its epistemological, ontological, and methodological features that provide the basis for the policy complexity framework. We then discuss how to apply the Grammar to study complexity, identifying a series of manual and automated methods to apply the Grammar and measure complexity. As part of the latter, we describe and showcase the use of a R package that supports automated classification of policy language according to the Grammar. Finally, we discuss complexity indicators in detail, and provide a proof-of-concept analysis of city, state, and federal level food policies drawing on these indicators.