{
  "name": "protobuf",
  "rules": {
    "source_file": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "syntax"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "CHOICE",
            "members": [
              {
                "type": "SYMBOL",
                "name": "import"
              },
              {
                "type": "SYMBOL",
                "name": "package"
              },
              {
                "type": "SYMBOL",
                "name": "option"
              },
              {
                "type": "SYMBOL",
                "name": "emptyStatement"
              },
              {
                "type": "SYMBOL",
                "name": "enum"
              },
              {
                "type": "SYMBOL",
                "name": "message"
              },
              {
                "type": "SYMBOL",
                "name": "service"
              }
            ]
          }
        }
      ]
    },
    "comment": {
      "type": "TOKEN",
      "content": {
        "type": "SEQ",
        "members": [
          {
            "type": "STRING",
            "value": "//"
          },
          {
            "type": "PATTERN",
            "value": ".*"
          }
        ]
      }
    },
    "syntax": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "syntax"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "PATTERN",
          "value": "\"proto3\""
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "package": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "package"
        },
        {
          "type": "SYMBOL",
          "name": "fullIdent"
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "import": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "import"
        },
        {
          "type": "SYMBOL",
          "name": "strLit"
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "option": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "option"
        },
        {
          "type": "SYMBOL",
          "name": "optionName"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "SYMBOL",
          "name": "constant"
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "optionName": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "STRING",
              "value": "("
            },
            {
              "type": "SYMBOL",
              "name": "fullIdent"
            },
            {
              "type": "STRING",
              "value": ")"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "fullIdent"
        }
      ]
    },
    "enum": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "enum"
        },
        {
          "type": "SYMBOL",
          "name": "enumName"
        },
        {
          "type": "SYMBOL",
          "name": "enumBody"
        }
      ]
    },
    "enumBody": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "CHOICE",
            "members": [
              {
                "type": "SYMBOL",
                "name": "option"
              },
              {
                "type": "SYMBOL",
                "name": "enumField"
              },
              {
                "type": "SYMBOL",
                "name": "emptyStatement"
              }
            ]
          }
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "enumField": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "ident"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "-"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "intLit"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "["
                },
                {
                  "type": "SYMBOL",
                  "name": "enumValueOption"
                },
                {
                  "type": "REPEAT",
                  "content": {
                    "type": "SEQ",
                    "members": [
                      {
                        "type": "STRING",
                        "value": ","
                      },
                      {
                        "type": "SYMBOL",
                        "name": "enumValueOption"
                      }
                    ]
                  }
                },
                {
                  "type": "STRING",
                  "value": "]"
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "enumValueOption": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "optionName"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "SYMBOL",
          "name": "constant"
        }
      ]
    },
    "message": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "message"
        },
        {
          "type": "SYMBOL",
          "name": "messageName"
        },
        {
          "type": "SYMBOL",
          "name": "messageBody"
        }
      ]
    },
    "messageBody": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "CHOICE",
            "members": [
              {
                "type": "SYMBOL",
                "name": "field"
              },
              {
                "type": "SYMBOL",
                "name": "enum"
              },
              {
                "type": "SYMBOL",
                "name": "message"
              },
              {
                "type": "SYMBOL",
                "name": "option"
              },
              {
                "type": "SYMBOL",
                "name": "oneof"
              },
              {
                "type": "SYMBOL",
                "name": "mapField"
              },
              {
                "type": "SYMBOL",
                "name": "reserved"
              },
              {
                "type": "SYMBOL",
                "name": "emptyStatement"
              }
            ]
          }
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "service": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "service"
        },
        {
          "type": "SYMBOL",
          "name": "serviceName"
        },
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "CHOICE",
            "members": [
              {
                "type": "SYMBOL",
                "name": "option"
              },
              {
                "type": "SYMBOL",
                "name": "rpc"
              },
              {
                "type": "SYMBOL",
                "name": "emptyStatement"
              }
            ]
          }
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "rpc": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "rpc"
        },
        {
          "type": "SYMBOL",
          "name": "rpcName"
        },
        {
          "type": "STRING",
          "value": "("
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "stream"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "enumMessageType"
        },
        {
          "type": "STRING",
          "value": ")"
        },
        {
          "type": "STRING",
          "value": "returns"
        },
        {
          "type": "STRING",
          "value": "("
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "stream"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "enumMessageType"
        },
        {
          "type": "STRING",
          "value": ")"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "{"
                },
                {
                  "type": "REPEAT",
                  "content": {
                    "type": "CHOICE",
                    "members": [
                      {
                        "type": "SYMBOL",
                        "name": "option"
                      },
                      {
                        "type": "SYMBOL",
                        "name": "emptyStatement"
                      }
                    ]
                  }
                },
                {
                  "type": "STRING",
                  "value": "}"
                }
              ]
            },
            {
              "type": "STRING",
              "value": ";"
            }
          ]
        }
      ]
    },
    "field": {
      "type": "SEQ",
      "members": [
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "repeated"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "type"
        },
        {
          "type": "SYMBOL",
          "name": "fieldName"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "SYMBOL",
          "name": "fieldNumber"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "["
                },
                {
                  "type": "SYMBOL",
                  "name": "fieldOptions"
                },
                {
                  "type": "STRING",
                  "value": "]"
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "fieldOptions": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "fieldOption"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "STRING",
                "value": ","
              },
              {
                "type": "SYMBOL",
                "name": "fieldOption"
              }
            ]
          }
        }
      ]
    },
    "fieldOption": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "optionName"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "SYMBOL",
          "name": "constant"
        }
      ]
    },
    "oneof": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "oneof"
        },
        {
          "type": "SYMBOL",
          "name": "oneofName"
        },
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "CHOICE",
            "members": [
              {
                "type": "SYMBOL",
                "name": "option"
              },
              {
                "type": "SYMBOL",
                "name": "oneofField"
              },
              {
                "type": "SYMBOL",
                "name": "emptyStatement"
              }
            ]
          }
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "oneofField": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "type"
        },
        {
          "type": "SYMBOL",
          "name": "fieldName"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "SYMBOL",
          "name": "fieldNumber"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "["
                },
                {
                  "type": "SYMBOL",
                  "name": "fieldOptions"
                },
                {
                  "type": "STRING",
                  "value": "]"
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "mapField": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "map"
        },
        {
          "type": "STRING",
          "value": "<"
        },
        {
          "type": "SYMBOL",
          "name": "keyType"
        },
        {
          "type": "STRING",
          "value": ","
        },
        {
          "type": "SYMBOL",
          "name": "type"
        },
        {
          "type": "STRING",
          "value": ">"
        },
        {
          "type": "SYMBOL",
          "name": "mapName"
        },
        {
          "type": "STRING",
          "value": "="
        },
        {
          "type": "SYMBOL",
          "name": "fieldNumber"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "["
                },
                {
                  "type": "SYMBOL",
                  "name": "fieldOptions"
                },
                {
                  "type": "STRING",
                  "value": "]"
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "STRING",
          "value": ";"
        }
      ]
    },
    "keyType": {
      "type": "CHOICE",
      "members": [
        {
          "type": "STRING",
          "value": "int32"
        },
        {
          "type": "STRING",
          "value": "int64"
        },
        {
          "type": "STRING",
          "value": "uint32"
        },
        {
          "type": "STRING",
          "value": "uint64"
        },
        {
          "type": "STRING",
          "value": "sint32"
        },
        {
          "type": "STRING",
          "value": "sint64"
        },
        {
          "type": "STRING",
          "value": "fixed32"
        },
        {
          "type": "STRING",
          "value": "fixed64"
        },
        {
          "type": "STRING",
          "value": "sfixed32"
        },
        {
          "type": "STRING",
          "value": "sfixed64"
        },
        {
          "type": "STRING",
          "value": "bool"
        },
        {
          "type": "STRING",
          "value": "string"
        }
      ]
    },
    "reserved": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "reserved"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SYMBOL",
              "name": "ranges"
            },
            {
              "type": "SYMBOL",
              "name": "fieldNames"
            }
          ]
        }
      ]
    },
    "ranges": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "range"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "STRING",
                "value": ","
              },
              {
                "type": "SYMBOL",
                "name": "range"
              }
            ]
          }
        }
      ]
    },
    "range": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "intLit"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "to"
                },
                {
                  "type": "CHOICE",
                  "members": [
                    {
                      "type": "SYMBOL",
                      "name": "intLit"
                    },
                    {
                      "type": "STRING",
                      "value": "max"
                    }
                  ]
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        }
      ]
    },
    "fieldNames": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "fieldName"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "STRING",
                "value": ","
              },
              {
                "type": "SYMBOL",
                "name": "fieldName"
              }
            ]
          }
        }
      ]
    },
    "intLit": {
      "type": "PATTERN",
      "value": "(\\d\\d*|0[0-7]*|0[xX][\\da-fA-F]*)"
    },
    "floatLit": {
      "type": "CHOICE",
      "members": [
        {
          "type": "PATTERN",
          "value": "\\d\\.\\d*([eE][+-]\\d*)?"
        },
        {
          "type": "PATTERN",
          "value": "\\d*[eE][+-]\\d*"
        },
        {
          "type": "PATTERN",
          "value": "\\.\\d*[eE][+-]\\d*"
        },
        {
          "type": "STRING",
          "value": "inf"
        },
        {
          "type": "STRING",
          "value": "nan"
        }
      ]
    },
    "boolLit": {
      "type": "PATTERN",
      "value": "(true|false)"
    },
    "strLit": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "STRING",
              "value": "\""
            },
            {
              "type": "PATTERN",
              "value": "([^\"\\n\\\\]|\\\\[xX][\\da-fA-F]{2}|\\\\[0-7]{3}|\\\\[abfnrtv\\\\'\"])*"
            },
            {
              "type": "STRING",
              "value": "\""
            }
          ]
        },
        {
          "type": "SEQ",
          "members": [
            {
              "type": "STRING",
              "value": "'"
            },
            {
              "type": "PATTERN",
              "value": "([^'\\n\\\\]|\\\\[xX][\\da-fA-F]{2}|\\\\[0-7]{3}|\\\\[abfnrtv\\\\'\"])*"
            },
            {
              "type": "STRING",
              "value": "'"
            }
          ]
        }
      ]
    },
    "type": {
      "type": "CHOICE",
      "members": [
        {
          "type": "STRING",
          "value": "double"
        },
        {
          "type": "STRING",
          "value": "float"
        },
        {
          "type": "STRING",
          "value": "int32"
        },
        {
          "type": "STRING",
          "value": "int64"
        },
        {
          "type": "STRING",
          "value": "uint32"
        },
        {
          "type": "STRING",
          "value": "uint64"
        },
        {
          "type": "STRING",
          "value": "sint32"
        },
        {
          "type": "STRING",
          "value": "sint64"
        },
        {
          "type": "STRING",
          "value": "fixed32"
        },
        {
          "type": "STRING",
          "value": "fixed64"
        },
        {
          "type": "STRING",
          "value": "sfixed32"
        },
        {
          "type": "STRING",
          "value": "sfixed64"
        },
        {
          "type": "STRING",
          "value": "bool"
        },
        {
          "type": "STRING",
          "value": "string"
        },
        {
          "type": "STRING",
          "value": "bytes"
        },
        {
          "type": "SYMBOL",
          "name": "enumMessageType"
        }
      ]
    },
    "fieldNumber": {
      "type": "SYMBOL",
      "name": "intLit"
    },
    "emptyStatement": {
      "type": "STRING",
      "value": ";"
    },
    "constant": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "fullIdent"
        },
        {
          "type": "SEQ",
          "members": [
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "PATTERN",
                  "value": "[+-]"
                },
                {
                  "type": "BLANK"
                }
              ]
            },
            {
              "type": "SYMBOL",
              "name": "intLit"
            }
          ]
        },
        {
          "type": "SEQ",
          "members": [
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "PATTERN",
                  "value": "[+-]"
                },
                {
                  "type": "BLANK"
                }
              ]
            },
            {
              "type": "SYMBOL",
              "name": "floatLit"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "strLit"
        },
        {
          "type": "SYMBOL",
          "name": "boolLit"
        },
        {
          "type": "SYMBOL",
          "name": "msgLit"
        }
      ]
    },
    "msgLit": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "{"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "SYMBOL",
                "name": "fieldName"
              },
              {
                "type": "STRING",
                "value": ":"
              },
              {
                "type": "SYMBOL",
                "name": "constant"
              }
            ]
          }
        },
        {
          "type": "STRING",
          "value": "}"
        }
      ]
    },
    "ident": {
      "type": "PATTERN",
      "value": "[a-zA-Z_]\\w*"
    },
    "fullIdent": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "ident"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "STRING",
                "value": "."
              },
              {
                "type": "SYMBOL",
                "name": "ident"
              }
            ]
          }
        }
      ]
    },
    "messageName": {
      "type": "SYMBOL",
      "name": "ident"
    },
    "mapName": {
      "type": "SYMBOL",
      "name": "ident"
    },
    "enumName": {
      "type": "SYMBOL",
      "name": "ident"
    },
    "fieldName": {
      "type": "SYMBOL",
      "name": "ident"
    },
    "oneofName": {
      "type": "SYMBOL",
      "name": "ident"
    },
    "serviceName": {
      "type": "SYMBOL",
      "name": "ident"
    },
    "rpcName": {
      "type": "SYMBOL",
      "name": "ident"
    },
    "enumMessageType": {
      "type": "SEQ",
      "members": [
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "."
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SEQ",
            "members": [
              {
                "type": "SYMBOL",
                "name": "ident"
              },
              {
                "type": "STRING",
                "value": "."
              }
            ]
          }
        },
        {
          "type": "SYMBOL",
          "name": "messageName"
        }
      ]
    }
  },
  "extras": [
    {
      "type": "SYMBOL",
      "name": "comment"
    },
    {
      "type": "PATTERN",
      "value": "\\s"
    }
  ],
  "conflicts": [],
  "precedences": [],
  "externals": [],
  "inline": [],
  "supertypes": []
}

