modernc.org/cc@v1.0.1/v2/ast_test.go (about) 1 // Code generated by yy. DO NOT EDIT. 2 3 // Copyright 2017 The CC Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 7 package cc 8 9 import ( 10 "fmt" 11 ) 12 13 func ExampleAbstractDeclarator_pointer() { 14 fmt.Println(exampleAST(185, "\U00100000 ( _Atomic * )")) 15 // Output: 16 // &cc.AbstractDeclarator{ 17 // · Pointer: &cc.Pointer{ 18 // · · Token: '*', 19 // · }, 20 // } 21 } 22 23 func ExampleAbstractDeclarator_abstract() { 24 fmt.Println(exampleAST(186, "\U00100000 ( _Atomic ( ) )")) 25 // Output: 26 // &cc.AbstractDeclarator{ 27 // · Case: 1, 28 // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ 29 // · · Case: 1, 30 // · · Token: '(', 31 // · · Token2: ')', 32 // · }, 33 // } 34 } 35 36 func ExampleAbstractDeclaratorOpt_case0() { 37 fmt.Println(exampleAST(187, "\U00100000 ( _Atomic )") == (*AbstractDeclaratorOpt)(nil)) 38 // Output: 39 // true 40 } 41 42 func ExampleAbstractDeclaratorOpt_case1() { 43 fmt.Println(exampleAST(188, "\U00100000 ( _Atomic * )")) 44 // Output: 45 // &cc.AbstractDeclaratorOpt{ 46 // · AbstractDeclarator: &cc.AbstractDeclarator{ 47 // · · Pointer: &cc.Pointer{ 48 // · · · Token: '*', 49 // · · }, 50 // · }, 51 // } 52 } 53 54 func ExampleAlignmentSpecifier_typeName() { 55 fmt.Println(exampleAST(4, "\U00100001 _Alignas ( _Atomic ) (")) 56 // Output: 57 // &cc.AlignmentSpecifier{ 58 // · Token: ALIGNAS "_Alignas", 59 // · Token2: '(', 60 // · Token3: ')', 61 // · TypeName: &cc.TypeName{ 62 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 63 // · · · TypeQualifier: &cc.TypeQualifier{ 64 // · · · · Case: 3, 65 // · · · · Token: ATOMIC "_Atomic", 66 // · · · }, 67 // · · }, 68 // · }, 69 // } 70 } 71 72 func ExampleAlignmentSpecifier_constExpr() { 73 fmt.Println(exampleAST(5, "\U00100001 _Alignas ( 'a' ) (")) 74 // Output: 75 // &cc.AlignmentSpecifier{ 76 // · Case: 1, 77 // · ConstExpr: &cc.ConstExpr{ 78 // · · Expr: &cc.Expr{ 79 // · · · Case: ExprChar, 80 // · · · Token: CHARCONST "'a'", 81 // · · }, 82 // · }, 83 // · Token: ALIGNAS "_Alignas", 84 // · Token2: '(', 85 // · Token3: ')', 86 // } 87 } 88 89 func ExampleArgumentExprList_case0() { 90 fmt.Println(exampleAST(6, "\U00100000 'a' ( 'b' )")) 91 // Output: 92 // &cc.ArgumentExprList{ 93 // · Expr: &cc.Expr{ 94 // · · Case: ExprChar, 95 // · · Token: CHARCONST "'b'", 96 // · }, 97 // } 98 } 99 100 func ExampleArgumentExprList_case1() { 101 fmt.Println(exampleAST(7, "\U00100000 'a' ( 'b' , 'c' )")) 102 // Output: 103 // &cc.ArgumentExprList{ 104 // · ArgumentExprList: &cc.ArgumentExprList{ 105 // · · Case: 1, 106 // · · Expr: &cc.Expr{ 107 // · · · Case: ExprChar, 108 // · · · Token: CHARCONST "'c'", 109 // · · }, 110 // · · Token: ',', 111 // · }, 112 // · Expr: &cc.Expr{ 113 // · · Case: ExprChar, 114 // · · Token: CHARCONST "'b'", 115 // · }, 116 // } 117 } 118 119 func ExampleArgumentExprListOpt_case0() { 120 fmt.Println(exampleAST(8, "\U00100000 'a' ( )") == (*ArgumentExprListOpt)(nil)) 121 // Output: 122 // true 123 } 124 125 func ExampleArgumentExprListOpt_case1() { 126 fmt.Println(exampleAST(9, "\U00100000 'a' ( 'b' )")) 127 // Output: 128 // &cc.ArgumentExprListOpt{ 129 // · ArgumentExprList: &cc.ArgumentExprList{ 130 // · · Expr: &cc.Expr{ 131 // · · · Case: ExprChar, 132 // · · · Token: CHARCONST "'b'", 133 // · · }, 134 // · }, 135 // } 136 } 137 138 func ExampleBlockItem_decl() { 139 fmt.Println(exampleAST(229, "\U00100001 a { _Atomic ; !")) 140 // Output: 141 // &cc.BlockItem{ 142 // · Declaration: &cc.Declaration{ 143 // · · Scope: &cc.Scope{ 144 // · · · Parent: &cc.Scope{ 145 // · · · }, 146 // · · }, 147 // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 148 // · · · Case: 1, 149 // · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 150 // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 151 // · · · · · Case: 2, 152 // · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 153 // · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 154 // · · · · · · · Case: 3, 155 // · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 156 // · · · · · · · · Case: 3, 157 // · · · · · · · · Token: CHAR "char", 158 // · · · · · · · }, 159 // · · · · · · }, 160 // · · · · · }, 161 // · · · · · TypeQualifier: &cc.TypeQualifier{ 162 // · · · · · · Token: CONST "const", 163 // · · · · · }, 164 // · · · · }, 165 // · · · }, 166 // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 167 // · · · · Case: 3, 168 // · · · · Token: STATIC "static", 169 // · · · }, 170 // · · }, 171 // · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 172 // · · · InitDeclaratorList: &cc.InitDeclaratorList{ 173 // · · · · InitDeclarator: &cc.InitDeclarator{ 174 // · · · · · Case: 1, 175 // · · · · · Declarator: &cc.Declarator{ 176 // · · · · · · Linkage: LinkageNone, 177 // · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 178 // · · · · · · StorageDuration: StorageDurationAutomatic, 179 // · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 180 // · · · · · · · Case: DirectDeclaratorArray, 181 // · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 182 // · · · · · · · · Case: DirectDeclaratorIdent, 183 // · · · · · · · · Token: IDENTIFIER "__func__", 184 // · · · · · · · }, 185 // · · · · · · · Token: '[', 186 // · · · · · · · Token2: ']', 187 // · · · · · · }, 188 // · · · · · }, 189 // · · · · · Initializer: &cc.Initializer{ 190 // · · · · · · Case: 1, 191 // · · · · · · Expr: &cc.Expr{ 192 // · · · · · · · Case: ExprString, 193 // · · · · · · · Token: STRINGLITERAL "\"a\"", 194 // · · · · · · }, 195 // · · · · · }, 196 // · · · · · Token: '=', 197 // · · · · }, 198 // · · · }, 199 // · · }, 200 // · · Token: ';', 201 // · }, 202 // } 203 } 204 205 func ExampleBlockItem_stmt() { 206 fmt.Println(exampleAST(230, "\U00100001 a { ; !")) 207 // Output: 208 // &cc.BlockItem{ 209 // · Case: 1, 210 // · Stmt: &cc.Stmt{ 211 // · · Case: 1, 212 // · · ExprStmt: &cc.ExprStmt{ 213 // · · · Token: ';', 214 // · · }, 215 // · }, 216 // } 217 } 218 219 func ExampleBlockItemList_case0() { 220 fmt.Println(exampleAST(225, "\U00100001 a { ; !")) 221 // Output: 222 // &cc.BlockItemList{ 223 // · BlockItem: &cc.BlockItem{ 224 // · · Declaration: &cc.Declaration{ 225 // · · · Scope: &cc.Scope{ 226 // · · · · Parent: &cc.Scope{ 227 // · · · · }, 228 // · · · }, 229 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 230 // · · · · Case: 1, 231 // · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 232 // · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 233 // · · · · · · Case: 2, 234 // · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 235 // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 236 // · · · · · · · · Case: 3, 237 // · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 238 // · · · · · · · · · Case: 3, 239 // · · · · · · · · · Token: CHAR "char", 240 // · · · · · · · · }, 241 // · · · · · · · }, 242 // · · · · · · }, 243 // · · · · · · TypeQualifier: &cc.TypeQualifier{ 244 // · · · · · · · Token: CONST "const", 245 // · · · · · · }, 246 // · · · · · }, 247 // · · · · }, 248 // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 249 // · · · · · Case: 3, 250 // · · · · · Token: STATIC "static", 251 // · · · · }, 252 // · · · }, 253 // · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 254 // · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 255 // · · · · · InitDeclarator: &cc.InitDeclarator{ 256 // · · · · · · Case: 1, 257 // · · · · · · Declarator: &cc.Declarator{ 258 // · · · · · · · Linkage: LinkageNone, 259 // · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 260 // · · · · · · · StorageDuration: StorageDurationAutomatic, 261 // · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 262 // · · · · · · · · Case: DirectDeclaratorArray, 263 // · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 264 // · · · · · · · · · Case: DirectDeclaratorIdent, 265 // · · · · · · · · · Token: IDENTIFIER "__func__", 266 // · · · · · · · · }, 267 // · · · · · · · · Token: '[', 268 // · · · · · · · · Token2: ']', 269 // · · · · · · · }, 270 // · · · · · · }, 271 // · · · · · · Initializer: &cc.Initializer{ 272 // · · · · · · · Case: 1, 273 // · · · · · · · Expr: &cc.Expr{ 274 // · · · · · · · · Case: ExprString, 275 // · · · · · · · · Token: STRINGLITERAL "\"a\"", 276 // · · · · · · · }, 277 // · · · · · · }, 278 // · · · · · · Token: '=', 279 // · · · · · }, 280 // · · · · }, 281 // · · · }, 282 // · · · Token: ';', 283 // · · }, 284 // · }, 285 // } 286 } 287 288 func ExampleBlockItemList_case1() { 289 fmt.Println(exampleAST(226, "\U00100001 a { ; ; !")) 290 // Output: 291 // &cc.BlockItemList{ 292 // · BlockItem: &cc.BlockItem{ 293 // · · Declaration: &cc.Declaration{ 294 // · · · Scope: &cc.Scope{ 295 // · · · · Parent: &cc.Scope{ 296 // · · · · }, 297 // · · · }, 298 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 299 // · · · · Case: 1, 300 // · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 301 // · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 302 // · · · · · · Case: 2, 303 // · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 304 // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 305 // · · · · · · · · Case: 3, 306 // · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 307 // · · · · · · · · · Case: 3, 308 // · · · · · · · · · Token: CHAR "char", 309 // · · · · · · · · }, 310 // · · · · · · · }, 311 // · · · · · · }, 312 // · · · · · · TypeQualifier: &cc.TypeQualifier{ 313 // · · · · · · · Token: CONST "const", 314 // · · · · · · }, 315 // · · · · · }, 316 // · · · · }, 317 // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 318 // · · · · · Case: 3, 319 // · · · · · Token: STATIC "static", 320 // · · · · }, 321 // · · · }, 322 // · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 323 // · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 324 // · · · · · InitDeclarator: &cc.InitDeclarator{ 325 // · · · · · · Case: 1, 326 // · · · · · · Declarator: &cc.Declarator{ 327 // · · · · · · · Linkage: LinkageNone, 328 // · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 329 // · · · · · · · StorageDuration: StorageDurationAutomatic, 330 // · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 331 // · · · · · · · · Case: DirectDeclaratorArray, 332 // · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 333 // · · · · · · · · · Case: DirectDeclaratorIdent, 334 // · · · · · · · · · Token: IDENTIFIER "__func__", 335 // · · · · · · · · }, 336 // · · · · · · · · Token: '[', 337 // · · · · · · · · Token2: ']', 338 // · · · · · · · }, 339 // · · · · · · }, 340 // · · · · · · Initializer: &cc.Initializer{ 341 // · · · · · · · Case: 1, 342 // · · · · · · · Expr: &cc.Expr{ 343 // · · · · · · · · Case: ExprString, 344 // · · · · · · · · Token: STRINGLITERAL "\"a\"", 345 // · · · · · · · }, 346 // · · · · · · }, 347 // · · · · · · Token: '=', 348 // · · · · · }, 349 // · · · · }, 350 // · · · }, 351 // · · · Token: ';', 352 // · · }, 353 // · }, 354 // · BlockItemList: &cc.BlockItemList{ 355 // · · BlockItem: &cc.BlockItem{ 356 // · · · Case: 1, 357 // · · · Stmt: &cc.Stmt{ 358 // · · · · Case: 1, 359 // · · · · ExprStmt: &cc.ExprStmt{ 360 // · · · · · Token: ';', 361 // · · · · }, 362 // · · · }, 363 // · · }, 364 // · · Case: 1, 365 // · }, 366 // } 367 } 368 369 func ExampleBlockItemListOpt_case0() { 370 fmt.Println(exampleAST(227, "\U00100001 a { }") == (*BlockItemListOpt)(nil)) 371 // Output: 372 // false 373 } 374 375 func ExampleBlockItemListOpt_case1() { 376 fmt.Println(exampleAST(228, "\U00100001 a { ; }")) 377 // Output: 378 // &cc.BlockItemListOpt{ 379 // · BlockItemList: &cc.BlockItemList{ 380 // · · BlockItem: &cc.BlockItem{ 381 // · · · Declaration: &cc.Declaration{ 382 // · · · · Scope: &cc.Scope{ 383 // · · · · · Parent: &cc.Scope{ 384 // · · · · · }, 385 // · · · · }, 386 // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 387 // · · · · · Case: 1, 388 // · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 389 // · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 390 // · · · · · · · Case: 2, 391 // · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 392 // · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 393 // · · · · · · · · · Case: 3, 394 // · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 395 // · · · · · · · · · · Case: 3, 396 // · · · · · · · · · · Token: CHAR "char", 397 // · · · · · · · · · }, 398 // · · · · · · · · }, 399 // · · · · · · · }, 400 // · · · · · · · TypeQualifier: &cc.TypeQualifier{ 401 // · · · · · · · · Token: CONST "const", 402 // · · · · · · · }, 403 // · · · · · · }, 404 // · · · · · }, 405 // · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 406 // · · · · · · Case: 3, 407 // · · · · · · Token: STATIC "static", 408 // · · · · · }, 409 // · · · · }, 410 // · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 411 // · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 412 // · · · · · · InitDeclarator: &cc.InitDeclarator{ 413 // · · · · · · · Case: 1, 414 // · · · · · · · Declarator: &cc.Declarator{ 415 // · · · · · · · · Linkage: LinkageNone, 416 // · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 417 // · · · · · · · · StorageDuration: StorageDurationAutomatic, 418 // · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 419 // · · · · · · · · · Case: DirectDeclaratorArray, 420 // · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 421 // · · · · · · · · · · Case: DirectDeclaratorIdent, 422 // · · · · · · · · · · Token: IDENTIFIER "__func__", 423 // · · · · · · · · · }, 424 // · · · · · · · · · Token: '[', 425 // · · · · · · · · · Token2: ']', 426 // · · · · · · · · }, 427 // · · · · · · · }, 428 // · · · · · · · Initializer: &cc.Initializer{ 429 // · · · · · · · · Case: 1, 430 // · · · · · · · · Expr: &cc.Expr{ 431 // · · · · · · · · · Case: ExprString, 432 // · · · · · · · · · Token: STRINGLITERAL "\"a\"", 433 // · · · · · · · · }, 434 // · · · · · · · }, 435 // · · · · · · · Token: '=', 436 // · · · · · · }, 437 // · · · · · }, 438 // · · · · }, 439 // · · · · Token: ';', 440 // · · · }, 441 // · · }, 442 // · · BlockItemList: &cc.BlockItemList{ 443 // · · · BlockItem: &cc.BlockItem{ 444 // · · · · Case: 1, 445 // · · · · Stmt: &cc.Stmt{ 446 // · · · · · Case: 1, 447 // · · · · · ExprStmt: &cc.ExprStmt{ 448 // · · · · · · Token: ';', 449 // · · · · · }, 450 // · · · · }, 451 // · · · }, 452 // · · · Case: 1, 453 // · · }, 454 // · }, 455 // } 456 } 457 458 func ExampleCommaOpt_case0() { 459 fmt.Println(exampleAST(134, "\U00100000 ( _Atomic ) { }") == (*CommaOpt)(nil)) 460 // Output: 461 // true 462 } 463 464 func ExampleCommaOpt_case1() { 465 fmt.Println(exampleAST(135, "\U00100000 ( _Atomic ) { , }")) 466 // Output: 467 // &cc.CommaOpt{ 468 // · Token: ',', 469 // } 470 } 471 472 func ExampleCompoundStmt_case0() { 473 fmt.Println(exampleAST(224, "\U00100001 a { }")) 474 // Output: 475 // &cc.CompoundStmt{ 476 // · BlockItemListOpt: &cc.BlockItemListOpt{ 477 // · · BlockItemList: &cc.BlockItemList{ 478 // · · · BlockItem: &cc.BlockItem{ 479 // · · · · Declaration: &cc.Declaration{ 480 // · · · · · Scope: &cc.Scope{ 481 // · · · · · · Parent: &cc.Scope{ 482 // · · · · · · }, 483 // · · · · · }, 484 // · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 485 // · · · · · · Case: 1, 486 // · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 487 // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 488 // · · · · · · · · Case: 2, 489 // · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 490 // · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 491 // · · · · · · · · · · Case: 3, 492 // · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 493 // · · · · · · · · · · · Case: 3, 494 // · · · · · · · · · · · Token: CHAR "char", 495 // · · · · · · · · · · }, 496 // · · · · · · · · · }, 497 // · · · · · · · · }, 498 // · · · · · · · · TypeQualifier: &cc.TypeQualifier{ 499 // · · · · · · · · · Token: CONST "const", 500 // · · · · · · · · }, 501 // · · · · · · · }, 502 // · · · · · · }, 503 // · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 504 // · · · · · · · Case: 3, 505 // · · · · · · · Token: STATIC "static", 506 // · · · · · · }, 507 // · · · · · }, 508 // · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 509 // · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 510 // · · · · · · · InitDeclarator: &cc.InitDeclarator{ 511 // · · · · · · · · Case: 1, 512 // · · · · · · · · Declarator: &cc.Declarator{ 513 // · · · · · · · · · Linkage: LinkageNone, 514 // · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 515 // · · · · · · · · · StorageDuration: StorageDurationAutomatic, 516 // · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 517 // · · · · · · · · · · Case: DirectDeclaratorArray, 518 // · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 519 // · · · · · · · · · · · Case: DirectDeclaratorIdent, 520 // · · · · · · · · · · · Token: IDENTIFIER "__func__", 521 // · · · · · · · · · · }, 522 // · · · · · · · · · · Token: '[', 523 // · · · · · · · · · · Token2: ']', 524 // · · · · · · · · · }, 525 // · · · · · · · · }, 526 // · · · · · · · · Initializer: &cc.Initializer{ 527 // · · · · · · · · · Case: 1, 528 // · · · · · · · · · Expr: &cc.Expr{ 529 // · · · · · · · · · · Case: ExprString, 530 // · · · · · · · · · · Token: STRINGLITERAL "\"a\"", 531 // · · · · · · · · · }, 532 // · · · · · · · · }, 533 // · · · · · · · · Token: '=', 534 // · · · · · · · }, 535 // · · · · · · }, 536 // · · · · · }, 537 // · · · · · Token: ';', 538 // · · · · }, 539 // · · · }, 540 // · · }, 541 // · }, 542 // · Token: '{', 543 // · Token2: '}', 544 // } 545 } 546 547 func ExampleConstExpr_case0() { 548 fmt.Println(exampleAST(75, "\U00100000 'a'")) 549 // Output: 550 // &cc.ConstExpr{ 551 // · Expr: &cc.Expr{ 552 // · · Case: ExprChar, 553 // · · Token: CHARCONST "'a'", 554 // · }, 555 // } 556 } 557 558 func ExampleDeclaration_case0() { 559 fmt.Println(exampleAST(77, "\U00100001 _Atomic ;")) 560 // Output: 561 // &cc.Declaration{ 562 // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 563 // · · Case: 2, 564 // · · TypeQualifier: &cc.TypeQualifier{ 565 // · · · Case: 3, 566 // · · · Token: ATOMIC "_Atomic", 567 // · · }, 568 // · }, 569 // · Token: ';', 570 // } 571 } 572 573 func ExampleDeclarationList_case0() { 574 fmt.Println(exampleAST(253, "\U00100001 a _Atomic ; {")) 575 // Output: 576 // &cc.DeclarationList{ 577 // · Declaration: &cc.Declaration{ 578 // · · Scope: &cc.Scope{ 579 // · · }, 580 // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 581 // · · · Case: 2, 582 // · · · TypeQualifier: &cc.TypeQualifier{ 583 // · · · · Case: 3, 584 // · · · · Token: ATOMIC "_Atomic", 585 // · · · }, 586 // · · }, 587 // · · Token: ';', 588 // · }, 589 // } 590 } 591 592 func ExampleDeclarationList_case1() { 593 fmt.Println(exampleAST(254, "\U00100001 a _Atomic ; _Atomic ; {")) 594 // Output: 595 // &cc.DeclarationList{ 596 // · Declaration: &cc.Declaration{ 597 // · · Scope: &cc.Scope{ 598 // · · }, 599 // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 600 // · · · Case: 2, 601 // · · · TypeQualifier: &cc.TypeQualifier{ 602 // · · · · Case: 3, 603 // · · · · Token: ATOMIC "_Atomic", 604 // · · · }, 605 // · · }, 606 // · · Token: ';', 607 // · }, 608 // · DeclarationList: &cc.DeclarationList{ 609 // · · Case: 1, 610 // · · Declaration: &cc.Declaration{ 611 // · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 612 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 613 // · · · · Case: 2, 614 // · · · · TypeQualifier: &cc.TypeQualifier{ 615 // · · · · · Case: 3, 616 // · · · · · Token: ATOMIC "_Atomic", 617 // · · · · }, 618 // · · · }, 619 // · · · Token: ';', 620 // · · }, 621 // · }, 622 // } 623 } 624 625 func ExampleDeclarationListOpt_case0() { 626 fmt.Println(exampleAST(255, "\U00100001 a {") == (*DeclarationListOpt)(nil)) 627 // Output: 628 // true 629 } 630 631 func ExampleDeclarationListOpt_case1() { 632 fmt.Println(exampleAST(256, "\U00100001 a _Atomic ; {")) 633 // Output: 634 // &cc.DeclarationListOpt{ 635 // · DeclarationList: &cc.DeclarationList{ 636 // · · Declaration: &cc.Declaration{ 637 // · · · Scope: &cc.Scope{ 638 // · · · }, 639 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 640 // · · · · Case: 2, 641 // · · · · TypeQualifier: &cc.TypeQualifier{ 642 // · · · · · Case: 3, 643 // · · · · · Token: ATOMIC "_Atomic", 644 // · · · · }, 645 // · · · }, 646 // · · · Token: ';', 647 // · · }, 648 // · }, 649 // } 650 } 651 652 func ExampleDeclarationSpecifiers_func() { 653 fmt.Println(exampleAST(78, "\U00100001 inline (")) 654 // Output: 655 // &cc.DeclarationSpecifiers{ 656 // · FunctionSpecifier: &cc.FunctionSpecifier{ 657 // · · Token: INLINE "inline", 658 // · }, 659 // } 660 } 661 662 func ExampleDeclarationSpecifiers_storage() { 663 fmt.Println(exampleAST(79, "\U00100001 auto (")) 664 // Output: 665 // &cc.DeclarationSpecifiers{ 666 // · Case: 1, 667 // · StorageClassSpecifier: &cc.StorageClassSpecifier{ 668 // · · Token: AUTO "auto", 669 // · }, 670 // } 671 } 672 673 func ExampleDeclarationSpecifiers_qualifier() { 674 fmt.Println(exampleAST(80, "\U00100001 _Atomic (")) 675 // Output: 676 // &cc.DeclarationSpecifiers{ 677 // · Case: 2, 678 // · TypeQualifier: &cc.TypeQualifier{ 679 // · · Case: 3, 680 // · · Token: ATOMIC "_Atomic", 681 // · }, 682 // } 683 } 684 685 func ExampleDeclarationSpecifiers_specifier() { 686 fmt.Println(exampleAST(81, "\U00100001 _Bool (")) 687 // Output: 688 // &cc.DeclarationSpecifiers{ 689 // · Case: 3, 690 // · TypeSpecifier: &cc.TypeSpecifier{ 691 // · · Token: BOOL "_Bool", 692 // · }, 693 // } 694 } 695 696 func ExampleDeclarationSpecifiers_alignment() { 697 fmt.Println(exampleAST(82, "\U00100001 _Alignas ( _Atomic ) (")) 698 // Output: 699 // &cc.DeclarationSpecifiers{ 700 // · AlignmentSpecifier: &cc.AlignmentSpecifier{ 701 // · · Token: ALIGNAS "_Alignas", 702 // · · Token2: '(', 703 // · · Token3: ')', 704 // · · TypeName: &cc.TypeName{ 705 // · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 706 // · · · · TypeQualifier: &cc.TypeQualifier{ 707 // · · · · · Case: 3, 708 // · · · · · Token: ATOMIC "_Atomic", 709 // · · · · }, 710 // · · · }, 711 // · · }, 712 // · }, 713 // · Case: 4, 714 // } 715 } 716 717 func ExampleDeclarationSpecifiersOpt_case0() { 718 fmt.Println(exampleAST(83, "\U00100001 inline (") == (*DeclarationSpecifiersOpt)(nil)) 719 // Output: 720 // true 721 } 722 723 func ExampleDeclarationSpecifiersOpt_case1() { 724 fmt.Println(exampleAST(84, "\U00100001 _Bool _Atomic (")) 725 // Output: 726 // &cc.DeclarationSpecifiersOpt{ 727 // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 728 // · · Case: 2, 729 // · · TypeQualifier: &cc.TypeQualifier{ 730 // · · · Case: 3, 731 // · · · Token: ATOMIC "_Atomic", 732 // · · }, 733 // · }, 734 // } 735 } 736 737 func ExampleDeclarator_case0() { 738 fmt.Println(exampleAST(148, "\U00100001 a )")) 739 // Output: 740 // &cc.Declarator{ 741 // · Linkage: LinkageNone, 742 // · Scope: &cc.Scope{ 743 // · }, 744 // · StorageDuration: StorageDurationAutomatic, 745 // · DirectDeclarator: &cc.DirectDeclarator{ 746 // · · Case: DirectDeclaratorIdent, 747 // · · Token: IDENTIFIER "a", 748 // · }, 749 // } 750 } 751 752 func ExampleDeclaratorOpt_case0() { 753 fmt.Println(exampleAST(151, "\U00100001 struct { _Atomic :") == (*DeclaratorOpt)(nil)) 754 // Output: 755 // true 756 } 757 758 func ExampleDeclaratorOpt_case1() { 759 fmt.Println(exampleAST(152, "\U00100001 struct { _Atomic a :")) 760 // Output: 761 // &cc.DeclaratorOpt{ 762 // · Declarator: &cc.Declarator{ 763 // · · Linkage: LinkageNone, 764 // · · Scope: &cc.Scope{ 765 // · · }, 766 // · · StorageDuration: StorageDurationAutomatic, 767 // · · DirectDeclarator: &cc.DirectDeclarator{ 768 // · · · Case: DirectDeclaratorIdent, 769 // · · · Token: IDENTIFIER "a", 770 // · · }, 771 // · }, 772 // } 773 } 774 775 func ExampleDesignation_case0() { 776 fmt.Println(exampleAST(206, "\U00100001 _Atomic a = { . b = !")) 777 // Output: 778 // &cc.Designation{ 779 // · DesignatorList: &cc.DesignatorList{ 780 // · · Designator: &cc.Designator{ 781 // · · · Token: '.', 782 // · · · Token2: IDENTIFIER "b", 783 // · · }, 784 // · }, 785 // · Token: '=', 786 // } 787 } 788 789 func ExampleDesignator_field() { 790 fmt.Println(exampleAST(209, "\U00100000 ( _Atomic ) { . a .")) 791 // Output: 792 // &cc.Designator{ 793 // · Token: '.', 794 // · Token2: IDENTIFIER "a", 795 // } 796 } 797 798 func ExampleDesignator_index() { 799 fmt.Println(exampleAST(210, "\U00100000 ( _Atomic ) { [ 'a' ] .")) 800 // Output: 801 // &cc.Designator{ 802 // · Case: 1, 803 // · ConstExpr: &cc.ConstExpr{ 804 // · · Expr: &cc.Expr{ 805 // · · · Case: ExprChar, 806 // · · · Token: CHARCONST "'a'", 807 // · · }, 808 // · }, 809 // · Token: '[', 810 // · Token2: ']', 811 // } 812 } 813 814 func ExampleDesignatorList_case0() { 815 fmt.Println(exampleAST(207, "\U00100001 _Atomic a = { . b .")) 816 // Output: 817 // &cc.DesignatorList{ 818 // · Designator: &cc.Designator{ 819 // · · Token: '.', 820 // · · Token2: IDENTIFIER "b", 821 // · }, 822 // } 823 } 824 825 func ExampleDesignatorList_case1() { 826 fmt.Println(exampleAST(208, "\U00100001 _Atomic a = { . b . c .")) 827 // Output: 828 // &cc.DesignatorList{ 829 // · Designator: &cc.Designator{ 830 // · · Token: '.', 831 // · · Token2: IDENTIFIER "b", 832 // · }, 833 // · DesignatorList: &cc.DesignatorList{ 834 // · · Case: 1, 835 // · · Designator: &cc.Designator{ 836 // · · · Token: '.', 837 // · · · Token2: IDENTIFIER "c", 838 // · · }, 839 // · }, 840 // } 841 } 842 843 func ExampleDirectAbstractDeclarator_abstract() { 844 fmt.Println(exampleAST(189, "\U00100000 ( _Atomic ( * ) (")) 845 // Output: 846 // &cc.DirectAbstractDeclarator{ 847 // · AbstractDeclarator: &cc.AbstractDeclarator{ 848 // · · Pointer: &cc.Pointer{ 849 // · · · Token: '*', 850 // · · }, 851 // · }, 852 // · Token: '(', 853 // · Token2: ')', 854 // } 855 } 856 857 func ExampleDirectAbstractDeclarator_paramList() { 858 fmt.Println(exampleAST(190, "\U00100000 ( _Atomic ( ) (")) 859 // Output: 860 // &cc.DirectAbstractDeclarator{ 861 // · Case: 1, 862 // · Token: '(', 863 // · Token2: ')', 864 // } 865 } 866 867 func ExampleDirectAbstractDeclarator_dFn() { 868 fmt.Println(exampleAST(191, "\U00100000 ( _Atomic ( ) ( ) (")) 869 // Output: 870 // &cc.DirectAbstractDeclarator{ 871 // · Case: 2, 872 // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ 873 // · · Case: 1, 874 // · · Token: '(', 875 // · · Token2: ')', 876 // · }, 877 // · Token: '(', 878 // · Token2: ')', 879 // } 880 } 881 882 func ExampleDirectAbstractDeclarator_dArrSize() { 883 fmt.Println(exampleAST(192, "\U00100000 ( _Atomic [ static 'a' ] (")) 884 // Output: 885 // &cc.DirectAbstractDeclarator{ 886 // · Case: 3, 887 // · Expr: &cc.Expr{ 888 // · · Case: ExprChar, 889 // · · Token: CHARCONST "'a'", 890 // · }, 891 // · Token: '[', 892 // · Token2: STATIC "static", 893 // · Token3: ']', 894 // } 895 } 896 897 func ExampleDirectAbstractDeclarator_dArrVL() { 898 fmt.Println(exampleAST(193, "\U00100000 ( _Atomic [ * ] (")) 899 // Output: 900 // &cc.DirectAbstractDeclarator{ 901 // · Case: 4, 902 // · Token: '[', 903 // · Token2: '*', 904 // · Token3: ']', 905 // } 906 } 907 908 func ExampleDirectAbstractDeclarator_dArr() { 909 fmt.Println(exampleAST(194, "\U00100000 ( _Atomic [ ] (")) 910 // Output: 911 // &cc.DirectAbstractDeclarator{ 912 // · Case: 5, 913 // · Token: '[', 914 // · Token2: ']', 915 // } 916 } 917 918 func ExampleDirectAbstractDeclarator_dArrSize2() { 919 fmt.Println(exampleAST(195, "\U00100000 ( _Atomic [ _Atomic static 'a' ] (")) 920 // Output: 921 // &cc.DirectAbstractDeclarator{ 922 // · Case: 6, 923 // · Expr: &cc.Expr{ 924 // · · Case: ExprChar, 925 // · · Token: CHARCONST "'a'", 926 // · }, 927 // · Token: '[', 928 // · Token2: STATIC "static", 929 // · Token3: ']', 930 // · TypeQualifierList: &cc.TypeQualifierList{ 931 // · · TypeQualifier: &cc.TypeQualifier{ 932 // · · · Case: 3, 933 // · · · Token: ATOMIC "_Atomic", 934 // · · }, 935 // · }, 936 // } 937 } 938 939 func ExampleDirectAbstractDeclarator_dArr2() { 940 fmt.Println(exampleAST(196, "\U00100000 ( _Atomic [ _Atomic ] (")) 941 // Output: 942 // &cc.DirectAbstractDeclarator{ 943 // · Case: 7, 944 // · Token: '[', 945 // · Token2: ']', 946 // · TypeQualifierList: &cc.TypeQualifierList{ 947 // · · TypeQualifier: &cc.TypeQualifier{ 948 // · · · Case: 3, 949 // · · · Token: ATOMIC "_Atomic", 950 // · · }, 951 // · }, 952 // } 953 } 954 955 func ExampleDirectAbstractDeclaratorOpt_case0() { 956 fmt.Println(exampleAST(197, "\U00100000 ( _Atomic [") == (*DirectAbstractDeclaratorOpt)(nil)) 957 // Output: 958 // true 959 } 960 961 func ExampleDirectAbstractDeclaratorOpt_case1() { 962 fmt.Println(exampleAST(198, "\U00100000 ( _Atomic ( ) [")) 963 // Output: 964 // &cc.DirectAbstractDeclaratorOpt{ 965 // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ 966 // · · Case: 1, 967 // · · Token: '(', 968 // · · Token2: ')', 969 // · }, 970 // } 971 } 972 973 func ExampleDirectDeclarator_paren() { 974 fmt.Println(exampleAST(153, "\U00100001 ( a ) (")) 975 // Output: 976 // &cc.DirectDeclarator{ 977 // · Case: DirectDeclaratorParen, 978 // · Declarator: &cc.Declarator{ 979 // · · Linkage: LinkageNone, 980 // · · Scope: &cc.Scope{ 981 // · · }, 982 // · · StorageDuration: StorageDurationAutomatic, 983 // · · Embedded: true, 984 // · · DirectDeclarator: &cc.DirectDeclarator{ 985 // · · · Case: DirectDeclaratorIdent, 986 // · · · Token: IDENTIFIER "a", 987 // · · }, 988 // · }, 989 // · Token: '(', 990 // · Token2: ')', 991 // } 992 } 993 994 func ExampleDirectDeclarator_parameters() { 995 fmt.Println(exampleAST(156, "\U00100001 a ( ) (")) 996 // Output: 997 // &cc.DirectDeclarator{ 998 // · Case: DirectDeclaratorParameters, 999 // · DirectDeclarator: &cc.DirectDeclarator{ 1000 // · · Case: DirectDeclaratorIdent, 1001 // · · Token: IDENTIFIER "a", 1002 // · }, 1003 // · Token: '(', 1004 // · Token2: ')', 1005 // } 1006 } 1007 1008 func ExampleDirectDeclarator_arraySize() { 1009 fmt.Println(exampleAST(157, "\U00100001 a [ static 'b' ] (")) 1010 // Output: 1011 // &cc.DirectDeclarator{ 1012 // · Case: DirectDeclaratorArraySize, 1013 // · DirectDeclarator: &cc.DirectDeclarator{ 1014 // · · Case: DirectDeclaratorIdent, 1015 // · · Token: IDENTIFIER "a", 1016 // · }, 1017 // · Expr: &cc.Expr{ 1018 // · · Case: ExprChar, 1019 // · · Token: CHARCONST "'b'", 1020 // · }, 1021 // · Token: '[', 1022 // · Token2: STATIC "static", 1023 // · Token3: ']', 1024 // } 1025 } 1026 1027 func ExampleDirectDeclarator_arraySize2() { 1028 fmt.Println(exampleAST(158, "\U00100001 a [ _Atomic static 'b' ] (")) 1029 // Output: 1030 // &cc.DirectDeclarator{ 1031 // · Case: DirectDeclaratorArraySize2, 1032 // · DirectDeclarator: &cc.DirectDeclarator{ 1033 // · · Case: DirectDeclaratorIdent, 1034 // · · Token: IDENTIFIER "a", 1035 // · }, 1036 // · Expr: &cc.Expr{ 1037 // · · Case: ExprChar, 1038 // · · Token: CHARCONST "'b'", 1039 // · }, 1040 // · Token: '[', 1041 // · Token2: STATIC "static", 1042 // · Token3: ']', 1043 // · TypeQualifierList: &cc.TypeQualifierList{ 1044 // · · TypeQualifier: &cc.TypeQualifier{ 1045 // · · · Case: 3, 1046 // · · · Token: ATOMIC "_Atomic", 1047 // · · }, 1048 // · }, 1049 // } 1050 } 1051 1052 func ExampleDirectDeclarator_arrayVar() { 1053 fmt.Println(exampleAST(159, "\U00100001 a [ * ] (")) 1054 // Output: 1055 // &cc.DirectDeclarator{ 1056 // · Case: DirectDeclaratorArrayVar, 1057 // · DirectDeclarator: &cc.DirectDeclarator{ 1058 // · · Case: DirectDeclaratorIdent, 1059 // · · Token: IDENTIFIER "a", 1060 // · }, 1061 // · Token: '[', 1062 // · Token2: '*', 1063 // · Token3: ']', 1064 // } 1065 } 1066 1067 func ExampleDirectDeclarator_array() { 1068 fmt.Println(exampleAST(160, "\U00100001 a [ ] (")) 1069 // Output: 1070 // &cc.DirectDeclarator{ 1071 // · Case: DirectDeclaratorArray, 1072 // · DirectDeclarator: &cc.DirectDeclarator{ 1073 // · · Case: DirectDeclaratorIdent, 1074 // · · Token: IDENTIFIER "a", 1075 // · }, 1076 // · Token: '[', 1077 // · Token2: ']', 1078 // } 1079 } 1080 1081 func ExampleDirectDeclarator_ident() { 1082 fmt.Println(exampleAST(161, "\U00100001 a (")) 1083 // Output: 1084 // &cc.DirectDeclarator{ 1085 // · Case: DirectDeclaratorIdent, 1086 // · Token: IDENTIFIER "a", 1087 // } 1088 } 1089 1090 func ExampleEnumSpecifier_tag() { 1091 fmt.Println(exampleAST(136, "\U00100001 enum a (")) 1092 // Output: 1093 // &cc.EnumSpecifier{ 1094 // · Token: ENUM "enum", 1095 // · Token2: IDENTIFIER "a", 1096 // } 1097 } 1098 1099 func ExampleEnumSpecifier_define() { 1100 fmt.Println(exampleAST(137, "\U00100001 enum { a } (")) 1101 // Output: 1102 // &cc.EnumSpecifier{ 1103 // · Case: 1, 1104 // · EnumeratorList: &cc.EnumeratorList{ 1105 // · · Enumerator: &cc.Enumerator{ 1106 // · · · EnumerationConstant: &cc.EnumerationConstant{ 1107 // · · · · Token: IDENTIFIER "a", 1108 // · · · }, 1109 // · · }, 1110 // · }, 1111 // · Token: ENUM "enum", 1112 // · Token2: '{', 1113 // · Token3: '}', 1114 // } 1115 } 1116 1117 func ExampleEnumerationConstant_case0() { 1118 fmt.Println(exampleAST(3, "\U00100001 enum { a ,")) 1119 // Output: 1120 // &cc.EnumerationConstant{ 1121 // · Token: IDENTIFIER "a", 1122 // } 1123 } 1124 1125 func ExampleEnumerator_base() { 1126 fmt.Println(exampleAST(140, "\U00100001 enum { a ,")) 1127 // Output: 1128 // &cc.Enumerator{ 1129 // · EnumerationConstant: &cc.EnumerationConstant{ 1130 // · · Token: IDENTIFIER "a", 1131 // · }, 1132 // } 1133 } 1134 1135 func ExampleEnumerator_init() { 1136 fmt.Println(exampleAST(141, "\U00100001 enum { a = 'b' ,")) 1137 // Output: 1138 // &cc.Enumerator{ 1139 // · Case: 1, 1140 // · ConstExpr: &cc.ConstExpr{ 1141 // · · Expr: &cc.Expr{ 1142 // · · · Case: ExprChar, 1143 // · · · Token: CHARCONST "'b'", 1144 // · · }, 1145 // · }, 1146 // · EnumerationConstant: &cc.EnumerationConstant{ 1147 // · · Token: IDENTIFIER "a", 1148 // · }, 1149 // · Token: '=', 1150 // } 1151 } 1152 1153 func ExampleEnumeratorList_case0() { 1154 fmt.Println(exampleAST(138, "\U00100001 enum { a ,")) 1155 // Output: 1156 // &cc.EnumeratorList{ 1157 // · Enumerator: &cc.Enumerator{ 1158 // · · EnumerationConstant: &cc.EnumerationConstant{ 1159 // · · · Token: IDENTIFIER "a", 1160 // · · }, 1161 // · }, 1162 // } 1163 } 1164 1165 func ExampleEnumeratorList_case1() { 1166 fmt.Println(exampleAST(139, "\U00100001 enum { a , b ,")) 1167 // Output: 1168 // &cc.EnumeratorList{ 1169 // · Enumerator: &cc.Enumerator{ 1170 // · · EnumerationConstant: &cc.EnumerationConstant{ 1171 // · · · Token: IDENTIFIER "a", 1172 // · · }, 1173 // · }, 1174 // · EnumeratorList: &cc.EnumeratorList{ 1175 // · · Case: 1, 1176 // · · Enumerator: &cc.Enumerator{ 1177 // · · · EnumerationConstant: &cc.EnumerationConstant{ 1178 // · · · · Token: IDENTIFIER "b", 1179 // · · · }, 1180 // · · }, 1181 // · · Token: ',', 1182 // · }, 1183 // } 1184 } 1185 1186 func ExampleExpr_preInc() { 1187 fmt.Println(exampleAST(10, "\U00100000 ++ 'a'")) 1188 // Output: 1189 // &cc.Expr{ 1190 // · Case: ExprPreInc, 1191 // · Expr: &cc.Expr{ 1192 // · · Case: ExprChar, 1193 // · · Token: CHARCONST "'a'", 1194 // · }, 1195 // · Token: INC, 1196 // } 1197 } 1198 1199 func ExampleExpr_preDec() { 1200 fmt.Println(exampleAST(11, "\U00100000 -- 'a'")) 1201 // Output: 1202 // &cc.Expr{ 1203 // · Case: ExprPreDec, 1204 // · Expr: &cc.Expr{ 1205 // · · Case: ExprChar, 1206 // · · Token: CHARCONST "'a'", 1207 // · }, 1208 // · Token: DEC, 1209 // } 1210 } 1211 1212 func ExampleExpr_alignofType() { 1213 fmt.Println(exampleAST(12, "\U00100000 _Alignof ( _Atomic )")) 1214 // Output: 1215 // &cc.Expr{ 1216 // · Case: ExprAlignofType, 1217 // · Token: ALIGNOF "_Alignof", 1218 // · Token2: '(', 1219 // · Token3: ')', 1220 // · TypeName: &cc.TypeName{ 1221 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 1222 // · · · TypeQualifier: &cc.TypeQualifier{ 1223 // · · · · Case: 3, 1224 // · · · · Token: ATOMIC "_Atomic", 1225 // · · · }, 1226 // · · }, 1227 // · }, 1228 // } 1229 } 1230 1231 func ExampleExpr_alignofExpr() { 1232 fmt.Println(exampleAST(13, "\U00100000 _Alignof 'a'")) 1233 // Output: 1234 // &cc.Expr{ 1235 // · Case: ExprAlignofExpr, 1236 // · Expr: &cc.Expr{ 1237 // · · Case: ExprChar, 1238 // · · Token: CHARCONST "'a'", 1239 // · }, 1240 // · Token: ALIGNOF "_Alignof", 1241 // } 1242 } 1243 1244 func ExampleExpr_sizeofType() { 1245 fmt.Println(exampleAST(14, "\U00100000 sizeof ( _Atomic )")) 1246 // Output: 1247 // &cc.Expr{ 1248 // · Case: ExprSizeofType, 1249 // · Token: SIZEOF "sizeof", 1250 // · Token2: '(', 1251 // · Token3: ')', 1252 // · TypeName: &cc.TypeName{ 1253 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 1254 // · · · TypeQualifier: &cc.TypeQualifier{ 1255 // · · · · Case: 3, 1256 // · · · · Token: ATOMIC "_Atomic", 1257 // · · · }, 1258 // · · }, 1259 // · }, 1260 // } 1261 } 1262 1263 func ExampleExpr_sizeofExpr() { 1264 fmt.Println(exampleAST(15, "\U00100000 sizeof 'a'")) 1265 // Output: 1266 // &cc.Expr{ 1267 // · Case: ExprSizeofExpr, 1268 // · Expr: &cc.Expr{ 1269 // · · Case: ExprChar, 1270 // · · Token: CHARCONST "'a'", 1271 // · }, 1272 // · Token: SIZEOF "sizeof", 1273 // } 1274 } 1275 1276 func ExampleExpr_not() { 1277 fmt.Println(exampleAST(16, "\U00100000 ! 'a'")) 1278 // Output: 1279 // &cc.Expr{ 1280 // · Case: ExprNot, 1281 // · Expr: &cc.Expr{ 1282 // · · Case: ExprChar, 1283 // · · Token: CHARCONST "'a'", 1284 // · }, 1285 // · Token: '!', 1286 // } 1287 } 1288 1289 func ExampleExpr_addrof() { 1290 fmt.Println(exampleAST(17, "\U00100000 & 'a'")) 1291 // Output: 1292 // &cc.Expr{ 1293 // · Case: ExprAddrof, 1294 // · Expr: &cc.Expr{ 1295 // · · Case: ExprChar, 1296 // · · Token: CHARCONST "'a'", 1297 // · }, 1298 // · Token: '&', 1299 // } 1300 } 1301 1302 func ExampleExpr_statement() { 1303 fmt.Println(exampleAST(18, "\U00100000 ( { } )")) 1304 // Output: 1305 // &cc.Expr{ 1306 // · Case: ExprStatement, 1307 // · CompoundStmt: &cc.CompoundStmt{ 1308 // · · Token: '{', 1309 // · · Token2: '}', 1310 // · }, 1311 // · Token: '(', 1312 // · Token2: ')', 1313 // } 1314 } 1315 1316 func ExampleExpr_pExprList() { 1317 fmt.Println(exampleAST(19, "\U00100000 ( 'a' )")) 1318 // Output: 1319 // &cc.Expr{ 1320 // · Case: ExprPExprList, 1321 // · ExprList: &cc.ExprList{ 1322 // · · Expr: &cc.Expr{ 1323 // · · · Case: ExprChar, 1324 // · · · Token: CHARCONST "'a'", 1325 // · · }, 1326 // · }, 1327 // · Token: '(', 1328 // · Token2: ')', 1329 // } 1330 } 1331 1332 func ExampleExpr_compLit() { 1333 fmt.Println(exampleAST(20, "\U00100000 ( _Atomic ) { }")) 1334 // Output: 1335 // &cc.Expr{ 1336 // · Case: ExprCompLit, 1337 // · Token: '(', 1338 // · Token2: ')', 1339 // · Token3: '{', 1340 // · Token4: '}', 1341 // · TypeName: &cc.TypeName{ 1342 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 1343 // · · · TypeQualifier: &cc.TypeQualifier{ 1344 // · · · · Case: 3, 1345 // · · · · Token: ATOMIC "_Atomic", 1346 // · · · }, 1347 // · · }, 1348 // · }, 1349 // } 1350 } 1351 1352 func ExampleExpr_cast() { 1353 fmt.Println(exampleAST(21, "\U00100000 ( _Atomic ) 'a'")) 1354 // Output: 1355 // &cc.Expr{ 1356 // · Case: ExprCast, 1357 // · Expr: &cc.Expr{ 1358 // · · Case: ExprChar, 1359 // · · Token: CHARCONST "'a'", 1360 // · }, 1361 // · Token: '(', 1362 // · Token2: ')', 1363 // · TypeName: &cc.TypeName{ 1364 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 1365 // · · · TypeQualifier: &cc.TypeQualifier{ 1366 // · · · · Case: 3, 1367 // · · · · Token: ATOMIC "_Atomic", 1368 // · · · }, 1369 // · · }, 1370 // · }, 1371 // } 1372 } 1373 1374 func ExampleExpr_deref() { 1375 fmt.Println(exampleAST(22, "\U00100000 * 'a'")) 1376 // Output: 1377 // &cc.Expr{ 1378 // · Case: ExprDeref, 1379 // · Expr: &cc.Expr{ 1380 // · · Case: ExprChar, 1381 // · · Token: CHARCONST "'a'", 1382 // · }, 1383 // · Token: '*', 1384 // } 1385 } 1386 1387 func ExampleExpr_unaryPlus() { 1388 fmt.Println(exampleAST(23, "\U00100000 + 'a'")) 1389 // Output: 1390 // &cc.Expr{ 1391 // · Case: ExprUnaryPlus, 1392 // · Expr: &cc.Expr{ 1393 // · · Case: ExprChar, 1394 // · · Token: CHARCONST "'a'", 1395 // · }, 1396 // · Token: '+', 1397 // } 1398 } 1399 1400 func ExampleExpr_unaryMinus() { 1401 fmt.Println(exampleAST(24, "\U00100000 - 'a'")) 1402 // Output: 1403 // &cc.Expr{ 1404 // · Case: ExprUnaryMinus, 1405 // · Expr: &cc.Expr{ 1406 // · · Case: ExprChar, 1407 // · · Token: CHARCONST "'a'", 1408 // · }, 1409 // · Token: '-', 1410 // } 1411 } 1412 1413 func ExampleExpr_cpl() { 1414 fmt.Println(exampleAST(25, "\U00100000 ~ 'a'")) 1415 // Output: 1416 // &cc.Expr{ 1417 // · Case: ExprCpl, 1418 // · Expr: &cc.Expr{ 1419 // · · Case: ExprChar, 1420 // · · Token: CHARCONST "'a'", 1421 // · }, 1422 // · Token: '~', 1423 // } 1424 } 1425 1426 func ExampleExpr_char() { 1427 fmt.Println(exampleAST(26, "\U00100000 'a'")) 1428 // Output: 1429 // &cc.Expr{ 1430 // · Case: ExprChar, 1431 // · Token: CHARCONST "'a'", 1432 // } 1433 } 1434 1435 func ExampleExpr_ne() { 1436 fmt.Println(exampleAST(27, "\U00100000 'a' != 'b'")) 1437 // Output: 1438 // &cc.Expr{ 1439 // · Case: ExprNe, 1440 // · Expr: &cc.Expr{ 1441 // · · Case: ExprChar, 1442 // · · Token: CHARCONST "'a'", 1443 // · }, 1444 // · Expr2: &cc.Expr{ 1445 // · · Case: ExprChar, 1446 // · · Token: CHARCONST "'b'", 1447 // · }, 1448 // · Token: NEQ, 1449 // } 1450 } 1451 1452 func ExampleExpr_modAssign() { 1453 fmt.Println(exampleAST(28, "\U00100000 'a' %= 'b'")) 1454 // Output: 1455 // &cc.Expr{ 1456 // · Case: ExprModAssign, 1457 // · Expr: &cc.Expr{ 1458 // · · Case: ExprChar, 1459 // · · Token: CHARCONST "'a'", 1460 // · }, 1461 // · Expr2: &cc.Expr{ 1462 // · · Case: ExprChar, 1463 // · · Token: CHARCONST "'b'", 1464 // · }, 1465 // · Token: MODASSIGN, 1466 // } 1467 } 1468 1469 func ExampleExpr_lAnd() { 1470 fmt.Println(exampleAST(29, "\U00100000 'a' && 'b'")) 1471 // Output: 1472 // &cc.Expr{ 1473 // · Case: ExprLAnd, 1474 // · Expr: &cc.Expr{ 1475 // · · Case: ExprChar, 1476 // · · Token: CHARCONST "'a'", 1477 // · }, 1478 // · Expr2: &cc.Expr{ 1479 // · · Case: ExprChar, 1480 // · · Token: CHARCONST "'b'", 1481 // · }, 1482 // · Token: ANDAND, 1483 // } 1484 } 1485 1486 func ExampleExpr_andAssign() { 1487 fmt.Println(exampleAST(30, "\U00100000 'a' &= 'b'")) 1488 // Output: 1489 // &cc.Expr{ 1490 // · Case: ExprAndAssign, 1491 // · Expr: &cc.Expr{ 1492 // · · Case: ExprChar, 1493 // · · Token: CHARCONST "'a'", 1494 // · }, 1495 // · Expr2: &cc.Expr{ 1496 // · · Case: ExprChar, 1497 // · · Token: CHARCONST "'b'", 1498 // · }, 1499 // · Token: ANDASSIGN, 1500 // } 1501 } 1502 1503 func ExampleExpr_mulAssign() { 1504 fmt.Println(exampleAST(31, "\U00100000 'a' *= 'b'")) 1505 // Output: 1506 // &cc.Expr{ 1507 // · Case: ExprMulAssign, 1508 // · Expr: &cc.Expr{ 1509 // · · Case: ExprChar, 1510 // · · Token: CHARCONST "'a'", 1511 // · }, 1512 // · Expr2: &cc.Expr{ 1513 // · · Case: ExprChar, 1514 // · · Token: CHARCONST "'b'", 1515 // · }, 1516 // · Token: MULASSIGN, 1517 // } 1518 } 1519 1520 func ExampleExpr_postInc() { 1521 fmt.Println(exampleAST(32, "\U00100000 'a' ++")) 1522 // Output: 1523 // &cc.Expr{ 1524 // · Case: ExprPostInc, 1525 // · Expr: &cc.Expr{ 1526 // · · Case: ExprChar, 1527 // · · Token: CHARCONST "'a'", 1528 // · }, 1529 // · Token: INC, 1530 // } 1531 } 1532 1533 func ExampleExpr_addAssign() { 1534 fmt.Println(exampleAST(33, "\U00100000 'a' += 'b'")) 1535 // Output: 1536 // &cc.Expr{ 1537 // · Case: ExprAddAssign, 1538 // · Expr: &cc.Expr{ 1539 // · · Case: ExprChar, 1540 // · · Token: CHARCONST "'a'", 1541 // · }, 1542 // · Expr2: &cc.Expr{ 1543 // · · Case: ExprChar, 1544 // · · Token: CHARCONST "'b'", 1545 // · }, 1546 // · Token: ADDASSIGN, 1547 // } 1548 } 1549 1550 func ExampleExpr_postDec() { 1551 fmt.Println(exampleAST(34, "\U00100000 'a' --")) 1552 // Output: 1553 // &cc.Expr{ 1554 // · Case: ExprPostDec, 1555 // · Expr: &cc.Expr{ 1556 // · · Case: ExprChar, 1557 // · · Token: CHARCONST "'a'", 1558 // · }, 1559 // · Token: DEC, 1560 // } 1561 } 1562 1563 func ExampleExpr_subAssign() { 1564 fmt.Println(exampleAST(35, "\U00100000 'a' -= 'b'")) 1565 // Output: 1566 // &cc.Expr{ 1567 // · Case: ExprSubAssign, 1568 // · Expr: &cc.Expr{ 1569 // · · Case: ExprChar, 1570 // · · Token: CHARCONST "'a'", 1571 // · }, 1572 // · Expr2: &cc.Expr{ 1573 // · · Case: ExprChar, 1574 // · · Token: CHARCONST "'b'", 1575 // · }, 1576 // · Token: SUBASSIGN, 1577 // } 1578 } 1579 1580 func ExampleExpr_pSelect() { 1581 fmt.Println(exampleAST(36, "\U00100000 'a' -> b")) 1582 // Output: 1583 // &cc.Expr{ 1584 // · Case: ExprPSelect, 1585 // · Expr: &cc.Expr{ 1586 // · · Case: ExprChar, 1587 // · · Token: CHARCONST "'a'", 1588 // · }, 1589 // · Token: ARROW, 1590 // · Token2: IDENTIFIER "b", 1591 // } 1592 } 1593 1594 func ExampleExpr_divAssign() { 1595 fmt.Println(exampleAST(37, "\U00100000 'a' /= 'b'")) 1596 // Output: 1597 // &cc.Expr{ 1598 // · Case: ExprDivAssign, 1599 // · Expr: &cc.Expr{ 1600 // · · Case: ExprChar, 1601 // · · Token: CHARCONST "'a'", 1602 // · }, 1603 // · Expr2: &cc.Expr{ 1604 // · · Case: ExprChar, 1605 // · · Token: CHARCONST "'b'", 1606 // · }, 1607 // · Token: DIVASSIGN, 1608 // } 1609 } 1610 1611 func ExampleExpr_lsh() { 1612 fmt.Println(exampleAST(38, "\U00100000 'a' << 'b'")) 1613 // Output: 1614 // &cc.Expr{ 1615 // · Case: ExprLsh, 1616 // · Expr: &cc.Expr{ 1617 // · · Case: ExprChar, 1618 // · · Token: CHARCONST "'a'", 1619 // · }, 1620 // · Expr2: &cc.Expr{ 1621 // · · Case: ExprChar, 1622 // · · Token: CHARCONST "'b'", 1623 // · }, 1624 // · Token: LSH, 1625 // } 1626 } 1627 1628 func ExampleExpr_lshAssign() { 1629 fmt.Println(exampleAST(39, "\U00100000 'a' <<= 'b'")) 1630 // Output: 1631 // &cc.Expr{ 1632 // · Case: ExprLshAssign, 1633 // · Expr: &cc.Expr{ 1634 // · · Case: ExprChar, 1635 // · · Token: CHARCONST "'a'", 1636 // · }, 1637 // · Expr2: &cc.Expr{ 1638 // · · Case: ExprChar, 1639 // · · Token: CHARCONST "'b'", 1640 // · }, 1641 // · Token: LSHASSIGN, 1642 // } 1643 } 1644 1645 func ExampleExpr_le() { 1646 fmt.Println(exampleAST(40, "\U00100000 'a' <= 'b'")) 1647 // Output: 1648 // &cc.Expr{ 1649 // · Case: ExprLe, 1650 // · Expr: &cc.Expr{ 1651 // · · Case: ExprChar, 1652 // · · Token: CHARCONST "'a'", 1653 // · }, 1654 // · Expr2: &cc.Expr{ 1655 // · · Case: ExprChar, 1656 // · · Token: CHARCONST "'b'", 1657 // · }, 1658 // · Token: LEQ, 1659 // } 1660 } 1661 1662 func ExampleExpr_eq() { 1663 fmt.Println(exampleAST(41, "\U00100000 'a' == 'b'")) 1664 // Output: 1665 // &cc.Expr{ 1666 // · Case: ExprEq, 1667 // · Expr: &cc.Expr{ 1668 // · · Case: ExprChar, 1669 // · · Token: CHARCONST "'a'", 1670 // · }, 1671 // · Expr2: &cc.Expr{ 1672 // · · Case: ExprChar, 1673 // · · Token: CHARCONST "'b'", 1674 // · }, 1675 // · Token: EQ, 1676 // } 1677 } 1678 1679 func ExampleExpr_ge() { 1680 fmt.Println(exampleAST(42, "\U00100000 'a' >= 'b'")) 1681 // Output: 1682 // &cc.Expr{ 1683 // · Case: ExprGe, 1684 // · Expr: &cc.Expr{ 1685 // · · Case: ExprChar, 1686 // · · Token: CHARCONST "'a'", 1687 // · }, 1688 // · Expr2: &cc.Expr{ 1689 // · · Case: ExprChar, 1690 // · · Token: CHARCONST "'b'", 1691 // · }, 1692 // · Token: GEQ, 1693 // } 1694 } 1695 1696 func ExampleExpr_rsh() { 1697 fmt.Println(exampleAST(43, "\U00100000 'a' >> 'b'")) 1698 // Output: 1699 // &cc.Expr{ 1700 // · Case: ExprRsh, 1701 // · Expr: &cc.Expr{ 1702 // · · Case: ExprChar, 1703 // · · Token: CHARCONST "'a'", 1704 // · }, 1705 // · Expr2: &cc.Expr{ 1706 // · · Case: ExprChar, 1707 // · · Token: CHARCONST "'b'", 1708 // · }, 1709 // · Token: RSH, 1710 // } 1711 } 1712 1713 func ExampleExpr_rshAssign() { 1714 fmt.Println(exampleAST(44, "\U00100000 'a' >>= 'b'")) 1715 // Output: 1716 // &cc.Expr{ 1717 // · Case: ExprRshAssign, 1718 // · Expr: &cc.Expr{ 1719 // · · Case: ExprChar, 1720 // · · Token: CHARCONST "'a'", 1721 // · }, 1722 // · Expr2: &cc.Expr{ 1723 // · · Case: ExprChar, 1724 // · · Token: CHARCONST "'b'", 1725 // · }, 1726 // · Token: RSHASSIGN, 1727 // } 1728 } 1729 1730 func ExampleExpr_xorAssign() { 1731 fmt.Println(exampleAST(45, "\U00100000 'a' ^= 'b'")) 1732 // Output: 1733 // &cc.Expr{ 1734 // · Case: ExprXorAssign, 1735 // · Expr: &cc.Expr{ 1736 // · · Case: ExprChar, 1737 // · · Token: CHARCONST "'a'", 1738 // · }, 1739 // · Expr2: &cc.Expr{ 1740 // · · Case: ExprChar, 1741 // · · Token: CHARCONST "'b'", 1742 // · }, 1743 // · Token: XORASSIGN, 1744 // } 1745 } 1746 1747 func ExampleExpr_orAssign() { 1748 fmt.Println(exampleAST(46, "\U00100000 'a' |= 'b'")) 1749 // Output: 1750 // &cc.Expr{ 1751 // · Case: ExprOrAssign, 1752 // · Expr: &cc.Expr{ 1753 // · · Case: ExprChar, 1754 // · · Token: CHARCONST "'a'", 1755 // · }, 1756 // · Expr2: &cc.Expr{ 1757 // · · Case: ExprChar, 1758 // · · Token: CHARCONST "'b'", 1759 // · }, 1760 // · Token: ORASSIGN, 1761 // } 1762 } 1763 1764 func ExampleExpr_lOr() { 1765 fmt.Println(exampleAST(47, "\U00100000 'a' || 'b'")) 1766 // Output: 1767 // &cc.Expr{ 1768 // · Case: ExprLOr, 1769 // · Expr: &cc.Expr{ 1770 // · · Case: ExprChar, 1771 // · · Token: CHARCONST "'a'", 1772 // · }, 1773 // · Expr2: &cc.Expr{ 1774 // · · Case: ExprChar, 1775 // · · Token: CHARCONST "'b'", 1776 // · }, 1777 // · Token: OROR, 1778 // } 1779 } 1780 1781 func ExampleExpr_mod() { 1782 fmt.Println(exampleAST(48, "\U00100000 'a' % 'b'")) 1783 // Output: 1784 // &cc.Expr{ 1785 // · Case: ExprMod, 1786 // · Expr: &cc.Expr{ 1787 // · · Case: ExprChar, 1788 // · · Token: CHARCONST "'a'", 1789 // · }, 1790 // · Expr2: &cc.Expr{ 1791 // · · Case: ExprChar, 1792 // · · Token: CHARCONST "'b'", 1793 // · }, 1794 // · Token: '%', 1795 // } 1796 } 1797 1798 func ExampleExpr_and() { 1799 fmt.Println(exampleAST(49, "\U00100000 'a' & 'b'")) 1800 // Output: 1801 // &cc.Expr{ 1802 // · Case: ExprAnd, 1803 // · Expr: &cc.Expr{ 1804 // · · Case: ExprChar, 1805 // · · Token: CHARCONST "'a'", 1806 // · }, 1807 // · Expr2: &cc.Expr{ 1808 // · · Case: ExprChar, 1809 // · · Token: CHARCONST "'b'", 1810 // · }, 1811 // · Token: '&', 1812 // } 1813 } 1814 1815 func ExampleExpr_call() { 1816 fmt.Println(exampleAST(50, "\U00100000 'a' ( )")) 1817 // Output: 1818 // &cc.Expr{ 1819 // · Case: ExprCall, 1820 // · Expr: &cc.Expr{ 1821 // · · Case: ExprChar, 1822 // · · Token: CHARCONST "'a'", 1823 // · }, 1824 // · Token: '(', 1825 // · Token2: ')', 1826 // } 1827 } 1828 1829 func ExampleExpr_mul() { 1830 fmt.Println(exampleAST(51, "\U00100000 'a' * 'b'")) 1831 // Output: 1832 // &cc.Expr{ 1833 // · Case: ExprMul, 1834 // · Expr: &cc.Expr{ 1835 // · · Case: ExprChar, 1836 // · · Token: CHARCONST "'a'", 1837 // · }, 1838 // · Expr2: &cc.Expr{ 1839 // · · Case: ExprChar, 1840 // · · Token: CHARCONST "'b'", 1841 // · }, 1842 // · Token: '*', 1843 // } 1844 } 1845 1846 func ExampleExpr_add() { 1847 fmt.Println(exampleAST(52, "\U00100000 'a' + 'b'")) 1848 // Output: 1849 // &cc.Expr{ 1850 // · Case: ExprAdd, 1851 // · Expr: &cc.Expr{ 1852 // · · Case: ExprChar, 1853 // · · Token: CHARCONST "'a'", 1854 // · }, 1855 // · Expr2: &cc.Expr{ 1856 // · · Case: ExprChar, 1857 // · · Token: CHARCONST "'b'", 1858 // · }, 1859 // · Token: '+', 1860 // } 1861 } 1862 1863 func ExampleExpr_sub() { 1864 fmt.Println(exampleAST(53, "\U00100000 'a' - 'b'")) 1865 // Output: 1866 // &cc.Expr{ 1867 // · Case: ExprSub, 1868 // · Expr: &cc.Expr{ 1869 // · · Case: ExprChar, 1870 // · · Token: CHARCONST "'a'", 1871 // · }, 1872 // · Expr2: &cc.Expr{ 1873 // · · Case: ExprChar, 1874 // · · Token: CHARCONST "'b'", 1875 // · }, 1876 // · Token: '-', 1877 // } 1878 } 1879 1880 func ExampleExpr_select() { 1881 fmt.Println(exampleAST(54, "\U00100000 'a' . b")) 1882 // Output: 1883 // &cc.Expr{ 1884 // · Case: ExprSelect, 1885 // · Expr: &cc.Expr{ 1886 // · · Case: ExprChar, 1887 // · · Token: CHARCONST "'a'", 1888 // · }, 1889 // · Token: '.', 1890 // · Token2: IDENTIFIER "b", 1891 // } 1892 } 1893 1894 func ExampleExpr_div() { 1895 fmt.Println(exampleAST(55, "\U00100000 'a' / 'b'")) 1896 // Output: 1897 // &cc.Expr{ 1898 // · Case: ExprDiv, 1899 // · Expr: &cc.Expr{ 1900 // · · Case: ExprChar, 1901 // · · Token: CHARCONST "'a'", 1902 // · }, 1903 // · Expr2: &cc.Expr{ 1904 // · · Case: ExprChar, 1905 // · · Token: CHARCONST "'b'", 1906 // · }, 1907 // · Token: '/', 1908 // } 1909 } 1910 1911 func ExampleExpr_lt() { 1912 fmt.Println(exampleAST(56, "\U00100000 'a' < 'b'")) 1913 // Output: 1914 // &cc.Expr{ 1915 // · Case: ExprLt, 1916 // · Expr: &cc.Expr{ 1917 // · · Case: ExprChar, 1918 // · · Token: CHARCONST "'a'", 1919 // · }, 1920 // · Expr2: &cc.Expr{ 1921 // · · Case: ExprChar, 1922 // · · Token: CHARCONST "'b'", 1923 // · }, 1924 // · Token: '<', 1925 // } 1926 } 1927 1928 func ExampleExpr_assign() { 1929 fmt.Println(exampleAST(57, "\U00100000 'a' = 'b'")) 1930 // Output: 1931 // &cc.Expr{ 1932 // · Case: ExprAssign, 1933 // · Expr: &cc.Expr{ 1934 // · · Case: ExprChar, 1935 // · · Token: CHARCONST "'a'", 1936 // · }, 1937 // · Expr2: &cc.Expr{ 1938 // · · Case: ExprChar, 1939 // · · Token: CHARCONST "'b'", 1940 // · }, 1941 // · Token: '=', 1942 // } 1943 } 1944 1945 func ExampleExpr_gt() { 1946 fmt.Println(exampleAST(58, "\U00100000 'a' > 'b'")) 1947 // Output: 1948 // &cc.Expr{ 1949 // · Case: ExprGt, 1950 // · Expr: &cc.Expr{ 1951 // · · Case: ExprChar, 1952 // · · Token: CHARCONST "'a'", 1953 // · }, 1954 // · Expr2: &cc.Expr{ 1955 // · · Case: ExprChar, 1956 // · · Token: CHARCONST "'b'", 1957 // · }, 1958 // · Token: '>', 1959 // } 1960 } 1961 1962 func ExampleExpr_cond() { 1963 fmt.Println(exampleAST(59, "\U00100000 'a' ? 'b' : 'c'")) 1964 // Output: 1965 // &cc.Expr{ 1966 // · Case: ExprCond, 1967 // · Expr: &cc.Expr{ 1968 // · · Case: ExprChar, 1969 // · · Token: CHARCONST "'a'", 1970 // · }, 1971 // · Expr2: &cc.Expr{ 1972 // · · Case: ExprChar, 1973 // · · Token: CHARCONST "'c'", 1974 // · }, 1975 // · ExprList: &cc.ExprList{ 1976 // · · Expr: &cc.Expr{ 1977 // · · · Case: ExprChar, 1978 // · · · Token: CHARCONST "'b'", 1979 // · · }, 1980 // · }, 1981 // · Token: '?', 1982 // · Token2: ':', 1983 // } 1984 } 1985 1986 func ExampleExpr_index() { 1987 fmt.Println(exampleAST(60, "\U00100000 'a' [ 'b' ]")) 1988 // Output: 1989 // &cc.Expr{ 1990 // · Case: ExprIndex, 1991 // · Expr: &cc.Expr{ 1992 // · · Case: ExprChar, 1993 // · · Token: CHARCONST "'a'", 1994 // · }, 1995 // · ExprList: &cc.ExprList{ 1996 // · · Expr: &cc.Expr{ 1997 // · · · Case: ExprChar, 1998 // · · · Token: CHARCONST "'b'", 1999 // · · }, 2000 // · }, 2001 // · Token: '[', 2002 // · Token2: ']', 2003 // } 2004 } 2005 2006 func ExampleExpr_xor() { 2007 fmt.Println(exampleAST(61, "\U00100000 'a' ^ 'b'")) 2008 // Output: 2009 // &cc.Expr{ 2010 // · Case: ExprXor, 2011 // · Expr: &cc.Expr{ 2012 // · · Case: ExprChar, 2013 // · · Token: CHARCONST "'a'", 2014 // · }, 2015 // · Expr2: &cc.Expr{ 2016 // · · Case: ExprChar, 2017 // · · Token: CHARCONST "'b'", 2018 // · }, 2019 // · Token: '^', 2020 // } 2021 } 2022 2023 func ExampleExpr_or() { 2024 fmt.Println(exampleAST(62, "\U00100000 'a' | 'b'")) 2025 // Output: 2026 // &cc.Expr{ 2027 // · Case: ExprOr, 2028 // · Expr: &cc.Expr{ 2029 // · · Case: ExprChar, 2030 // · · Token: CHARCONST "'a'", 2031 // · }, 2032 // · Expr2: &cc.Expr{ 2033 // · · Case: ExprChar, 2034 // · · Token: CHARCONST "'b'", 2035 // · }, 2036 // · Token: '|', 2037 // } 2038 } 2039 2040 func ExampleExpr_float() { 2041 fmt.Println(exampleAST(63, "\U00100000 1.97")) 2042 // Output: 2043 // &cc.Expr{ 2044 // · Case: ExprFloat, 2045 // · Token: FLOATCONST "1.97", 2046 // } 2047 } 2048 2049 func ExampleExpr_ident() { 2050 fmt.Println(exampleAST(64, "\U00100001 a { b %")) 2051 // Output: 2052 // &cc.Expr{ 2053 // · Scope: &cc.Scope{ 2054 // · · Parent: &cc.Scope{ 2055 // · · }, 2056 // · }, 2057 // · Case: ExprIdent, 2058 // · Token: IDENTIFIER "b", 2059 // } 2060 } 2061 2062 func ExampleExpr_int() { 2063 fmt.Println(exampleAST(65, "\U00100000 97")) 2064 // Output: 2065 // &cc.Expr{ 2066 // · Case: ExprInt, 2067 // · Token: INTCONST "97", 2068 // } 2069 } 2070 2071 func ExampleExpr_lChar() { 2072 fmt.Println(exampleAST(66, "\U00100000 L'a'")) 2073 // Output: 2074 // &cc.Expr{ 2075 // · Case: ExprLChar, 2076 // · Token: LONGCHARCONST "L'a'", 2077 // } 2078 } 2079 2080 func ExampleExpr_lString() { 2081 fmt.Println(exampleAST(67, "\U00100000 L\"a\"")) 2082 // Output: 2083 // &cc.Expr{ 2084 // · Case: ExprLString, 2085 // · Token: LONGSTRINGLITERAL "L\"a\"", 2086 // } 2087 } 2088 2089 func ExampleExpr_string() { 2090 fmt.Println(exampleAST(68, "\U00100000 \"a\"")) 2091 // Output: 2092 // &cc.Expr{ 2093 // · Case: ExprString, 2094 // · Token: STRINGLITERAL "\"a\"", 2095 // } 2096 } 2097 2098 func ExampleExprList_case0() { 2099 fmt.Println(exampleAST(71, "\U00100000 ( 'a' )")) 2100 // Output: 2101 // &cc.ExprList{ 2102 // · Expr: &cc.Expr{ 2103 // · · Case: ExprChar, 2104 // · · Token: CHARCONST "'a'", 2105 // · }, 2106 // } 2107 } 2108 2109 func ExampleExprList_case1() { 2110 fmt.Println(exampleAST(72, "\U00100000 ( 'a' , 'b' )")) 2111 // Output: 2112 // &cc.ExprList{ 2113 // · Expr: &cc.Expr{ 2114 // · · Case: ExprChar, 2115 // · · Token: CHARCONST "'a'", 2116 // · }, 2117 // · ExprList: &cc.ExprList{ 2118 // · · Case: 1, 2119 // · · Expr: &cc.Expr{ 2120 // · · · Case: ExprChar, 2121 // · · · Token: CHARCONST "'b'", 2122 // · · }, 2123 // · · Token: ',', 2124 // · }, 2125 // } 2126 } 2127 2128 func ExampleExprListOpt_case0() { 2129 fmt.Println(exampleAST(73, "\U00100001 a { ;") == (*ExprListOpt)(nil)) 2130 // Output: 2131 // true 2132 } 2133 2134 func ExampleExprListOpt_case1() { 2135 fmt.Println(exampleAST(74, "\U00100001 a { 'b' )")) 2136 // Output: 2137 // &cc.ExprListOpt{ 2138 // · ExprList: &cc.ExprList{ 2139 // · · Expr: &cc.Expr{ 2140 // · · · Case: ExprChar, 2141 // · · · Token: CHARCONST "'b'", 2142 // · · }, 2143 // · }, 2144 // } 2145 } 2146 2147 func ExampleExprOpt_case0() { 2148 fmt.Println(exampleAST(69, "\U00100000 ( _Atomic [ ]") == (*ExprOpt)(nil)) 2149 // Output: 2150 // true 2151 } 2152 2153 func ExampleExprOpt_case1() { 2154 fmt.Println(exampleAST(70, "\U00100001 a [ 'b' ]")) 2155 // Output: 2156 // &cc.ExprOpt{ 2157 // · Expr: &cc.Expr{ 2158 // · · Case: ExprChar, 2159 // · · Token: CHARCONST "'b'", 2160 // · }, 2161 // } 2162 } 2163 2164 func ExampleExprStmt_case0() { 2165 fmt.Println(exampleAST(231, "\U00100001 a { ; !")) 2166 // Output: 2167 // &cc.ExprStmt{ 2168 // · Token: ';', 2169 // } 2170 } 2171 2172 func ExampleExternalDeclaration_decl() { 2173 fmt.Println(exampleAST(245, "\U00100001 _Atomic ;")) 2174 // Output: 2175 // &cc.ExternalDeclaration{ 2176 // · Declaration: &cc.Declaration{ 2177 // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2178 // · · · Case: 2, 2179 // · · · TypeQualifier: &cc.TypeQualifier{ 2180 // · · · · Case: 3, 2181 // · · · · Token: ATOMIC "_Atomic", 2182 // · · · }, 2183 // · · }, 2184 // · · Token: ';', 2185 // · }, 2186 // } 2187 } 2188 2189 func ExampleExternalDeclaration_func() { 2190 fmt.Println(exampleAST(246, "\U00100001 a { }")) 2191 // Output: 2192 // &cc.ExternalDeclaration{ 2193 // · Case: 1, 2194 // · FunctionDefinition: &cc.FunctionDefinition{ 2195 // · · Case: 1, 2196 // · · Declarator: &cc.Declarator{ 2197 // · · · FunctionDefinition: &cc.FunctionDefinition{ /* recursive/repetitive pointee not shown */ }, 2198 // · · · Linkage: LinkageNone, 2199 // · · · Scope: &cc.Scope{ 2200 // · · · }, 2201 // · · · StorageDuration: StorageDurationAutomatic, 2202 // · · · DirectDeclarator: &cc.DirectDeclarator{ 2203 // · · · · Case: DirectDeclaratorIdent, 2204 // · · · · Token: IDENTIFIER "a", 2205 // · · · }, 2206 // · · }, 2207 // · · FunctionBody: &cc.FunctionBody{ 2208 // · · · CompoundStmt: &cc.CompoundStmt{ 2209 // · · · · BlockItemListOpt: &cc.BlockItemListOpt{ 2210 // · · · · · BlockItemList: &cc.BlockItemList{ 2211 // · · · · · · BlockItem: &cc.BlockItem{ 2212 // · · · · · · · Declaration: &cc.Declaration{ 2213 // · · · · · · · · Scope: &cc.Scope{ 2214 // · · · · · · · · · Parent: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2215 // · · · · · · · · }, 2216 // · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2217 // · · · · · · · · · Case: 1, 2218 // · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2219 // · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2220 // · · · · · · · · · · · Case: 2, 2221 // · · · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2222 // · · · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2223 // · · · · · · · · · · · · · Case: 3, 2224 // · · · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 2225 // · · · · · · · · · · · · · · Case: 3, 2226 // · · · · · · · · · · · · · · Token: CHAR "char", 2227 // · · · · · · · · · · · · · }, 2228 // · · · · · · · · · · · · }, 2229 // · · · · · · · · · · · }, 2230 // · · · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ 2231 // · · · · · · · · · · · · Token: CONST "const", 2232 // · · · · · · · · · · · }, 2233 // · · · · · · · · · · }, 2234 // · · · · · · · · · }, 2235 // · · · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 2236 // · · · · · · · · · · Case: 3, 2237 // · · · · · · · · · · Token: STATIC "static", 2238 // · · · · · · · · · }, 2239 // · · · · · · · · }, 2240 // · · · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 2241 // · · · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 2242 // · · · · · · · · · · InitDeclarator: &cc.InitDeclarator{ 2243 // · · · · · · · · · · · Case: 1, 2244 // · · · · · · · · · · · Declarator: &cc.Declarator{ 2245 // · · · · · · · · · · · · Linkage: LinkageNone, 2246 // · · · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2247 // · · · · · · · · · · · · StorageDuration: StorageDurationAutomatic, 2248 // · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2249 // · · · · · · · · · · · · · Case: DirectDeclaratorArray, 2250 // · · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2251 // · · · · · · · · · · · · · · Case: DirectDeclaratorIdent, 2252 // · · · · · · · · · · · · · · Token: IDENTIFIER "__func__", 2253 // · · · · · · · · · · · · · }, 2254 // · · · · · · · · · · · · · Token: '[', 2255 // · · · · · · · · · · · · · Token2: ']', 2256 // · · · · · · · · · · · · }, 2257 // · · · · · · · · · · · }, 2258 // · · · · · · · · · · · Initializer: &cc.Initializer{ 2259 // · · · · · · · · · · · · Case: 1, 2260 // · · · · · · · · · · · · Expr: &cc.Expr{ 2261 // · · · · · · · · · · · · · Case: ExprString, 2262 // · · · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", 2263 // · · · · · · · · · · · · }, 2264 // · · · · · · · · · · · }, 2265 // · · · · · · · · · · · Token: '=', 2266 // · · · · · · · · · · }, 2267 // · · · · · · · · · }, 2268 // · · · · · · · · }, 2269 // · · · · · · · · Token: ';', 2270 // · · · · · · · }, 2271 // · · · · · · }, 2272 // · · · · · }, 2273 // · · · · }, 2274 // · · · · Token: '{', 2275 // · · · · Token2: '}', 2276 // · · · }, 2277 // · · }, 2278 // · }, 2279 // } 2280 } 2281 2282 func ExampleExternalDeclarationList_case0() { 2283 fmt.Println(exampleAST(243, "\U00100001 _Atomic ;")) 2284 // Output: 2285 // &cc.ExternalDeclarationList{ 2286 // · ExternalDeclaration: &cc.ExternalDeclaration{ 2287 // · · Declaration: &cc.Declaration{ 2288 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2289 // · · · · Case: 2, 2290 // · · · · TypeQualifier: &cc.TypeQualifier{ 2291 // · · · · · Case: 3, 2292 // · · · · · Token: ATOMIC "_Atomic", 2293 // · · · · }, 2294 // · · · }, 2295 // · · · Token: ';', 2296 // · · }, 2297 // · }, 2298 // } 2299 } 2300 2301 func ExampleExternalDeclarationList_case1() { 2302 fmt.Println(exampleAST(244, "\U00100001 _Atomic ; _Atomic ;")) 2303 // Output: 2304 // &cc.ExternalDeclarationList{ 2305 // · ExternalDeclaration: &cc.ExternalDeclaration{ 2306 // · · Declaration: &cc.Declaration{ 2307 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2308 // · · · · Case: 2, 2309 // · · · · TypeQualifier: &cc.TypeQualifier{ 2310 // · · · · · Case: 3, 2311 // · · · · · Token: ATOMIC "_Atomic", 2312 // · · · · }, 2313 // · · · }, 2314 // · · · Token: ';', 2315 // · · }, 2316 // · }, 2317 // · ExternalDeclarationList: &cc.ExternalDeclarationList{ 2318 // · · Case: 1, 2319 // · · ExternalDeclaration: &cc.ExternalDeclaration{ 2320 // · · · Declaration: &cc.Declaration{ 2321 // · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2322 // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2323 // · · · · · Case: 2, 2324 // · · · · · TypeQualifier: &cc.TypeQualifier{ 2325 // · · · · · · Case: 3, 2326 // · · · · · · Token: ATOMIC "_Atomic", 2327 // · · · · · }, 2328 // · · · · }, 2329 // · · · · Token: ';', 2330 // · · · }, 2331 // · · }, 2332 // · }, 2333 // } 2334 } 2335 2336 func ExampleFunctionBody_case0() { 2337 fmt.Println(exampleAST(252, "\U00100001 a { }")) 2338 // Output: 2339 // &cc.FunctionBody{ 2340 // · CompoundStmt: &cc.CompoundStmt{ 2341 // · · BlockItemListOpt: &cc.BlockItemListOpt{ 2342 // · · · BlockItemList: &cc.BlockItemList{ 2343 // · · · · BlockItem: &cc.BlockItem{ 2344 // · · · · · Declaration: &cc.Declaration{ 2345 // · · · · · · Scope: &cc.Scope{ 2346 // · · · · · · · Parent: &cc.Scope{ 2347 // · · · · · · · }, 2348 // · · · · · · }, 2349 // · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2350 // · · · · · · · Case: 1, 2351 // · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2352 // · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2353 // · · · · · · · · · Case: 2, 2354 // · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2355 // · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2356 // · · · · · · · · · · · Case: 3, 2357 // · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 2358 // · · · · · · · · · · · · Case: 3, 2359 // · · · · · · · · · · · · Token: CHAR "char", 2360 // · · · · · · · · · · · }, 2361 // · · · · · · · · · · }, 2362 // · · · · · · · · · }, 2363 // · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ 2364 // · · · · · · · · · · Token: CONST "const", 2365 // · · · · · · · · · }, 2366 // · · · · · · · · }, 2367 // · · · · · · · }, 2368 // · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 2369 // · · · · · · · · Case: 3, 2370 // · · · · · · · · Token: STATIC "static", 2371 // · · · · · · · }, 2372 // · · · · · · }, 2373 // · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 2374 // · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 2375 // · · · · · · · · InitDeclarator: &cc.InitDeclarator{ 2376 // · · · · · · · · · Case: 1, 2377 // · · · · · · · · · Declarator: &cc.Declarator{ 2378 // · · · · · · · · · · Linkage: LinkageNone, 2379 // · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2380 // · · · · · · · · · · StorageDuration: StorageDurationAutomatic, 2381 // · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2382 // · · · · · · · · · · · Case: DirectDeclaratorArray, 2383 // · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2384 // · · · · · · · · · · · · Case: DirectDeclaratorIdent, 2385 // · · · · · · · · · · · · Token: IDENTIFIER "__func__", 2386 // · · · · · · · · · · · }, 2387 // · · · · · · · · · · · Token: '[', 2388 // · · · · · · · · · · · Token2: ']', 2389 // · · · · · · · · · · }, 2390 // · · · · · · · · · }, 2391 // · · · · · · · · · Initializer: &cc.Initializer{ 2392 // · · · · · · · · · · Case: 1, 2393 // · · · · · · · · · · Expr: &cc.Expr{ 2394 // · · · · · · · · · · · Case: ExprString, 2395 // · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", 2396 // · · · · · · · · · · }, 2397 // · · · · · · · · · }, 2398 // · · · · · · · · · Token: '=', 2399 // · · · · · · · · }, 2400 // · · · · · · · }, 2401 // · · · · · · }, 2402 // · · · · · · Token: ';', 2403 // · · · · · }, 2404 // · · · · }, 2405 // · · · }, 2406 // · · }, 2407 // · · Token: '{', 2408 // · · Token2: '}', 2409 // · }, 2410 // } 2411 } 2412 2413 func ExampleFunctionDefinition_spec() { 2414 fmt.Println(exampleAST(248, "\U00100001 _Atomic a { }")) 2415 // Output: 2416 // &cc.FunctionDefinition{ 2417 // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2418 // · · Case: 2, 2419 // · · TypeQualifier: &cc.TypeQualifier{ 2420 // · · · Case: 3, 2421 // · · · Token: ATOMIC "_Atomic", 2422 // · · }, 2423 // · }, 2424 // · Declarator: &cc.Declarator{ 2425 // · · FunctionDefinition: &cc.FunctionDefinition{ /* recursive/repetitive pointee not shown */ }, 2426 // · · Linkage: LinkageNone, 2427 // · · Scope: &cc.Scope{ 2428 // · · }, 2429 // · · StorageDuration: StorageDurationAutomatic, 2430 // · · DirectDeclarator: &cc.DirectDeclarator{ 2431 // · · · Case: DirectDeclaratorIdent, 2432 // · · · Token: IDENTIFIER "a", 2433 // · · }, 2434 // · }, 2435 // · FunctionBody: &cc.FunctionBody{ 2436 // · · CompoundStmt: &cc.CompoundStmt{ 2437 // · · · BlockItemListOpt: &cc.BlockItemListOpt{ 2438 // · · · · BlockItemList: &cc.BlockItemList{ 2439 // · · · · · BlockItem: &cc.BlockItem{ 2440 // · · · · · · Declaration: &cc.Declaration{ 2441 // · · · · · · · Scope: &cc.Scope{ 2442 // · · · · · · · · Parent: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2443 // · · · · · · · }, 2444 // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2445 // · · · · · · · · Case: 1, 2446 // · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2447 // · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2448 // · · · · · · · · · · Case: 2, 2449 // · · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2450 // · · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2451 // · · · · · · · · · · · · Case: 3, 2452 // · · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 2453 // · · · · · · · · · · · · · Case: 3, 2454 // · · · · · · · · · · · · · Token: CHAR "char", 2455 // · · · · · · · · · · · · }, 2456 // · · · · · · · · · · · }, 2457 // · · · · · · · · · · }, 2458 // · · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ 2459 // · · · · · · · · · · · Token: CONST "const", 2460 // · · · · · · · · · · }, 2461 // · · · · · · · · · }, 2462 // · · · · · · · · }, 2463 // · · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 2464 // · · · · · · · · · Case: 3, 2465 // · · · · · · · · · Token: STATIC "static", 2466 // · · · · · · · · }, 2467 // · · · · · · · }, 2468 // · · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 2469 // · · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 2470 // · · · · · · · · · InitDeclarator: &cc.InitDeclarator{ 2471 // · · · · · · · · · · Case: 1, 2472 // · · · · · · · · · · Declarator: &cc.Declarator{ 2473 // · · · · · · · · · · · Linkage: LinkageNone, 2474 // · · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2475 // · · · · · · · · · · · StorageDuration: StorageDurationAutomatic, 2476 // · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2477 // · · · · · · · · · · · · Case: DirectDeclaratorArray, 2478 // · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2479 // · · · · · · · · · · · · · Case: DirectDeclaratorIdent, 2480 // · · · · · · · · · · · · · Token: IDENTIFIER "__func__", 2481 // · · · · · · · · · · · · }, 2482 // · · · · · · · · · · · · Token: '[', 2483 // · · · · · · · · · · · · Token2: ']', 2484 // · · · · · · · · · · · }, 2485 // · · · · · · · · · · }, 2486 // · · · · · · · · · · Initializer: &cc.Initializer{ 2487 // · · · · · · · · · · · Case: 1, 2488 // · · · · · · · · · · · Expr: &cc.Expr{ 2489 // · · · · · · · · · · · · Case: ExprString, 2490 // · · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", 2491 // · · · · · · · · · · · }, 2492 // · · · · · · · · · · }, 2493 // · · · · · · · · · · Token: '=', 2494 // · · · · · · · · · }, 2495 // · · · · · · · · }, 2496 // · · · · · · · }, 2497 // · · · · · · · Token: ';', 2498 // · · · · · · }, 2499 // · · · · · }, 2500 // · · · · }, 2501 // · · · }, 2502 // · · · Token: '{', 2503 // · · · Token2: '}', 2504 // · · }, 2505 // · }, 2506 // } 2507 } 2508 2509 func ExampleFunctionDefinition_int() { 2510 fmt.Println(exampleAST(250, "\U00100001 a { }")) 2511 // Output: 2512 // &cc.FunctionDefinition{ 2513 // · Case: 1, 2514 // · Declarator: &cc.Declarator{ 2515 // · · FunctionDefinition: &cc.FunctionDefinition{ /* recursive/repetitive pointee not shown */ }, 2516 // · · Linkage: LinkageNone, 2517 // · · Scope: &cc.Scope{ 2518 // · · }, 2519 // · · StorageDuration: StorageDurationAutomatic, 2520 // · · DirectDeclarator: &cc.DirectDeclarator{ 2521 // · · · Case: DirectDeclaratorIdent, 2522 // · · · Token: IDENTIFIER "a", 2523 // · · }, 2524 // · }, 2525 // · FunctionBody: &cc.FunctionBody{ 2526 // · · CompoundStmt: &cc.CompoundStmt{ 2527 // · · · BlockItemListOpt: &cc.BlockItemListOpt{ 2528 // · · · · BlockItemList: &cc.BlockItemList{ 2529 // · · · · · BlockItem: &cc.BlockItem{ 2530 // · · · · · · Declaration: &cc.Declaration{ 2531 // · · · · · · · Scope: &cc.Scope{ 2532 // · · · · · · · · Parent: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2533 // · · · · · · · }, 2534 // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2535 // · · · · · · · · Case: 1, 2536 // · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2537 // · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2538 // · · · · · · · · · · Case: 2, 2539 // · · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ 2540 // · · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2541 // · · · · · · · · · · · · Case: 3, 2542 // · · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ 2543 // · · · · · · · · · · · · · Case: 3, 2544 // · · · · · · · · · · · · · Token: CHAR "char", 2545 // · · · · · · · · · · · · }, 2546 // · · · · · · · · · · · }, 2547 // · · · · · · · · · · }, 2548 // · · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ 2549 // · · · · · · · · · · · Token: CONST "const", 2550 // · · · · · · · · · · }, 2551 // · · · · · · · · · }, 2552 // · · · · · · · · }, 2553 // · · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ 2554 // · · · · · · · · · Case: 3, 2555 // · · · · · · · · · Token: STATIC "static", 2556 // · · · · · · · · }, 2557 // · · · · · · · }, 2558 // · · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ 2559 // · · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ 2560 // · · · · · · · · · InitDeclarator: &cc.InitDeclarator{ 2561 // · · · · · · · · · · Case: 1, 2562 // · · · · · · · · · · Declarator: &cc.Declarator{ 2563 // · · · · · · · · · · · Linkage: LinkageNone, 2564 // · · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2565 // · · · · · · · · · · · StorageDuration: StorageDurationAutomatic, 2566 // · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2567 // · · · · · · · · · · · · Case: DirectDeclaratorArray, 2568 // · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ 2569 // · · · · · · · · · · · · · Case: DirectDeclaratorIdent, 2570 // · · · · · · · · · · · · · Token: IDENTIFIER "__func__", 2571 // · · · · · · · · · · · · }, 2572 // · · · · · · · · · · · · Token: '[', 2573 // · · · · · · · · · · · · Token2: ']', 2574 // · · · · · · · · · · · }, 2575 // · · · · · · · · · · }, 2576 // · · · · · · · · · · Initializer: &cc.Initializer{ 2577 // · · · · · · · · · · · Case: 1, 2578 // · · · · · · · · · · · Expr: &cc.Expr{ 2579 // · · · · · · · · · · · · Case: ExprString, 2580 // · · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", 2581 // · · · · · · · · · · · }, 2582 // · · · · · · · · · · }, 2583 // · · · · · · · · · · Token: '=', 2584 // · · · · · · · · · }, 2585 // · · · · · · · · }, 2586 // · · · · · · · }, 2587 // · · · · · · · Token: ';', 2588 // · · · · · · }, 2589 // · · · · · }, 2590 // · · · · }, 2591 // · · · }, 2592 // · · · Token: '{', 2593 // · · · Token2: '}', 2594 // · · }, 2595 // · }, 2596 // } 2597 } 2598 2599 func ExampleFunctionSpecifier_inline() { 2600 fmt.Println(exampleAST(146, "\U00100001 inline (")) 2601 // Output: 2602 // &cc.FunctionSpecifier{ 2603 // · Token: INLINE "inline", 2604 // } 2605 } 2606 2607 func ExampleFunctionSpecifier_noreturn() { 2608 fmt.Println(exampleAST(147, "\U00100001 _Noreturn (")) 2609 // Output: 2610 // &cc.FunctionSpecifier{ 2611 // · Case: 1, 2612 // · Token: NORETURN "_Noreturn", 2613 // } 2614 } 2615 2616 func ExampleIdentifierList_case0() { 2617 fmt.Println(exampleAST(178, "\U00100001 a ( b )")) 2618 // Output: 2619 // &cc.IdentifierList{ 2620 // · Token: IDENTIFIER "b", 2621 // } 2622 } 2623 2624 func ExampleIdentifierList_case1() { 2625 fmt.Println(exampleAST(179, "\U00100001 a ( b , c )")) 2626 // Output: 2627 // &cc.IdentifierList{ 2628 // · IdentifierList: &cc.IdentifierList{ 2629 // · · Case: 1, 2630 // · · Token: ',', 2631 // · · Token2: IDENTIFIER "c", 2632 // · }, 2633 // · Token: IDENTIFIER "b", 2634 // } 2635 } 2636 2637 func ExampleIdentifierListOpt_case0() { 2638 fmt.Println(exampleAST(180, "\U00100001 a ( )") == (*IdentifierListOpt)(nil)) 2639 // Output: 2640 // true 2641 } 2642 2643 func ExampleIdentifierListOpt_case1() { 2644 fmt.Println(exampleAST(181, "\U00100001 a ( b )")) 2645 // Output: 2646 // &cc.IdentifierListOpt{ 2647 // · IdentifierList: &cc.IdentifierList{ 2648 // · · Token: IDENTIFIER "b", 2649 // · }, 2650 // } 2651 } 2652 2653 func ExampleIdentifierOpt_case0() { 2654 fmt.Println(exampleAST(182, "\U00100001 struct {") == (*IdentifierOpt)(nil)) 2655 // Output: 2656 // true 2657 } 2658 2659 func ExampleIdentifierOpt_case1() { 2660 fmt.Println(exampleAST(183, "\U00100001 enum a {")) 2661 // Output: 2662 // &cc.IdentifierOpt{ 2663 // · Token: IDENTIFIER "a", 2664 // } 2665 } 2666 2667 func ExampleInitDeclarator_base() { 2668 fmt.Println(exampleAST(89, "\U00100001 a _Atomic b ,")) 2669 // Output: 2670 // &cc.InitDeclarator{ 2671 // · Declarator: &cc.Declarator{ 2672 // · · Linkage: LinkageNone, 2673 // · · Scope: &cc.Scope{ 2674 // · · }, 2675 // · · StorageDuration: StorageDurationAutomatic, 2676 // · · DirectDeclarator: &cc.DirectDeclarator{ 2677 // · · · Case: DirectDeclaratorIdent, 2678 // · · · Token: IDENTIFIER "b", 2679 // · · }, 2680 // · }, 2681 // } 2682 } 2683 2684 func ExampleInitDeclarator_init() { 2685 fmt.Println(exampleAST(90, "\U00100001 _Atomic a = 'b' ,")) 2686 // Output: 2687 // &cc.InitDeclarator{ 2688 // · Case: 1, 2689 // · Declarator: &cc.Declarator{ 2690 // · · Linkage: LinkageNone, 2691 // · · Scope: &cc.Scope{ 2692 // · · }, 2693 // · · StorageDuration: StorageDurationAutomatic, 2694 // · · DirectDeclarator: &cc.DirectDeclarator{ 2695 // · · · Case: DirectDeclaratorIdent, 2696 // · · · Token: IDENTIFIER "a", 2697 // · · }, 2698 // · }, 2699 // · Initializer: &cc.Initializer{ 2700 // · · Case: 1, 2701 // · · Expr: &cc.Expr{ 2702 // · · · Case: ExprChar, 2703 // · · · Token: CHARCONST "'b'", 2704 // · · }, 2705 // · }, 2706 // · Token: '=', 2707 // } 2708 } 2709 2710 func ExampleInitDeclaratorList_case0() { 2711 fmt.Println(exampleAST(85, "\U00100001 _Atomic a ,")) 2712 // Output: 2713 // &cc.InitDeclaratorList{ 2714 // · InitDeclarator: &cc.InitDeclarator{ 2715 // · · Declarator: &cc.Declarator{ 2716 // · · · Linkage: LinkageNone, 2717 // · · · Scope: &cc.Scope{ 2718 // · · · }, 2719 // · · · StorageDuration: StorageDurationAutomatic, 2720 // · · · DirectDeclarator: &cc.DirectDeclarator{ 2721 // · · · · Case: DirectDeclaratorIdent, 2722 // · · · · Token: IDENTIFIER "a", 2723 // · · · }, 2724 // · · }, 2725 // · }, 2726 // } 2727 } 2728 2729 func ExampleInitDeclaratorList_case1() { 2730 fmt.Println(exampleAST(86, "\U00100001 _Atomic a , b ,")) 2731 // Output: 2732 // &cc.InitDeclaratorList{ 2733 // · InitDeclarator: &cc.InitDeclarator{ 2734 // · · Declarator: &cc.Declarator{ 2735 // · · · Linkage: LinkageNone, 2736 // · · · Scope: &cc.Scope{ 2737 // · · · }, 2738 // · · · StorageDuration: StorageDurationAutomatic, 2739 // · · · DirectDeclarator: &cc.DirectDeclarator{ 2740 // · · · · Case: DirectDeclaratorIdent, 2741 // · · · · Token: IDENTIFIER "a", 2742 // · · · }, 2743 // · · }, 2744 // · }, 2745 // · InitDeclaratorList: &cc.InitDeclaratorList{ 2746 // · · Case: 1, 2747 // · · InitDeclarator: &cc.InitDeclarator{ 2748 // · · · Declarator: &cc.Declarator{ 2749 // · · · · Linkage: LinkageNone, 2750 // · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 2751 // · · · · StorageDuration: StorageDurationAutomatic, 2752 // · · · · DirectDeclarator: &cc.DirectDeclarator{ 2753 // · · · · · Case: DirectDeclaratorIdent, 2754 // · · · · · Token: IDENTIFIER "b", 2755 // · · · · }, 2756 // · · · }, 2757 // · · }, 2758 // · · Token: ',', 2759 // · }, 2760 // } 2761 } 2762 2763 func ExampleInitDeclaratorListOpt_case0() { 2764 fmt.Println(exampleAST(87, "\U00100001 _Atomic ;") == (*InitDeclaratorListOpt)(nil)) 2765 // Output: 2766 // true 2767 } 2768 2769 func ExampleInitDeclaratorListOpt_case1() { 2770 fmt.Println(exampleAST(88, "\U00100001 _Atomic a ;")) 2771 // Output: 2772 // &cc.InitDeclaratorListOpt{ 2773 // · InitDeclaratorList: &cc.InitDeclaratorList{ 2774 // · · InitDeclarator: &cc.InitDeclarator{ 2775 // · · · Declarator: &cc.Declarator{ 2776 // · · · · Linkage: LinkageNone, 2777 // · · · · Scope: &cc.Scope{ 2778 // · · · · }, 2779 // · · · · StorageDuration: StorageDurationAutomatic, 2780 // · · · · DirectDeclarator: &cc.DirectDeclarator{ 2781 // · · · · · Case: DirectDeclaratorIdent, 2782 // · · · · · Token: IDENTIFIER "a", 2783 // · · · · }, 2784 // · · · }, 2785 // · · }, 2786 // · }, 2787 // } 2788 } 2789 2790 func ExampleInitializer_compLit() { 2791 fmt.Println(exampleAST(199, "\U00100001 _Atomic a = { } ,")) 2792 // Output: 2793 // &cc.Initializer{ 2794 // · Token: '{', 2795 // · Token2: '}', 2796 // } 2797 } 2798 2799 func ExampleInitializer_expr() { 2800 fmt.Println(exampleAST(200, "\U00100001 _Atomic a = 'b' ,")) 2801 // Output: 2802 // &cc.Initializer{ 2803 // · Case: 1, 2804 // · Expr: &cc.Expr{ 2805 // · · Case: ExprChar, 2806 // · · Token: CHARCONST "'b'", 2807 // · }, 2808 // } 2809 } 2810 2811 func ExampleInitializerList_case0() { 2812 fmt.Println(exampleAST(201, "\U00100000 ( _Atomic ) { ,") == (*InitializerList)(nil)) 2813 // Output: 2814 // true 2815 } 2816 2817 func ExampleInitializerList_case1() { 2818 fmt.Println(exampleAST(202, "\U00100001 _Atomic a = { 'b' ,")) 2819 // Output: 2820 // &cc.InitializerList{ 2821 // · Case: 1, 2822 // · Initializer: &cc.Initializer{ 2823 // · · Case: 1, 2824 // · · Expr: &cc.Expr{ 2825 // · · · Case: ExprChar, 2826 // · · · Token: CHARCONST "'b'", 2827 // · · }, 2828 // · }, 2829 // } 2830 } 2831 2832 func ExampleInitializerList_case2() { 2833 fmt.Println(exampleAST(203, "\U00100001 _Atomic a = { . b = 'c' ,")) 2834 // Output: 2835 // &cc.InitializerList{ 2836 // · Case: 2, 2837 // · Designation: &cc.Designation{ 2838 // · · DesignatorList: &cc.DesignatorList{ 2839 // · · · Designator: &cc.Designator{ 2840 // · · · · Token: '.', 2841 // · · · · Token2: IDENTIFIER "b", 2842 // · · · }, 2843 // · · }, 2844 // · · Token: '=', 2845 // · }, 2846 // · Initializer: &cc.Initializer{ 2847 // · · Case: 1, 2848 // · · Expr: &cc.Expr{ 2849 // · · · Case: ExprChar, 2850 // · · · Token: CHARCONST "'c'", 2851 // · · }, 2852 // · }, 2853 // } 2854 } 2855 2856 func ExampleInitializerList_case3() { 2857 fmt.Println(exampleAST(204, "\U00100000 ( _Atomic ) { , 'a' ,")) 2858 // Output: 2859 // &cc.InitializerList{ 2860 // · Case: 3, 2861 // · Initializer: &cc.Initializer{ 2862 // · · Case: 1, 2863 // · · Expr: &cc.Expr{ 2864 // · · · Case: ExprChar, 2865 // · · · Token: CHARCONST "'a'", 2866 // · · }, 2867 // · }, 2868 // · Token: ',', 2869 // } 2870 } 2871 2872 func ExampleInitializerList_case4() { 2873 fmt.Println(exampleAST(205, "\U00100000 ( _Atomic ) { , . a = 'b' ,")) 2874 // Output: 2875 // &cc.InitializerList{ 2876 // · Case: 4, 2877 // · Designation: &cc.Designation{ 2878 // · · DesignatorList: &cc.DesignatorList{ 2879 // · · · Designator: &cc.Designator{ 2880 // · · · · Token: '.', 2881 // · · · · Token2: IDENTIFIER "a", 2882 // · · · }, 2883 // · · }, 2884 // · · Token: '=', 2885 // · }, 2886 // · Initializer: &cc.Initializer{ 2887 // · · Case: 1, 2888 // · · Expr: &cc.Expr{ 2889 // · · · Case: ExprChar, 2890 // · · · Token: CHARCONST "'b'", 2891 // · · }, 2892 // · }, 2893 // · Token: ',', 2894 // } 2895 } 2896 2897 func ExampleIterationStmt_do() { 2898 fmt.Println(exampleAST(235, "\U00100001 a { do ; while ( 'b' ) ; !")) 2899 // Output: 2900 // &cc.IterationStmt{ 2901 // · ExprList: &cc.ExprList{ 2902 // · · Expr: &cc.Expr{ 2903 // · · · Case: ExprChar, 2904 // · · · Token: CHARCONST "'b'", 2905 // · · }, 2906 // · }, 2907 // · Stmt: &cc.Stmt{ 2908 // · · Case: 1, 2909 // · · ExprStmt: &cc.ExprStmt{ 2910 // · · · Token: ';', 2911 // · · }, 2912 // · }, 2913 // · Token: DO "do", 2914 // · Token2: WHILE "while", 2915 // · Token3: '(', 2916 // · Token4: ')', 2917 // · Token5: ';', 2918 // } 2919 } 2920 2921 func ExampleIterationStmt_forDecl() { 2922 fmt.Println(exampleAST(236, "\U00100001 a { for ( _Atomic ; ; ) ; !")) 2923 // Output: 2924 // &cc.IterationStmt{ 2925 // · Case: 1, 2926 // · Declaration: &cc.Declaration{ 2927 // · · Scope: &cc.Scope{ 2928 // · · · Parent: &cc.Scope{ 2929 // · · · · Parent: &cc.Scope{ 2930 // · · · · }, 2931 // · · · }, 2932 // · · }, 2933 // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 2934 // · · · Case: 2, 2935 // · · · TypeQualifier: &cc.TypeQualifier{ 2936 // · · · · Case: 3, 2937 // · · · · Token: ATOMIC "_Atomic", 2938 // · · · }, 2939 // · · }, 2940 // · · Token: ';', 2941 // · }, 2942 // · Stmt: &cc.Stmt{ 2943 // · · Case: 1, 2944 // · · ExprStmt: &cc.ExprStmt{ 2945 // · · · Token: ';', 2946 // · · }, 2947 // · }, 2948 // · Token: FOR "for", 2949 // · Token2: '(', 2950 // · Token3: ';', 2951 // · Token4: ')', 2952 // } 2953 } 2954 2955 func ExampleIterationStmt_for() { 2956 fmt.Println(exampleAST(237, "\U00100001 a { for ( ; ; ) ; !")) 2957 // Output: 2958 // &cc.IterationStmt{ 2959 // · Case: 2, 2960 // · Stmt: &cc.Stmt{ 2961 // · · Case: 1, 2962 // · · ExprStmt: &cc.ExprStmt{ 2963 // · · · Token: ';', 2964 // · · }, 2965 // · }, 2966 // · Token: FOR "for", 2967 // · Token2: '(', 2968 // · Token3: ';', 2969 // · Token4: ';', 2970 // · Token5: ')', 2971 // } 2972 } 2973 2974 func ExampleIterationStmt_while() { 2975 fmt.Println(exampleAST(238, "\U00100001 a { while ( 'b' ) ; !")) 2976 // Output: 2977 // &cc.IterationStmt{ 2978 // · Case: 3, 2979 // · ExprList: &cc.ExprList{ 2980 // · · Expr: &cc.Expr{ 2981 // · · · Case: ExprChar, 2982 // · · · Token: CHARCONST "'b'", 2983 // · · }, 2984 // · }, 2985 // · Stmt: &cc.Stmt{ 2986 // · · Case: 1, 2987 // · · ExprStmt: &cc.ExprStmt{ 2988 // · · · Token: ';', 2989 // · · }, 2990 // · }, 2991 // · Token: WHILE "while", 2992 // · Token2: '(', 2993 // · Token3: ')', 2994 // } 2995 } 2996 2997 func ExampleJumpStmt_break() { 2998 fmt.Println(exampleAST(239, "\U00100001 a { break ; !")) 2999 // Output: 3000 // &cc.JumpStmt{ 3001 // · Token: BREAK "break", 3002 // · Token2: ';', 3003 // } 3004 } 3005 3006 func ExampleJumpStmt_continue() { 3007 fmt.Println(exampleAST(240, "\U00100001 a { continue ; !")) 3008 // Output: 3009 // &cc.JumpStmt{ 3010 // · Case: 1, 3011 // · Token: CONTINUE "continue", 3012 // · Token2: ';', 3013 // } 3014 } 3015 3016 func ExampleJumpStmt_goto() { 3017 fmt.Println(exampleAST(241, "\U00100001 a { goto b ; !")) 3018 // Output: 3019 // &cc.JumpStmt{ 3020 // · Case: 2, 3021 // · Token: GOTO "goto", 3022 // · Token2: IDENTIFIER "b", 3023 // · Token3: ';', 3024 // } 3025 } 3026 3027 func ExampleJumpStmt_return() { 3028 fmt.Println(exampleAST(242, "\U00100001 a { return ; !")) 3029 // Output: 3030 // &cc.JumpStmt{ 3031 // · Case: 3, 3032 // · Token: RETURN "return", 3033 // · Token2: ';', 3034 // } 3035 } 3036 3037 func ExampleLabeledStmt_switchCase() { 3038 fmt.Println(exampleAST(217, "\U00100001 a { case 'b' : ; !")) 3039 // Output: 3040 // &cc.LabeledStmt{ 3041 // · ConstExpr: &cc.ConstExpr{ 3042 // · · Expr: &cc.Expr{ 3043 // · · · Case: ExprChar, 3044 // · · · Token: CHARCONST "'b'", 3045 // · · }, 3046 // · }, 3047 // · Stmt: &cc.Stmt{ 3048 // · · Case: 1, 3049 // · · ExprStmt: &cc.ExprStmt{ 3050 // · · · Token: ';', 3051 // · · }, 3052 // · }, 3053 // · Token: CASE "case", 3054 // · Token2: ':', 3055 // } 3056 } 3057 3058 func ExampleLabeledStmt_default() { 3059 fmt.Println(exampleAST(218, "\U00100001 a { default : ; !")) 3060 // Output: 3061 // &cc.LabeledStmt{ 3062 // · Case: 1, 3063 // · Stmt: &cc.Stmt{ 3064 // · · Case: 1, 3065 // · · ExprStmt: &cc.ExprStmt{ 3066 // · · · Token: ';', 3067 // · · }, 3068 // · }, 3069 // · Token: DEFAULT "default", 3070 // · Token2: ':', 3071 // } 3072 } 3073 3074 func ExampleLabeledStmt_label() { 3075 fmt.Println(exampleAST(219, "\U00100001 a { b : ; !")) 3076 // Output: 3077 // &cc.LabeledStmt{ 3078 // · Case: 2, 3079 // · Stmt: &cc.Stmt{ 3080 // · · Case: 1, 3081 // · · ExprStmt: &cc.ExprStmt{ 3082 // · · · Token: ';', 3083 // · · }, 3084 // · }, 3085 // · Token: IDENTIFIER "b", 3086 // · Token2: ':', 3087 // } 3088 } 3089 3090 func ExampleLabeledStmt_label2() { 3091 fmt.Println(exampleAST(220, "\U00100001 a { typedef name : ; !")) 3092 // Output: 3093 // TODO: example220.c:1:19: unexpected ':', expected one of [',', ';', '='] 3094 } 3095 3096 func ExampleParameterDeclaration_abstract() { 3097 fmt.Println(exampleAST(176, "\U00100001 a ( _Atomic )")) 3098 // Output: 3099 // &cc.ParameterDeclaration{ 3100 // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3101 // · · Case: 2, 3102 // · · TypeQualifier: &cc.TypeQualifier{ 3103 // · · · Case: 3, 3104 // · · · Token: ATOMIC "_Atomic", 3105 // · · }, 3106 // · }, 3107 // } 3108 } 3109 3110 func ExampleParameterDeclaration_declarator() { 3111 fmt.Println(exampleAST(177, "\U00100001 a ( _Atomic b )")) 3112 // Output: 3113 // &cc.ParameterDeclaration{ 3114 // · Case: 1, 3115 // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3116 // · · Case: 2, 3117 // · · TypeQualifier: &cc.TypeQualifier{ 3118 // · · · Case: 3, 3119 // · · · Token: ATOMIC "_Atomic", 3120 // · · }, 3121 // · }, 3122 // · Declarator: &cc.Declarator{ 3123 // · · Linkage: LinkageNone, 3124 // · · Scope: &cc.Scope{ 3125 // · · }, 3126 // · · StorageDuration: StorageDurationAutomatic, 3127 // · · DirectDeclarator: &cc.DirectDeclarator{ 3128 // · · · Case: DirectDeclaratorIdent, 3129 // · · · Token: IDENTIFIER "b", 3130 // · · }, 3131 // · }, 3132 // } 3133 } 3134 3135 func ExampleParameterList_case0() { 3136 fmt.Println(exampleAST(174, "\U00100001 a ( _Atomic )")) 3137 // Output: 3138 // &cc.ParameterList{ 3139 // · ParameterDeclaration: &cc.ParameterDeclaration{ 3140 // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3141 // · · · Case: 2, 3142 // · · · TypeQualifier: &cc.TypeQualifier{ 3143 // · · · · Case: 3, 3144 // · · · · Token: ATOMIC "_Atomic", 3145 // · · · }, 3146 // · · }, 3147 // · }, 3148 // } 3149 } 3150 3151 func ExampleParameterList_case1() { 3152 fmt.Println(exampleAST(175, "\U00100001 a ( _Atomic , _Atomic )")) 3153 // Output: 3154 // &cc.ParameterList{ 3155 // · ParameterDeclaration: &cc.ParameterDeclaration{ 3156 // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3157 // · · · Case: 2, 3158 // · · · TypeQualifier: &cc.TypeQualifier{ 3159 // · · · · Case: 3, 3160 // · · · · Token: ATOMIC "_Atomic", 3161 // · · · }, 3162 // · · }, 3163 // · }, 3164 // · ParameterList: &cc.ParameterList{ 3165 // · · Case: 1, 3166 // · · ParameterDeclaration: &cc.ParameterDeclaration{ 3167 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3168 // · · · · Case: 2, 3169 // · · · · TypeQualifier: &cc.TypeQualifier{ 3170 // · · · · · Case: 3, 3171 // · · · · · Token: ATOMIC "_Atomic", 3172 // · · · · }, 3173 // · · · }, 3174 // · · }, 3175 // · · Token: ',', 3176 // · }, 3177 // } 3178 } 3179 3180 func ExampleParameterTypeList_base() { 3181 fmt.Println(exampleAST(170, "\U00100001 a ( _Atomic )")) 3182 // Output: 3183 // &cc.ParameterTypeList{ 3184 // · ParameterList: &cc.ParameterList{ 3185 // · · ParameterDeclaration: &cc.ParameterDeclaration{ 3186 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3187 // · · · · Case: 2, 3188 // · · · · TypeQualifier: &cc.TypeQualifier{ 3189 // · · · · · Case: 3, 3190 // · · · · · Token: ATOMIC "_Atomic", 3191 // · · · · }, 3192 // · · · }, 3193 // · · }, 3194 // · }, 3195 // } 3196 } 3197 3198 func ExampleParameterTypeList_dots() { 3199 fmt.Println(exampleAST(171, "\U00100001 a ( _Atomic , ... )")) 3200 // Output: 3201 // &cc.ParameterTypeList{ 3202 // · Case: 1, 3203 // · ParameterList: &cc.ParameterList{ 3204 // · · ParameterDeclaration: &cc.ParameterDeclaration{ 3205 // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3206 // · · · · Case: 2, 3207 // · · · · TypeQualifier: &cc.TypeQualifier{ 3208 // · · · · · Case: 3, 3209 // · · · · · Token: ATOMIC "_Atomic", 3210 // · · · · }, 3211 // · · · }, 3212 // · · }, 3213 // · }, 3214 // · Token: ',', 3215 // · Token2: DDD, 3216 // } 3217 } 3218 3219 func ExampleParameterTypeListOpt_case0() { 3220 fmt.Println(exampleAST(172, "\U00100000 ( _Atomic ( )") == (*ParameterTypeListOpt)(nil)) 3221 // Output: 3222 // true 3223 } 3224 3225 func ExampleParameterTypeListOpt_case1() { 3226 fmt.Println(exampleAST(173, "\U00100000 ( _Atomic ( _Atomic )")) 3227 // Output: 3228 // &cc.ParameterTypeListOpt{ 3229 // · ParameterTypeList: &cc.ParameterTypeList{ 3230 // · · ParameterList: &cc.ParameterList{ 3231 // · · · ParameterDeclaration: &cc.ParameterDeclaration{ 3232 // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3233 // · · · · · Case: 2, 3234 // · · · · · TypeQualifier: &cc.TypeQualifier{ 3235 // · · · · · · Case: 3, 3236 // · · · · · · Token: ATOMIC "_Atomic", 3237 // · · · · · }, 3238 // · · · · }, 3239 // · · · }, 3240 // · · }, 3241 // · }, 3242 // } 3243 } 3244 3245 func ExampleParameters_identList() { 3246 fmt.Println(exampleAST(149, "\U00100001 a ( )")) 3247 // Output: 3248 } 3249 3250 func ExampleParameters_paramTypes() { 3251 fmt.Println(exampleAST(150, "\U00100001 a ( _Atomic )")) 3252 // Output: 3253 // &cc.Parameters{ 3254 // · Case: 1, 3255 // · ParameterTypeList: &cc.ParameterTypeList{ 3256 // · · ParameterList: &cc.ParameterList{ 3257 // · · · ParameterDeclaration: &cc.ParameterDeclaration{ 3258 // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ 3259 // · · · · · Case: 2, 3260 // · · · · · TypeQualifier: &cc.TypeQualifier{ 3261 // · · · · · · Case: 3, 3262 // · · · · · · Token: ATOMIC "_Atomic", 3263 // · · · · · }, 3264 // · · · · }, 3265 // · · · }, 3266 // · · }, 3267 // · }, 3268 // } 3269 } 3270 3271 func ExamplePointer_base() { 3272 fmt.Println(exampleAST(162, "\U00100001 * (")) 3273 // Output: 3274 // &cc.Pointer{ 3275 // · Token: '*', 3276 // } 3277 } 3278 3279 func ExamplePointer_ptr() { 3280 fmt.Println(exampleAST(163, "\U00100001 * * (")) 3281 // Output: 3282 // &cc.Pointer{ 3283 // · Case: 1, 3284 // · Pointer: &cc.Pointer{ 3285 // · · Token: '*', 3286 // · }, 3287 // · Token: '*', 3288 // } 3289 } 3290 3291 func ExamplePointerOpt_case0() { 3292 fmt.Println(exampleAST(164, "\U00100001 (") == (*PointerOpt)(nil)) 3293 // Output: 3294 // true 3295 } 3296 3297 func ExamplePointerOpt_case1() { 3298 fmt.Println(exampleAST(165, "\U00100001 * (")) 3299 // Output: 3300 // &cc.PointerOpt{ 3301 // · Pointer: &cc.Pointer{ 3302 // · · Token: '*', 3303 // · }, 3304 // } 3305 } 3306 3307 func ExampleSelectionStmt_ifElse() { 3308 fmt.Println(exampleAST(232, "\U00100001 a { if ( 'b' ) ; else ; !")) 3309 // Output: 3310 // &cc.SelectionStmt{ 3311 // · ExprList: &cc.ExprList{ 3312 // · · Expr: &cc.Expr{ 3313 // · · · Case: ExprChar, 3314 // · · · Token: CHARCONST "'b'", 3315 // · · }, 3316 // · }, 3317 // · Stmt: &cc.Stmt{ 3318 // · · Case: 1, 3319 // · · ExprStmt: &cc.ExprStmt{ 3320 // · · · Token: ';', 3321 // · · }, 3322 // · }, 3323 // · Stmt2: &cc.Stmt{ 3324 // · · Case: 1, 3325 // · · ExprStmt: &cc.ExprStmt{ 3326 // · · · Token: ';', 3327 // · · }, 3328 // · }, 3329 // · Token: IF "if", 3330 // · Token2: '(', 3331 // · Token3: ')', 3332 // · Token4: ELSE "else", 3333 // } 3334 } 3335 3336 func ExampleSelectionStmt_if() { 3337 fmt.Println(exampleAST(233, "\U00100001 a { if ( 'b' ) ; !")) 3338 // Output: 3339 // &cc.SelectionStmt{ 3340 // · Case: 1, 3341 // · ExprList: &cc.ExprList{ 3342 // · · Expr: &cc.Expr{ 3343 // · · · Case: ExprChar, 3344 // · · · Token: CHARCONST "'b'", 3345 // · · }, 3346 // · }, 3347 // · Stmt: &cc.Stmt{ 3348 // · · Case: 1, 3349 // · · ExprStmt: &cc.ExprStmt{ 3350 // · · · Token: ';', 3351 // · · }, 3352 // · }, 3353 // · Token: IF "if", 3354 // · Token2: '(', 3355 // · Token3: ')', 3356 // } 3357 } 3358 3359 func ExampleSelectionStmt_switch() { 3360 fmt.Println(exampleAST(234, "\U00100001 a { switch ( 'b' ) ; !")) 3361 // Output: 3362 // &cc.SelectionStmt{ 3363 // · Case: 2, 3364 // · ExprList: &cc.ExprList{ 3365 // · · Expr: &cc.Expr{ 3366 // · · · Case: ExprChar, 3367 // · · · Token: CHARCONST "'b'", 3368 // · · }, 3369 // · }, 3370 // · Stmt: &cc.Stmt{ 3371 // · · Case: 1, 3372 // · · ExprStmt: &cc.ExprStmt{ 3373 // · · · Token: ';', 3374 // · · }, 3375 // · }, 3376 // · Token: SWITCH "switch", 3377 // · Token2: '(', 3378 // · Token3: ')', 3379 // } 3380 } 3381 3382 func ExampleSpecifierQualifierList_qualifier() { 3383 fmt.Println(exampleAST(126, "\U00100000 ( _Atomic (")) 3384 // Output: 3385 // &cc.SpecifierQualifierList{ 3386 // · TypeQualifier: &cc.TypeQualifier{ 3387 // · · Case: 3, 3388 // · · Token: ATOMIC "_Atomic", 3389 // · }, 3390 // } 3391 } 3392 3393 func ExampleSpecifierQualifierList_specifier() { 3394 fmt.Println(exampleAST(127, "\U00100000 ( _Bool (")) 3395 // Output: 3396 // &cc.SpecifierQualifierList{ 3397 // · Case: 1, 3398 // · TypeSpecifier: &cc.TypeSpecifier{ 3399 // · · Token: BOOL "_Bool", 3400 // · }, 3401 // } 3402 } 3403 3404 func ExampleSpecifierQualifierListOpt_case0() { 3405 fmt.Println(exampleAST(128, "\U00100000 ( _Atomic (") == (*SpecifierQualifierListOpt)(nil)) 3406 // Output: 3407 // true 3408 } 3409 3410 func ExampleSpecifierQualifierListOpt_case1() { 3411 fmt.Println(exampleAST(129, "\U00100000 ( _Atomic _Atomic (")) 3412 // Output: 3413 // &cc.SpecifierQualifierListOpt{ 3414 // · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3415 // · · TypeQualifier: &cc.TypeQualifier{ 3416 // · · · Case: 3, 3417 // · · · Token: ATOMIC "_Atomic", 3418 // · · }, 3419 // · }, 3420 // } 3421 } 3422 3423 func ExampleStmt_block() { 3424 fmt.Println(exampleAST(211, "\U00100001 a { { } !")) 3425 // Output: 3426 // &cc.Stmt{ 3427 // · CompoundStmt: &cc.CompoundStmt{ 3428 // · · Token: '{', 3429 // · · Token2: '}', 3430 // · }, 3431 // } 3432 } 3433 3434 func ExampleStmt_expr() { 3435 fmt.Println(exampleAST(212, "\U00100001 a { ; !")) 3436 // Output: 3437 // &cc.Stmt{ 3438 // · Case: 1, 3439 // · ExprStmt: &cc.ExprStmt{ 3440 // · · Token: ';', 3441 // · }, 3442 // } 3443 } 3444 3445 func ExampleStmt_iter() { 3446 fmt.Println(exampleAST(213, "\U00100001 a { while ( 'b' ) ; !")) 3447 // Output: 3448 // &cc.Stmt{ 3449 // · Case: 2, 3450 // · IterationStmt: &cc.IterationStmt{ 3451 // · · Case: 3, 3452 // · · ExprList: &cc.ExprList{ 3453 // · · · Expr: &cc.Expr{ 3454 // · · · · Case: ExprChar, 3455 // · · · · Token: CHARCONST "'b'", 3456 // · · · }, 3457 // · · }, 3458 // · · Stmt: &cc.Stmt{ 3459 // · · · Case: 1, 3460 // · · · ExprStmt: &cc.ExprStmt{ 3461 // · · · · Token: ';', 3462 // · · · }, 3463 // · · }, 3464 // · · Token: WHILE "while", 3465 // · · Token2: '(', 3466 // · · Token3: ')', 3467 // · }, 3468 // } 3469 } 3470 3471 func ExampleStmt_jump() { 3472 fmt.Println(exampleAST(214, "\U00100001 a { break ; !")) 3473 // Output: 3474 // &cc.Stmt{ 3475 // · Case: 3, 3476 // · JumpStmt: &cc.JumpStmt{ 3477 // · · Token: BREAK "break", 3478 // · · Token2: ';', 3479 // · }, 3480 // } 3481 } 3482 3483 func ExampleStmt_labeled() { 3484 fmt.Println(exampleAST(215, "\U00100001 a { default : ; !")) 3485 // Output: 3486 // &cc.Stmt{ 3487 // · Case: 4, 3488 // · LabeledStmt: &cc.LabeledStmt{ 3489 // · · Case: 1, 3490 // · · Stmt: &cc.Stmt{ 3491 // · · · Case: 1, 3492 // · · · ExprStmt: &cc.ExprStmt{ 3493 // · · · · Token: ';', 3494 // · · · }, 3495 // · · }, 3496 // · · Token: DEFAULT "default", 3497 // · · Token2: ':', 3498 // · }, 3499 // } 3500 } 3501 3502 func ExampleStmt_select() { 3503 fmt.Println(exampleAST(216, "\U00100001 a { if ( 'b' ) ; !")) 3504 // Output: 3505 // &cc.Stmt{ 3506 // · Case: 5, 3507 // · SelectionStmt: &cc.SelectionStmt{ 3508 // · · Case: 1, 3509 // · · ExprList: &cc.ExprList{ 3510 // · · · Expr: &cc.Expr{ 3511 // · · · · Case: ExprChar, 3512 // · · · · Token: CHARCONST "'b'", 3513 // · · · }, 3514 // · · }, 3515 // · · Stmt: &cc.Stmt{ 3516 // · · · Case: 1, 3517 // · · · ExprStmt: &cc.ExprStmt{ 3518 // · · · · Token: ';', 3519 // · · · }, 3520 // · · }, 3521 // · · Token: IF "if", 3522 // · · Token2: '(', 3523 // · · Token3: ')', 3524 // · }, 3525 // } 3526 } 3527 3528 func ExampleStorageClassSpecifier_auto() { 3529 fmt.Println(exampleAST(91, "\U00100001 auto (")) 3530 // Output: 3531 // &cc.StorageClassSpecifier{ 3532 // · Token: AUTO "auto", 3533 // } 3534 } 3535 3536 func ExampleStorageClassSpecifier_extern() { 3537 fmt.Println(exampleAST(92, "\U00100001 extern (")) 3538 // Output: 3539 // &cc.StorageClassSpecifier{ 3540 // · Case: 1, 3541 // · Token: EXTERN "extern", 3542 // } 3543 } 3544 3545 func ExampleStorageClassSpecifier_register() { 3546 fmt.Println(exampleAST(93, "\U00100001 register (")) 3547 // Output: 3548 // &cc.StorageClassSpecifier{ 3549 // · Case: 2, 3550 // · Token: REGISTER "register", 3551 // } 3552 } 3553 3554 func ExampleStorageClassSpecifier_static() { 3555 fmt.Println(exampleAST(94, "\U00100001 static (")) 3556 // Output: 3557 // &cc.StorageClassSpecifier{ 3558 // · Case: 3, 3559 // · Token: STATIC "static", 3560 // } 3561 } 3562 3563 func ExampleStorageClassSpecifier_typedef() { 3564 fmt.Println(exampleAST(95, "\U00100001 typedef (")) 3565 // Output: 3566 // &cc.StorageClassSpecifier{ 3567 // · Case: 4, 3568 // · Token: TYPEDEF "typedef", 3569 // } 3570 } 3571 3572 func ExampleStructDeclaration_base() { 3573 fmt.Println(exampleAST(124, "\U00100001 struct { _Atomic a ; }")) 3574 // Output: 3575 // &cc.StructDeclaration{ 3576 // · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3577 // · · TypeQualifier: &cc.TypeQualifier{ 3578 // · · · Case: 3, 3579 // · · · Token: ATOMIC "_Atomic", 3580 // · · }, 3581 // · }, 3582 // · StructDeclaratorList: &cc.StructDeclaratorList{ 3583 // · · StructDeclarator: &cc.StructDeclarator{ 3584 // · · · Declarator: &cc.Declarator{ 3585 // · · · · Linkage: LinkageNone, 3586 // · · · · Scope: &cc.Scope{ 3587 // · · · · }, 3588 // · · · · StorageDuration: StorageDurationAutomatic, 3589 // · · · · DirectDeclarator: &cc.DirectDeclarator{ 3590 // · · · · · Case: DirectDeclaratorIdent, 3591 // · · · · · Token: IDENTIFIER "a", 3592 // · · · · }, 3593 // · · · }, 3594 // · · }, 3595 // · }, 3596 // · Token: ';', 3597 // } 3598 } 3599 3600 func ExampleStructDeclaration_anon() { 3601 fmt.Println(exampleAST(125, "\U00100001 struct { _Atomic ; }")) 3602 // Output: 3603 // &cc.StructDeclaration{ 3604 // · Case: 1, 3605 // · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3606 // · · TypeQualifier: &cc.TypeQualifier{ 3607 // · · · Case: 3, 3608 // · · · Token: ATOMIC "_Atomic", 3609 // · · }, 3610 // · }, 3611 // · Token: ';', 3612 // } 3613 } 3614 3615 func ExampleStructDeclarationList_case0() { 3616 fmt.Println(exampleAST(122, "\U00100001 struct { _Atomic ; }")) 3617 // Output: 3618 // &cc.StructDeclarationList{ 3619 // · StructDeclaration: &cc.StructDeclaration{ 3620 // · · Case: 1, 3621 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3622 // · · · TypeQualifier: &cc.TypeQualifier{ 3623 // · · · · Case: 3, 3624 // · · · · Token: ATOMIC "_Atomic", 3625 // · · · }, 3626 // · · }, 3627 // · · Token: ';', 3628 // · }, 3629 // } 3630 } 3631 3632 func ExampleStructDeclarationList_case1() { 3633 fmt.Println(exampleAST(123, "\U00100001 struct { _Atomic ; _Atomic ; }")) 3634 // Output: 3635 // &cc.StructDeclarationList{ 3636 // · StructDeclaration: &cc.StructDeclaration{ 3637 // · · Case: 1, 3638 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3639 // · · · TypeQualifier: &cc.TypeQualifier{ 3640 // · · · · Case: 3, 3641 // · · · · Token: ATOMIC "_Atomic", 3642 // · · · }, 3643 // · · }, 3644 // · · Token: ';', 3645 // · }, 3646 // · StructDeclarationList: &cc.StructDeclarationList{ 3647 // · · Case: 1, 3648 // · · StructDeclaration: &cc.StructDeclaration{ 3649 // · · · Case: 1, 3650 // · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3651 // · · · · TypeQualifier: &cc.TypeQualifier{ 3652 // · · · · · Case: 3, 3653 // · · · · · Token: ATOMIC "_Atomic", 3654 // · · · · }, 3655 // · · · }, 3656 // · · · Token: ';', 3657 // · · }, 3658 // · }, 3659 // } 3660 } 3661 3662 func ExampleStructDeclarator_base() { 3663 fmt.Println(exampleAST(132, "\U00100001 struct { _Atomic a ,")) 3664 // Output: 3665 // &cc.StructDeclarator{ 3666 // · Declarator: &cc.Declarator{ 3667 // · · Linkage: LinkageNone, 3668 // · · Scope: &cc.Scope{ 3669 // · · }, 3670 // · · StorageDuration: StorageDurationAutomatic, 3671 // · · DirectDeclarator: &cc.DirectDeclarator{ 3672 // · · · Case: DirectDeclaratorIdent, 3673 // · · · Token: IDENTIFIER "a", 3674 // · · }, 3675 // · }, 3676 // } 3677 } 3678 3679 func ExampleStructDeclarator_bits() { 3680 fmt.Println(exampleAST(133, "\U00100001 struct { _Atomic : 'a' ,")) 3681 // Output: 3682 // &cc.StructDeclarator{ 3683 // · Case: 1, 3684 // · ConstExpr: &cc.ConstExpr{ 3685 // · · Expr: &cc.Expr{ 3686 // · · · Case: ExprChar, 3687 // · · · Token: CHARCONST "'a'", 3688 // · · }, 3689 // · }, 3690 // · Token: ':', 3691 // } 3692 } 3693 3694 func ExampleStructDeclaratorList_case0() { 3695 fmt.Println(exampleAST(130, "\U00100001 struct { _Atomic a ,")) 3696 // Output: 3697 // &cc.StructDeclaratorList{ 3698 // · StructDeclarator: &cc.StructDeclarator{ 3699 // · · Declarator: &cc.Declarator{ 3700 // · · · Linkage: LinkageNone, 3701 // · · · Scope: &cc.Scope{ 3702 // · · · }, 3703 // · · · StorageDuration: StorageDurationAutomatic, 3704 // · · · DirectDeclarator: &cc.DirectDeclarator{ 3705 // · · · · Case: DirectDeclaratorIdent, 3706 // · · · · Token: IDENTIFIER "a", 3707 // · · · }, 3708 // · · }, 3709 // · }, 3710 // } 3711 } 3712 3713 func ExampleStructDeclaratorList_case1() { 3714 fmt.Println(exampleAST(131, "\U00100001 struct { _Atomic a , b ,")) 3715 // Output: 3716 // &cc.StructDeclaratorList{ 3717 // · StructDeclarator: &cc.StructDeclarator{ 3718 // · · Declarator: &cc.Declarator{ 3719 // · · · Linkage: LinkageNone, 3720 // · · · Scope: &cc.Scope{ 3721 // · · · }, 3722 // · · · StorageDuration: StorageDurationAutomatic, 3723 // · · · DirectDeclarator: &cc.DirectDeclarator{ 3724 // · · · · Case: DirectDeclaratorIdent, 3725 // · · · · Token: IDENTIFIER "a", 3726 // · · · }, 3727 // · · }, 3728 // · }, 3729 // · StructDeclaratorList: &cc.StructDeclaratorList{ 3730 // · · Case: 1, 3731 // · · StructDeclarator: &cc.StructDeclarator{ 3732 // · · · Declarator: &cc.Declarator{ 3733 // · · · · Linkage: LinkageNone, 3734 // · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, 3735 // · · · · StorageDuration: StorageDurationAutomatic, 3736 // · · · · DirectDeclarator: &cc.DirectDeclarator{ 3737 // · · · · · Case: DirectDeclaratorIdent, 3738 // · · · · · Token: IDENTIFIER "b", 3739 // · · · · }, 3740 // · · · }, 3741 // · · }, 3742 // · · Token: ',', 3743 // · }, 3744 // } 3745 } 3746 3747 func ExampleStructOrUnion_struct() { 3748 fmt.Println(exampleAST(120, "\U00100001 struct {")) 3749 // Output: 3750 // &cc.StructOrUnion{ 3751 // · Token: STRUCT "struct", 3752 // } 3753 } 3754 3755 func ExampleStructOrUnion_union() { 3756 fmt.Println(exampleAST(121, "\U00100001 union {")) 3757 // Output: 3758 // &cc.StructOrUnion{ 3759 // · Case: 1, 3760 // · Token: UNION "union", 3761 // } 3762 } 3763 3764 func ExampleStructOrUnionSpecifier_tag() { 3765 fmt.Println(exampleAST(114, "\U00100001 struct a (")) 3766 // Output: 3767 // &cc.StructOrUnionSpecifier{ 3768 // · StructOrUnion: &cc.StructOrUnion{ 3769 // · · Token: STRUCT "struct", 3770 // · }, 3771 // · Token: IDENTIFIER "a", 3772 // } 3773 } 3774 3775 func ExampleStructOrUnionSpecifier_empty() { 3776 fmt.Println(exampleAST(116, "\U00100001 struct { } (")) 3777 // Output: 3778 // &cc.StructOrUnionSpecifier{ 3779 // · Case: 1, 3780 // · StructOrUnion: &cc.StructOrUnion{ 3781 // · · Token: STRUCT "struct", 3782 // · }, 3783 // · Token: '{', 3784 // · Token2: '}', 3785 // } 3786 } 3787 3788 func ExampleStructOrUnionSpecifier_define() { 3789 fmt.Println(exampleAST(119, "\U00100001 struct { _Atomic ; } (")) 3790 // Output: 3791 // &cc.StructOrUnionSpecifier{ 3792 // · Case: 2, 3793 // · StructDeclarationList: &cc.StructDeclarationList{ 3794 // · · StructDeclaration: &cc.StructDeclaration{ 3795 // · · · Case: 1, 3796 // · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3797 // · · · · TypeQualifier: &cc.TypeQualifier{ 3798 // · · · · · Case: 3, 3799 // · · · · · Token: ATOMIC "_Atomic", 3800 // · · · · }, 3801 // · · · }, 3802 // · · · Token: ';', 3803 // · · }, 3804 // · }, 3805 // · StructOrUnion: &cc.StructOrUnion{ 3806 // · · Token: STRUCT "struct", 3807 // · }, 3808 // · Token: '{', 3809 // · Token2: '}', 3810 // } 3811 } 3812 3813 func ExampleTypeName_case0() { 3814 fmt.Println(exampleAST(184, "\U00100000 ( _Atomic )")) 3815 // Output: 3816 // &cc.TypeName{ 3817 // · SpecifierQualifierList: &cc.SpecifierQualifierList{ 3818 // · · TypeQualifier: &cc.TypeQualifier{ 3819 // · · · Case: 3, 3820 // · · · Token: ATOMIC "_Atomic", 3821 // · · }, 3822 // · }, 3823 // } 3824 } 3825 3826 func ExampleTypeQualifier_const() { 3827 fmt.Println(exampleAST(142, "\U00100001 const !")) 3828 // Output: 3829 // &cc.TypeQualifier{ 3830 // · Token: CONST "const", 3831 // } 3832 } 3833 3834 func ExampleTypeQualifier_restrict() { 3835 fmt.Println(exampleAST(143, "\U00100001 restrict !")) 3836 // Output: 3837 // &cc.TypeQualifier{ 3838 // · Case: 1, 3839 // · Token: RESTRICT "restrict", 3840 // } 3841 } 3842 3843 func ExampleTypeQualifier_volatile() { 3844 fmt.Println(exampleAST(144, "\U00100001 volatile !")) 3845 // Output: 3846 // &cc.TypeQualifier{ 3847 // · Case: 2, 3848 // · Token: VOLATILE "volatile", 3849 // } 3850 } 3851 3852 func ExampleTypeQualifier_atomic() { 3853 fmt.Println(exampleAST(145, "\U00100001 _Atomic (")) 3854 // Output: 3855 // &cc.TypeQualifier{ 3856 // · Case: 3, 3857 // · Token: ATOMIC "_Atomic", 3858 // } 3859 } 3860 3861 func ExampleTypeQualifierList_case0() { 3862 fmt.Println(exampleAST(166, "\U00100001 * _Atomic !")) 3863 // Output: 3864 // &cc.TypeQualifierList{ 3865 // · TypeQualifier: &cc.TypeQualifier{ 3866 // · · Case: 3, 3867 // · · Token: ATOMIC "_Atomic", 3868 // · }, 3869 // } 3870 } 3871 3872 func ExampleTypeQualifierList_case1() { 3873 fmt.Println(exampleAST(167, "\U00100001 * _Atomic _Atomic !")) 3874 // Output: 3875 // &cc.TypeQualifierList{ 3876 // · TypeQualifier: &cc.TypeQualifier{ 3877 // · · Case: 3, 3878 // · · Token: ATOMIC "_Atomic", 3879 // · }, 3880 // · TypeQualifierList: &cc.TypeQualifierList{ 3881 // · · Case: 1, 3882 // · · TypeQualifier: &cc.TypeQualifier{ 3883 // · · · Case: 3, 3884 // · · · Token: ATOMIC "_Atomic", 3885 // · · }, 3886 // · }, 3887 // } 3888 } 3889 3890 func ExampleTypeQualifierListOpt_case0() { 3891 fmt.Println(exampleAST(168, "\U00100001 * (") == (*TypeQualifierListOpt)(nil)) 3892 // Output: 3893 // true 3894 } 3895 3896 func ExampleTypeQualifierListOpt_case1() { 3897 fmt.Println(exampleAST(169, "\U00100001 * _Atomic !")) 3898 // Output: 3899 // &cc.TypeQualifierListOpt{ 3900 // · TypeQualifierList: &cc.TypeQualifierList{ 3901 // · · TypeQualifier: &cc.TypeQualifier{ 3902 // · · · Case: 3, 3903 // · · · Token: ATOMIC "_Atomic", 3904 // · · }, 3905 // · }, 3906 // } 3907 } 3908 3909 func ExampleTypeSpecifier_bool() { 3910 fmt.Println(exampleAST(96, "\U00100001 _Bool (")) 3911 // Output: 3912 // &cc.TypeSpecifier{ 3913 // · Token: BOOL "_Bool", 3914 // } 3915 } 3916 3917 func ExampleTypeSpecifier_complex() { 3918 fmt.Println(exampleAST(97, "\U00100001 _Complex (")) 3919 // Output: 3920 // &cc.TypeSpecifier{ 3921 // · Case: 1, 3922 // · Token: COMPLEX "_Complex", 3923 // } 3924 } 3925 3926 func ExampleTypeSpecifier_imaginary() { 3927 fmt.Println(exampleAST(98, "\U00100001 _Imaginary (")) 3928 // Output: 3929 // &cc.TypeSpecifier{ 3930 // · Case: 2, 3931 // · Token: IMAGINARY "_Imaginary", 3932 // } 3933 } 3934 3935 func ExampleTypeSpecifier_char() { 3936 fmt.Println(exampleAST(99, "\U00100001 char (")) 3937 // Output: 3938 // &cc.TypeSpecifier{ 3939 // · Case: 3, 3940 // · Token: CHAR "char", 3941 // } 3942 } 3943 3944 func ExampleTypeSpecifier_double() { 3945 fmt.Println(exampleAST(100, "\U00100001 double (")) 3946 // Output: 3947 // &cc.TypeSpecifier{ 3948 // · Case: 4, 3949 // · Token: DOUBLE "double", 3950 // } 3951 } 3952 3953 func ExampleTypeSpecifier_float() { 3954 fmt.Println(exampleAST(101, "\U00100001 float (")) 3955 // Output: 3956 // &cc.TypeSpecifier{ 3957 // · Case: 5, 3958 // · Token: FLOAT "float", 3959 // } 3960 } 3961 3962 func ExampleTypeSpecifier_int() { 3963 fmt.Println(exampleAST(102, "\U00100001 int (")) 3964 // Output: 3965 // &cc.TypeSpecifier{ 3966 // · Case: 6, 3967 // · Token: INT "int", 3968 // } 3969 } 3970 3971 func ExampleTypeSpecifier_long() { 3972 fmt.Println(exampleAST(103, "\U00100001 long (")) 3973 // Output: 3974 // &cc.TypeSpecifier{ 3975 // · Case: 7, 3976 // · Token: LONG "long", 3977 // } 3978 } 3979 3980 func ExampleTypeSpecifier_short() { 3981 fmt.Println(exampleAST(104, "\U00100001 short (")) 3982 // Output: 3983 // &cc.TypeSpecifier{ 3984 // · Case: 8, 3985 // · Token: SHORT "short", 3986 // } 3987 } 3988 3989 func ExampleTypeSpecifier_signed() { 3990 fmt.Println(exampleAST(105, "\U00100001 signed (")) 3991 // Output: 3992 // &cc.TypeSpecifier{ 3993 // · Case: 9, 3994 // · Token: SIGNED "signed", 3995 // } 3996 } 3997 3998 func ExampleTypeSpecifier_unsigned() { 3999 fmt.Println(exampleAST(106, "\U00100001 unsigned (")) 4000 // Output: 4001 // &cc.TypeSpecifier{ 4002 // · Case: 10, 4003 // · Token: UNSIGNED "unsigned", 4004 // } 4005 } 4006 4007 func ExampleTypeSpecifier_void() { 4008 fmt.Println(exampleAST(107, "\U00100001 void (")) 4009 // Output: 4010 // &cc.TypeSpecifier{ 4011 // · Case: 11, 4012 // · Token: VOID "void", 4013 // } 4014 } 4015 4016 func ExampleTypeSpecifier_enum() { 4017 fmt.Println(exampleAST(108, "\U00100001 enum a (")) 4018 // Output: 4019 // &cc.TypeSpecifier{ 4020 // · Case: 12, 4021 // · EnumSpecifier: &cc.EnumSpecifier{ 4022 // · · Token: ENUM "enum", 4023 // · · Token2: IDENTIFIER "a", 4024 // · }, 4025 // } 4026 } 4027 4028 func ExampleTypeSpecifier_struct() { 4029 fmt.Println(exampleAST(109, "\U00100001 struct a (")) 4030 // Output: 4031 // &cc.TypeSpecifier{ 4032 // · Case: 13, 4033 // · StructOrUnionSpecifier: &cc.StructOrUnionSpecifier{ 4034 // · · StructOrUnion: &cc.StructOrUnion{ 4035 // · · · Token: STRUCT "struct", 4036 // · · }, 4037 // · · Token: IDENTIFIER "a", 4038 // · }, 4039 // } 4040 } 4041 4042 func ExampleTypeSpecifier_name() { 4043 fmt.Println(exampleAST(110, "\U00100001 typedef int foo; foo bar;")) 4044 // Output: 4045 // &cc.TypeSpecifier{ 4046 // · Case: 14, 4047 // · Token: TYPEDEF_NAME "foo", 4048 // } 4049 } 4050 4051 func ExampleTypeSpecifier_typeofExpr() { 4052 fmt.Println(exampleAST(111, "\U00100001 typeof ( 'a' ) (")) 4053 // Output: 4054 // &cc.TypeSpecifier{ 4055 // · Case: 15, 4056 // · Expr: &cc.Expr{ 4057 // · · Case: ExprChar, 4058 // · · Token: CHARCONST "'a'", 4059 // · }, 4060 // · Token: TYPEOF "typeof", 4061 // · Token2: '(', 4062 // · Token3: ')', 4063 // } 4064 } 4065 4066 func ExampleTypeSpecifier_typeof() { 4067 fmt.Println(exampleAST(112, "\U00100001 typeof ( _Atomic ) (")) 4068 // Output: 4069 // &cc.TypeSpecifier{ 4070 // · Case: 16, 4071 // · Token: TYPEOF "typeof", 4072 // · Token2: '(', 4073 // · Token3: ')', 4074 // · TypeName: &cc.TypeName{ 4075 // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ 4076 // · · · TypeQualifier: &cc.TypeQualifier{ 4077 // · · · · Case: 3, 4078 // · · · · Token: ATOMIC "_Atomic", 4079 // · · · }, 4080 // · · }, 4081 // · }, 4082 // } 4083 } 4084 4085 func ExampleTypeSpecifier_atomic() { 4086 fmt.Println(exampleAST(113, "\U00100001 _Atomic ( _Atomic ) (")) 4087 // Output: 4088 // TODO: example113.c:1:12: unexpected _Atomic, expected declarator or one of ['(', '*', identifier] 4089 } 4090 4091 func ExamplestatementEnd_case0() { 4092 fmt.Println(exampleAST(221, "\U00100001 a { ;") == (*statementEnd)(nil)) 4093 // Output: 4094 }