{
  "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
  "name": "cedarschema",
  "word": "identifier",
  "rules": {
    "schema": {
      "type": "REPEAT",
      "content": {
        "type": "CHOICE",
        "members": [
          {
            "type": "SYMBOL",
            "name": "namespace"
          },
          {
            "type": "SYMBOL",
            "name": "_declaration"
          }
        ]
      }
    },
    "namespace": {
      "type": "SEQ",
      "members": [
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "annotation"
          }
        },
        {
          "type": "STRING",
          "value": "namespace"
        },
        {
          "type": "SYMBOL",
          "name": "name"
        },
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "CHOICE",
            "members": [
              {
                "type": "SYMBOL",
                "name": "namespace"
              },
              {
                "type": "SYMBOL",
                "name": "_declaration"
              }
            ]
          }
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "_declaration": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "entity_declaration"
        },
        {
          "type": "SYMBOL",
          "name": "action_declaration"
        },
        {
          "type": "SYMBOL",
          "name": "common_type_declaration"
        }
      ]
    },
    "entity_declaration": {
      "type": "SEQ",
      "members": [
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "annotation"
          }
        },
        {
          "type": "STRING",
          "value": "entity"
        },
        {
          "type": "SYMBOL",
          "name": "identifier_list"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "CHOICE",
                  "members": [
                    {
                      "type": "SYMBOL",
                      "name": "entity_parents"
                    },
                    {
                      "type": "BLANK"
                    }
                  ]
                },
                {
                  "type": "CHOICE",
                  "members": [
                    {
                      "type": "SEQ",
                      "members": [
                        {
                          "type": "CHOICE",
                          "members": [
                            {
                              "type": "STRING",
                              "value": "="
                            },
                            {
                              "type": "BLANK"
                            }
                          ]
                        },
                        {
                          "type": "SYMBOL",
                          "name": "record_type"
                        }
                      ]
                    },
                    {
                      "type": "BLANK"
                    }
                  ]
                },
                {
                  "type": "CHOICE",
                  "members": [
                    {
                      "type": "SYMBOL",
                      "name": "entity_tags"
                    },
                    {
                      "type": "BLANK"
                    }
                  ]
                },
                {
                  "type": "STRING",
                  "value": ";"
                }
              ]
            },
            {
              "type": "SYMBOL",
              "name": "enum_type"
            }
          ]
        }
      ]
    },
    "action_declaration": {
      "type": "SEQ",
      "members": [
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "annotation"
          }
        },
        {
          "type": "STRING",
          "value": "action"
        },
        {
          "type": "SYMBOL",
          "name": "action_name_list"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SYMBOL",
              "name": "action_parents"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SYMBOL",
              "name": "applies_to"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SYMBOL",
              "name": "action_attributes"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "action_attributes": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "attributes"
        },
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "SYMBOL",
                  "name": "attribute_entry"
                },
                {
                  "type": "REPEAT",
                  "content": {
                    "type": "SEQ",
                    "members": [
                      {
                        "type": "STRING",
                        "value": ","
                      },
                      {
                        "type": "SYMBOL",
                        "name": "attribute_entry"
                      }
                    ]
                  }
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": ","
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "attribute_entry": {
      "type": "SEQ",
      "members": [
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SYMBOL",
              "name": "identifier"
            },
            {
              "type": "SYMBOL",
              "name": "string"
            }
          ]
        },
        {
          "type": "STRING",
          "value": ":"
        },
        {
          "type": "SYMBOL",
          "name": "_literal"
        }
      ]
    },
    "_literal": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "true"
        },
        {
          "type": "SYMBOL",
          "name": "false"
        },
        {
          "type": "SYMBOL",
          "name": "integer"
        },
        {
          "type": "SYMBOL",
          "name": "string"
        }
      ]
    },
    "true": {
      "type": "STRING",
      "value": "true"
    },
    "false": {
      "type": "STRING",
      "value": "false"
    },
    "integer": {
      "type": "TOKEN",
      "content": {
        "type": "PATTERN",
        "value": "[0-9]+"
      }
    },
    "common_type_declaration": {
      "type": "SEQ",
      "members": [
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "annotation"
          }
        },
        {
          "type": "STRING",
          "value": "type"
        },
        {
          "type": "SYMBOL",
          "name": "identifier"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "SYMBOL",
          "name": "_type_expression"
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "entity_parents": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "in"
        },
        {
          "type": "SYMBOL",
          "name": "type_list"
        }
      ]
    },
    "entity_tags": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "tags"
        },
        {
          "type": "SYMBOL",
          "name": "_type_expression"
        }
      ]
    },
    "enum_type": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "enum"
        },
        {
          "type": "STRING",
          "value": "["
        },
        {
          "type": "SEQ",
          "members": [
            {
              "type": "SYMBOL",
              "name": "string"
            },
            {
              "type": "REPEAT",
              "content": {
                "type": "SEQ",
                "members": [
                  {
                    "type": "STRING",
                    "value": ","
                  },
                  {
                    "type": "SYMBOL",
                    "name": "string"
                  }
                ]
              }
            }
          ]
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": ","
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": "]"
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "action_parents": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "in"
        },
        {
          "type": "SYMBOL",
          "name": "qualified_name_list"
        }
      ]
    },
    "_applies_to_member": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "principal_types"
        },
        {
          "type": "SYMBOL",
          "name": "resource_types"
        },
        {
          "type": "SYMBOL",
          "name": "context_type"
        }
      ]
    },
    "applies_to": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "appliesTo"
        },
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "SYMBOL",
                  "name": "_applies_to_member"
                },
                {
                  "type": "REPEAT",
                  "content": {
                    "type": "SEQ",
                    "members": [
                      {
                        "type": "STRING",
                        "value": ","
                      },
                      {
                        "type": "SYMBOL",
                        "name": "_applies_to_member"
                      }
                    ]
                  }
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": ","
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "principal_types": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "principal"
        },
        {
          "type": "STRING",
          "value": ":"
        },
        {
          "type": "SYMBOL",
          "name": "type_list"
        }
      ]
    },
    "resource_types": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "resource"
        },
        {
          "type": "STRING",
          "value": ":"
        },
        {
          "type": "SYMBOL",
          "name": "type_list"
        }
      ]
    },
    "context_type": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "context"
        },
        {
          "type": "STRING",
          "value": ":"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SYMBOL",
              "name": "record_type"
            },
            {
              "type": "SYMBOL",
              "name": "name"
            }
          ]
        }
      ]
    },
    "_type_expression": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "primitive_type"
        },
        {
          "type": "SYMBOL",
          "name": "set_type"
        },
        {
          "type": "SYMBOL",
          "name": "record_type"
        },
        {
          "type": "SYMBOL",
          "name": "name"
        }
      ]
    },
    "primitive_type": {
      "type": "CHOICE",
      "members": [
        {
          "type": "STRING",
          "value": "Bool"
        },
        {
          "type": "STRING",
          "value": "Long"
        },
        {
          "type": "STRING",
          "value": "String"
        }
      ]
    },
    "set_type": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "Set"
        },
        {
          "type": "STRING",
          "value": "<"
        },
        {
          "type": "SYMBOL",
          "name": "_type_expression"
        },
        {
          "type": "STRING",
          "value": ">"
        }
      ]
    },
    "record_type": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "SYMBOL",
                  "name": "attribute_declaration"
                },
                {
                  "type": "REPEAT",
                  "content": {
                    "type": "SEQ",
                    "members": [
                      {
                        "type": "STRING",
                        "value": ","
                      },
                      {
                        "type": "SYMBOL",
                        "name": "attribute_declaration"
                      }
                    ]
                  }
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": ","
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "attribute_declaration": {
      "type": "SEQ",
      "members": [
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "annotation"
          }
        },
        {
          "type": "SYMBOL",
          "name": "_attribute_name"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "?"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": ":"
        },
        {
          "type": "SYMBOL",
          "name": "_type_expression"
        }
      ]
    },
    "annotation": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "@"
        },
        {
          "type": "SYMBOL",
          "name": "identifier"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "("
                },
                {
                  "type": "SYMBOL",
                  "name": "string"
                },
                {
                  "type": "STRING",
                  "value": ")"
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        }
      ]
    },
    "type_list": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "STRING",
              "value": "["
            },
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "SEQ",
                  "members": [
                    {
                      "type": "SYMBOL",
                      "name": "name"
                    },
                    {
                      "type": "REPEAT",
                      "content": {
                        "type": "SEQ",
                        "members": [
                          {
                            "type": "STRING",
                            "value": ","
                          },
                          {
                            "type": "SYMBOL",
                            "name": "name"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "BLANK"
                }
              ]
            },
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "STRING",
                  "value": ","
                },
                {
                  "type": "BLANK"
                }
              ]
            },
            {
              "type": "STRING",
              "value": "]"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "name"
        }
      ]
    },
    "qualified_name": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "SYMBOL",
              "name": "identifier"
            },
            {
              "type": "REPEAT",
              "content": {
                "type": "SEQ",
                "members": [
                  {
                    "type": "STRING",
                    "value": "::"
                  },
                  {
                    "type": "SYMBOL",
                    "name": "identifier"
                  }
                ]
              }
            },
            {
              "type": "STRING",
              "value": "::"
            },
            {
              "type": "SYMBOL",
              "name": "string"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "_attribute_name"
        }
      ]
    },
    "qualified_name_list": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "STRING",
              "value": "["
            },
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "SYMBOL",
                  "name": "qualified_name"
                },
                {
                  "type": "REPEAT",
                  "content": {
                    "type": "SEQ",
                    "members": [
                      {
                        "type": "STRING",
                        "value": ","
                      },
                      {
                        "type": "SYMBOL",
                        "name": "qualified_name"
                      }
                    ]
                  }
                }
              ]
            },
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "STRING",
                  "value": ","
                },
                {
                  "type": "BLANK"
                }
              ]
            },
            {
              "type": "STRING",
              "value": "]"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "qualified_name"
        }
      ]
    },
    "name": {
      "type": "PREC_RIGHT",
      "value": 0,
      "content": {
        "type": "SEQ",
        "members": [
          {
            "type": "SYMBOL",
            "name": "identifier"
          },
          {
            "type": "REPEAT",
            "content": {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "::"
                },
                {
                  "type": "SYMBOL",
                  "name": "identifier"
                }
              ]
            }
          }
        ]
      }
    },
    "identifier_list": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "identifier"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "STRING",
                "value": ","
              },
              {
                "type": "SYMBOL",
                "name": "identifier"
              }
            ]
          }
        }
      ]
    },
    "action_name_list": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "_attribute_name"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "STRING",
                "value": ","
              },
              {
                "type": "SYMBOL",
                "name": "_attribute_name"
              }
            ]
          }
        }
      ]
    },
    "_attribute_name": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "identifier"
        },
        {
          "type": "SYMBOL",
          "name": "string"
        }
      ]
    },
    "string_content": {
      "type": "IMMEDIATE_TOKEN",
      "content": {
        "type": "PATTERN",
        "value": "[^\"\\\\\\r\\n]+"
      }
    },
    "string": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "\""
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "CHOICE",
            "members": [
              {
                "type": "SYMBOL",
                "name": "string_content"
              },
              {
                "type": "SYMBOL",
                "name": "escape_sequence"
              }
            ]
          }
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "IMMEDIATE_TOKEN",
              "content": {
                "type": "STRING",
                "value": "\""
              }
            },
            {
              "type": "BLANK"
            }
          ]
        }
      ]
    },
    "escape_sequence": {
      "type": "IMMEDIATE_TOKEN",
      "content": {
        "type": "SEQ",
        "members": [
          {
            "type": "STRING",
            "value": "\\"
          },
          {
            "type": "CHOICE",
            "members": [
              {
                "type": "PATTERN",
                "value": "[^xu]"
              },
              {
                "type": "PATTERN",
                "value": "x[0-9a-fA-F]{2}"
              },
              {
                "type": "PATTERN",
                "value": "u\\{[0-9a-fA-F]+\\}"
              }
            ]
          }
        ]
      }
    },
    "identifier": {
      "type": "TOKEN",
      "content": {
        "type": "PATTERN",
        "value": "[_a-zA-Z][_a-zA-Z0-9]*"
      }
    },
    "comment": {
      "type": "TOKEN",
      "content": {
        "type": "SEQ",
        "members": [
          {
            "type": "STRING",
            "value": "//"
          },
          {
            "type": "PATTERN",
            "value": ".*"
          }
        ]
      }
    }
  },
  "extras": [
    {
      "type": "PATTERN",
      "value": "\\s"
    },
    {
      "type": "SYMBOL",
      "name": "comment"
    }
  ],
  "conflicts": [],
  "precedences": [],
  "externals": [],
  "inline": [],
  "supertypes": [],
  "reserved": {}
}