node_to_edge = {
    'CompilationUnit': [('package', 0), ('imports', 0), ('types', 0)],
    'Import': [('path', 1), ('static', 0), ('wildcard', 0)],
    'PackageDeclaration': [('modifiers', 0), ('name', 1)],
    'ClassDeclaration': [('modifiers', 0), ('name', 1), ('type_parameters', 0),
                         ('extends', 0), ('implements', 0), ('body', 0)],
    'EnumDeclaration': [('modifiers', 0), ('name', 1), ('implements', 0), ('body', 0)],
    'InterfaceDeclaration': [('modifiers', 0), ('name', 1), ('type_parameters', 0), ('extends', 0), ('body', 1)],
    'AnnotationDeclaration': [('modifiers', 0), ('name', 1), ('body', 0)],

    'BasicType': [('name', 1), ('dimensions', 0)],
    'ReferenceType': [('name', 1), ('sub_type', 0), ('arguments', 0), ('dimensions', 0)],
    'TypeArgument': [('type', 0), ('pattern_type', 0)],
    'TypeParameter': [('name', 1), ('extends', 0)],
    'Annotation': [('name', 1), ('element', 0)],
    'ElementValuePair': [('name', 1), ('value', 0)],
    'ElementArrayValue': [('values', 0)],
    'MethodDeclaration': [('modifiers', 0), ('type_parameters', 0), ('return_type', 0), ('name', 1),
                          ('parameters', 0), ('throws', 0), ('body', 0)],
    'FieldDeclaration': [('modifiers', 0), ('type', 1), ('declarators', 2)],
    'ConstructorDeclaration': [('modifiers', 0), ('type_parameters', 0), ('name', 1),
                               ('parameters', 0), ('throws', 0), ('body', 0)],
    'ConstantDeclaration': [('modifiers', 0), ('type', 1), ('declarators', 2)],
    'ArrayInitializer': [('initializers', 0)],
    'VariableDeclaration': [('modifiers', 0), ('type', 1), ('declarators', 2)],
    'LocalVariableDeclaration': [('modifiers', 0), ('type', 1), ('declarators', 2)],
    'VariableDeclarator': [('name', 1), ('dimensions', 0), ('initializer', 0)],
    'FormalParameter': [('type', 1), ('name', 1), ('varargs', 0)],
    'InferredFormalParameter': [('name', 1)],

    'Statement': [],
    'IfStatement': [('condition', 1), ('then_statement', 1), ('else_statement', 0)],
    'WhileStatement': [('condition', 1), ('body', 1)],
    'DoStatement': [('condition', 1), ('body', 1)],
    'ForStatement': [('control', 1), ('body', 1)],
    'AssertStatement': [('condition', 1), ('value', 0)],
    'BreakStatement': [],
    'ContinueStatement': [],
    'ReturnStatement': [('expression', 0)],
    'ThrowStatement': [('expression', 1)],
    'SynchronizedStatement': [('lock', 1), ('block', 0)],
    'TryStatement': [('resources', 0), ('block', 0), ('catches', 0), ('finally_block', 0)],
    'SwitchStatement': [('expression', 1), ('cases', 0)],
    'BlockStatement': [('statements', 0)],
    'StatementExpression': [('expression', 1)],

    'TryResource': [('modifiers', 0), ('type', 1), ('name', 1), ('value', 0)],
    'CatchClause': [('parameter', 1), ('block', 0)],
    'CatchClauseParameter': [('modifiers', 0), ('types', 2), ('name', 1)],

    'SwitchStatementCase': [('case', 2), ('statements', 0)],
    'ForControl': [('init', 0), ('condition', 0), ('update', 0)],
    'EnhancedForControl': [('var', 1), ('iterable', 1)],

    'Assignment': [('expressionl', 1), ('type', 1), ('value', 1)],
    'TernaryExpression': [('condition', 1), ('if_true', 1), ('if_false', 1)],
    'BinaryOperation': [('prefix_operators', 0), ('operandl', 1), ('operator', 1), ('operandr', 1)],
    'MethodReference': [('expression', 1), ('type_arguments', 0), ('method', 1)],
    'LambdaExpression': [('parameters', 0), ('body', 1)],

    'Cast': [('prefix_operators', 0), ('qualifier', 0), ('type', 1), ('expression', 1),
             ('selectors', 0), ('postfix_operators', 0)],
    'Literal': [('prefix_operators', 0), ('value', 1)],
    'This': [('prefix_operators', 0), ('qualifier', 0), ('selectors', 0), ('postfix_operators', 0)],
    'MemberReference': [('prefix_operators', 0), ('qualifier', 0), ('member', 1), ('selectors', 0),
                        ('postfix_operators', 0)],
    'ExplicitConstructorInvocation': [('prefix_operators', 0), ('type_arguments', 0), ('qualifier', 0),
                                      ('arguments', 0), ('selectors', 0), ('postfix_operators', 0)],
    'SuperConstructorInvocation': [('prefix_operators', 0), ('type_arguments', 0), ('qualifier', 0),
                                   ('arguments', 0), ('selectors', 0), ('postfix_operators', 0)],
    'MethodInvocation': [('prefix_operators', 0), ('type_arguments', 0), ('qualifier', 0),
                         ('member', 1), ('arguments', 0), ('selectors', 0), ('postfix_operators', 0)],
    'SuperMethodInvocation': [('prefix_operators', 0), ('type_arguments', 0), ('qualifier', 0),
                              ('member', 1), ('arguments', 0), ('selectors', 0), ('postfix_operators', 0)],
    'SuperMemberReference': [('prefix_operators', 0), ('qualifier', 0), ('member', 1), ('selectors', 0),
                             ('postfix_operators', 0)],
    'ArraySelector': [('index', 1)],
    'ClassReference': [('prefix_operators', 0), ('qualifier', 0), ('type', 1), ('selectors', 0),
                       ('postfix_operators', 0)],
    'VoidClassReference': [('prefix_operators', 0), ('qualifier', 0), ('selectors', 0), ('postfix_operators', 0)],

    'ArrayCreator': [('qualifier', 0), ('type', 1), ('dimensions', 2), ('selectors', 0), ('initializer', 0)],
    'ClassCreator': [('qualifier', 0), ('constructor_type_arguments', 0), ('type', 1), ('arguments', 0),
                     ('body', 0), ('selectors', 0)],
    'InnerClassCreator': [('qualifier', 0), ('constructor_type_arguments', 0), ('type', 1),
                          ('arguments', 0), ('body', 0), ('selectors', 0)],

    'EnumBody': [('constants', 0), ('declarations', 0)],
    'EnumConstantDeclaration': [('modifiers', 0), ('name', 1), ('arguments', 0), ('body', 0)],
}