summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCpp/Tests/parser/struct.ast
blob: 112dffe263950ead4138f3fec679ac7c15332cfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
TranslationUnit[1:0->12:0]
  StructOrClassDeclaration[1:7->7:0]
  MyStruct

    VariableDeclaration[3:4->4:4]
      NamedType[3:4->3:6]
        int
      x
    VariableDeclaration[4:4->5:0]
      Pointer[4:4->4:12]
        NamedType[4:4->4:12]
          s
      next
  FunctionDeclaration[7:0->12:0]
    NamedType[7:0->7:2]
      int
    foo
    (
    )
    FunctionDefinition[8:0->12:0]
    {
      VariableDeclaration[9:4->9:14]
        NamedType[9:4->9:11]
          MyStruct
        s
      FunctionCall[10:4->10:23]
        Name[10:4->10:9]
        printf
        StringLiteral[10:11->10:16]
          "%d\n"
        MemberExpression[10:19->10:22]
          Name[10:19->10:19]
          s
          Identifier[10:21->10:21]
          x
      ReturnStatement[11:4->11:14]
        MemberExpression[11:11->11:14]
          Name[11:11->11:11]
          s
          Identifier[11:13->11:13]
          x
    }