Guest User

Untitled

a guest
Jan 8th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. # addType()
  2.  
  3. # Input => struct A14 { char a1; }
  4.  
  5. # (struct_specifier 25 1 23
  6. # (type_identifier 25 8 3 "A14")
  7. # (field_declaration_list 25 12 12
  8. # (field_declaration 25 14 8
  9. # (primitive_type 25 14 4 "char")
  10. # (field_identifier 25 19 2 "a1")
  11. # )
  12. # )
  13. # )
  14.  
  15. # addTypeObject()
  16.  
  17. # Output => A14* = object
  18. # a1*: cchar
  19.  
  20. # nkTypeDef(
  21. # nkPostfix(
  22. # nkIdent("*"),
  23. # nkIdent("A14")
  24. # ),
  25. # nkEmpty(),
  26. # nkObjectTy(
  27. # nkEmpty(),
  28. # nkEmpty(),
  29. # nkRecList(
  30. # nkIdentDefs(
  31. # nkPostfix(
  32. # nkIdent("*"),
  33. # nkIdent("a1")
  34. # ),
  35. # nkIdent("cchar"),
  36. # nkEmpty()
  37. # )
  38. # )
  39. # )
  40. # )
  41.  
  42. # addType()
  43.  
  44. # Input => struct A1 { char *a2; int a3; }
  45.  
  46. # (struct_specifier 26 1 31
  47. # (type_identifier 26 8 2 "A1")
  48. # (field_declaration_list 26 11 21
  49. # (field_declaration 26 13 9
  50. # (primitive_type 26 13 4 "char")
  51. # (pointer_declarator 26 18 3 "*a2"
  52. # (field_identifier 26 19 2 "a2")
  53. # )
  54. # )
  55. # (field_declaration 26 23 7
  56. # (primitive_type 26 23 3 "int")
  57. # (field_identifier 26 27 2 "a3")
  58. # )
  59. # )
  60. # )
  61.  
  62. # addTypeObject()
  63.  
  64. # Output => A1* = object
  65. # a2*: cstring
  66. # a3*: cint
  67.  
  68. # nkTypeDef(
  69. # nkPostfix(
  70. # nkIdent("*"),
  71. # nkIdent("A1")
  72. # ),
  73. # nkEmpty(),
  74. # nkObjectTy(
  75. # nkEmpty(),
  76. # nkEmpty(),
  77. # nkRecList(
  78. # nkIdentDefs(
  79. # nkPostfix(
  80. # nkIdent("*"),
  81. # nkIdent("a2")
  82. # ),
  83. # nkIdent("cstring"),
  84. # nkEmpty()
  85. # ),
  86. # nkIdentDefs(
  87. # nkPostfix(
  88. # nkIdent("*"),
  89. # nkIdent("a3")
  90. # ),
  91. # nkIdent("cint"),
  92. # nkEmpty()
  93. # )
  94. # )
  95. # )
  96. # )
  97.  
  98. type
  99. A14* = object
  100. a1*: cstring
  101.  
  102. A1* = object
  103. a2*: cstring
  104. a3*: cint
Advertisement
Add Comment
Please, Sign In to add comment