Pkg.go.dev is a new destination for Go discovery & docs. Check it out at pkg.go.dev/github.com/cznic/cc and share your feedback.

package cc

import "github.com/cznic/cc"

Package cc is a C99 compiler front end.

2018-07-01 This package is no longer maintained. Please see the v2 version at

Referenced from elsewhere:

ast.go ast2.go cc.go cpp.go encoding.go etc.go global.go kind_string.go lexer.go linkage_string.go model.go namespace_string.go parser.go scanner.go scope_string.go trigraphs.go ucn64.go

❖ const ( ADDASSIGN = 57346 ALIGNOF = 57347 ANDAND = 57348 ANDASSIGN = 57349 ARROW = 57350 ASM = 57351 AUTO = 57352 BOOL = 57353 BREAK = 57354 CASE = 57355 CAST = 57356 CHAR = 57357 CHARCONST = 57358 COMPLEX = 57359 CONST = 57360 CONSTANT_EXPRESSION = 1048577 CONTINUE = 57361 DDD = 57362 DEC = 57363 DEFAULT = 57364 DIVASSIGN = 57365 DO = 57366 DOUBLE = 57367 ELSE = 57368 ENUM = 57369 EQ = 57370 EXTERN = 57371 FLOAT = 57372 FLOATCONST = 57373 FOR = 57374 GEQ = 57375 GOTO = 57376 IDENTIFIER = 57377 IDENTIFIER_LPAREN = 57378 IDENTIFIER_NONREPL = 57379 IF = 57380 INC = 57381 INLINE = 57382 INT = 57383 INTCONST = 57384 LEQ = 57385 LONG = 57386 LONGCHARCONST = 57387 LONGSTRINGLITERAL = 57388 LSH = 57389 LSHASSIGN = 57390 MODASSIGN = 57391 MULASSIGN = 57392 NEQ = 57393 NOELSE = 57394 NORETURN = 57395 NOSEMI = 57396 ORASSIGN = 57397 OROR = 57398 PPDEFINE = 57399 PPELIF = 57400 PPELSE = 57401 PPENDIF = 57402 PPERROR = 57403 PPHASH_NL = 57404 PPHEADER_NAME = 57405 PPIF = 57406 PPIFDEF = 57407 PPIFNDEF = 57408 PPINCLUDE = 57409 PPINCLUDE_NEXT = 57410 PPLINE = 57411 PPNONDIRECTIVE = 57412 PPNUMBER = 57413 PPOTHER = 57414 PPPASTE = 57415 PPPRAGMA = 57416 PPUNDEF = 57417 PREPROCESSING_FILE = 1048576 REGISTER = 57418 RESTRICT = 57419 RETURN = 57420 RSH = 57421 RSHASSIGN = 57422 SHORT = 57423 SIGNED = 57424 SIZEOF = 57425 STATIC = 57426 STATIC_ASSERT = 57427 STRINGLITERAL = 57428 STRUCT = 57429 SUBASSIGN = 57430 SWITCH = 57431 TRANSLATION_UNIT = 1048578 TYPEDEF = 57432 TYPEDEFNAME = 57433 TYPEOF = 57434 UNARY = 57435 UNION = 57436 UNSIGNED = 57437 VOID = 57438 VOLATILE = 57439 WHILE = 57440 XORASSIGN = 57441 )

❖ func HostConfig(opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error)

HostConfig executes HostCppConfig with the cpp argument set to "cpp". For more info please see the documentation of HostCppConfig.

❖ func HostCppConfig(cpp string, opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error)

HostCppConfig returns the system C preprocessor configuration, or an error, if any. The configuration is obtained by running the cpp command. For the predefined macros list the '-dM' options is added. For the include paths lists, the option '-v' is added and the output is parsed to extract the "..." include and <...> include paths. To add any other options to cpp, list them in opts.

The function relies on a POSIX compatible C preprocessor installed. Execution of HostConfig is not free, so caching the results is recommended whenever possible.

ImportPath returns the import path of this package or an error, if any.

IsArithmeticType reports wheter t.Kind() is one of UintPtr, Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, FloatComplex, DoubleComplex, LongDoubleComplex, Bool or Enum.

IsIntType reports t.Kind() is one of Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Bool or Enum.

PrettyString pretty prints things produced by this package.

TokSrc returns t in its source form.

❖ type AbstractDeclarator struct { Case int DirectAbstractDeclarator *DirectAbstractDeclarator Pointer *Pointer PointerOpt *PointerOpt // contains filtered or unexported fields }

AbstractDeclarator represents data reduced by productions:

AbstractDeclarator: Pointer | PointerOpt DirectAbstractDeclarator // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type AbstractDeclaratorOpt struct { AbstractDeclarator *AbstractDeclarator }

AbstractDeclaratorOpt represents data reduced by productions:

AbstractDeclaratorOpt: /* empty */ | AbstractDeclarator // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ArgumentExpressionList struct { ArgumentExpressionList *ArgumentExpressionList Case int Expression *Expression Token xc.Token }

ArgumentExpressionList represents data reduced by productions:

ArgumentExpressionList: Expression | ArgumentExpressionList ',' Expression // Case 1

Example Code: fmt.Println(exampleAST(8, "\U00100001 'a' ( 'b' )")) Output: &cc.ArgumentExpressionList{ · Expression: &cc.Expression{ · · Case: 1, · · Token: example8.c:1:8: CHARCONST "'b'", · }, } Example (Case1) Code: fmt.Println(exampleAST(9, "\U00100001 'a' ( 'b' , 'c' )")) Output: &cc.ArgumentExpressionList{ · ArgumentExpressionList: &cc.ArgumentExpressionList{ · · Case: 1, · · Expression: &cc.Expression{ · · · Case: 1, · · · Token: example9.c:1:14: CHARCONST "'c'", · · }, · · Token: example9.c:1:12: ',', · }, · Expression: &cc.Expression{ · · Case: 1, · · Token: example9.c:1:8: CHARCONST "'b'", · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ArgumentExpressionListOpt struct { ArgumentExpressionList *ArgumentExpressionList }

ArgumentExpressionListOpt represents data reduced by productions:

ArgumentExpressionListOpt: /* empty */ | ArgumentExpressionList // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type AssemblerInstructions struct { AssemblerInstructions *AssemblerInstructions Case int Token xc.Token }

AssemblerInstructions represents data reduced by productions:

AssemblerInstructions: STRINGLITERAL | AssemblerInstructions STRINGLITERAL // Case 1

Example Code: fmt.Println(exampleAST(265, "\U00100002 asm ( \"a\" )")) Output: &cc.AssemblerInstructions{ · Token: example265.c:1:8: STRINGLITERAL "\"a\"", } Example (Case1) Code: fmt.Println(exampleAST(266, "\U00100002 asm ( \"a\" \"b\" )")) Output: &cc.AssemblerInstructions{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Case: 1, · · Token: example266.c:1:12: STRINGLITERAL "\"b\"", · }, · Token: example266.c:1:8: STRINGLITERAL "\"a\"", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type AssemblerOperand struct { AssemblerSymbolicNameOpt *AssemblerSymbolicNameOpt Expression *Expression Token xc.Token Token2 xc.Token Token3 xc.Token }

AssemblerOperand represents data reduced by production:

AssemblerOperand: AssemblerSymbolicNameOpt STRINGLITERAL '(' Expression ')'

Example Code: fmt.Println(exampleAST(270, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) )")) Output: &cc.AssemblerOperand{ · Expression: &cc.Expression{ · · Case: 1, · · Token: example270.c:1:22: CHARCONST "'d'", · }, · Token: example270.c:1:16: STRINGLITERAL "\"c\"", · Token2: example270.c:1:20: '(', · Token3: example270.c:1:26: ')', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type AssemblerOperands struct { AssemblerOperand *AssemblerOperand AssemblerOperands *AssemblerOperands Case int Token xc.Token }

AssemblerOperands represents data reduced by productions:

AssemblerOperands: AssemblerOperand | AssemblerOperands ',' AssemblerOperand // Case 1

Example Code: fmt.Println(exampleAST(271, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) )")) Output: &cc.AssemblerOperands{ · AssemblerOperand: &cc.AssemblerOperand{ · · Expression: &cc.Expression{ · · · Case: 1, · · · Token: example271.c:1:22: CHARCONST "'d'", · · }, · · Token: example271.c:1:16: STRINGLITERAL "\"c\"", · · Token2: example271.c:1:20: '(', · · Token3: example271.c:1:26: ')', · }, } Example (Case1) Code: fmt.Println(exampleAST(272, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) , \"e\" ( 'f' ) )")) Output: &cc.AssemblerOperands{ · AssemblerOperand: &cc.AssemblerOperand{ · · Expression: &cc.Expression{ · · · Case: 1, · · · Token: example272.c:1:22: CHARCONST "'d'", · · }, · · Token: example272.c:1:16: STRINGLITERAL "\"c\"", · · Token2: example272.c:1:20: '(', · · Token3: example272.c:1:26: ')', · }, · AssemblerOperands: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example272.c:1:36: CHARCONST "'f'", · · · }, · · · Token: example272.c:1:30: STRINGLITERAL "\"e\"", · · · Token2: example272.c:1:34: '(', · · · Token3: example272.c:1:40: ')', · · }, · · Case: 1, · · Token: example272.c:1:28: ',', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type AssemblerStatement struct { AssemblerInstructions *AssemblerInstructions AssemblerOperands *AssemblerOperands AssemblerOperands2 *AssemblerOperands BasicAssemblerStatement *BasicAssemblerStatement Case int Clobbers *Clobbers IdentifierList *IdentifierList Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token Token6 xc.Token Token7 xc.Token Token8 xc.Token VolatileOpt *VolatileOpt }

AssemblerStatement represents data reduced by productions:

AssemblerStatement: BasicAssemblerStatement | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ')' // Case 1 | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ')' // Case 2 | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ':' Clobbers ')' // Case 3 | "asm" VolatileOpt "goto" '(' AssemblerInstructions ':' ':' AssemblerOperands ':' Clobbers ':' IdentifierList ')' // Case 4 | "asm" VolatileOpt '(' AssemblerInstructions ':' ')' // Case 5 | "asm" VolatileOpt '(' AssemblerInstructions ':' ':' AssemblerOperands ')' // Case 6

Example Code: fmt.Println(exampleAST(277, "\U00100002 a asm ( \"b\" ) !")) Output: &cc.AssemblerStatement{ · BasicAssemblerStatement: &cc.BasicAssemblerStatement{ · · AssemblerInstructions: &cc.AssemblerInstructions{ · · · Token: example277.c:1:10: STRINGLITERAL "\"b\"", · · }, · · Token: example277.c:1:4: ASM "asm", · · Token2: example277.c:1:8: '(', · · Token3: example277.c:1:14: ')', · }, } Example (Case1) Code: fmt.Println(exampleAST(278, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) ) !")) Output: &cc.AssemblerStatement{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Token: example278.c:1:10: STRINGLITERAL "\"b\"", · }, · AssemblerOperands: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example278.c:1:22: CHARCONST "'d'", · · · }, · · · Token: example278.c:1:16: STRINGLITERAL "\"c\"", · · · Token2: example278.c:1:20: '(', · · · Token3: example278.c:1:26: ')', · · }, · }, · Case: 1, · Token: example278.c:1:4: ASM "asm", · Token2: example278.c:1:8: '(', · Token3: example278.c:1:14: ':', · Token4: example278.c:1:28: ')', } Example (Case2) Code: fmt.Println(exampleAST(279, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) : \"e\" ( 'f' ) ) !")) Output: &cc.AssemblerStatement{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Token: example279.c:1:10: STRINGLITERAL "\"b\"", · }, · AssemblerOperands: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example279.c:1:22: CHARCONST "'d'", · · · }, · · · Token: example279.c:1:16: STRINGLITERAL "\"c\"", · · · Token2: example279.c:1:20: '(', · · · Token3: example279.c:1:26: ')', · · }, · }, · AssemblerOperands2: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example279.c:1:36: CHARCONST "'f'", · · · }, · · · Token: example279.c:1:30: STRINGLITERAL "\"e\"", · · · Token2: example279.c:1:34: '(', · · · Token3: example279.c:1:40: ')', · · }, · }, · Case: 2, · Token: example279.c:1:4: ASM "asm", · Token2: example279.c:1:8: '(', · Token3: example279.c:1:14: ':', · Token4: example279.c:1:28: ':', · Token5: example279.c:1:42: ')', } Example (Case3) Code: fmt.Println(exampleAST(280, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) : \"e\" ( 'f' ) : \"g\" ) !")) Output: &cc.AssemblerStatement{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Token: example280.c:1:10: STRINGLITERAL "\"b\"", · }, · AssemblerOperands: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example280.c:1:22: CHARCONST "'d'", · · · }, · · · Token: example280.c:1:16: STRINGLITERAL "\"c\"", · · · Token2: example280.c:1:20: '(', · · · Token3: example280.c:1:26: ')', · · }, · }, · AssemblerOperands2: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example280.c:1:36: CHARCONST "'f'", · · · }, · · · Token: example280.c:1:30: STRINGLITERAL "\"e\"", · · · Token2: example280.c:1:34: '(', · · · Token3: example280.c:1:40: ')', · · }, · }, · Case: 3, · Clobbers: &cc.Clobbers{ · · Token: example280.c:1:44: STRINGLITERAL "\"g\"", · }, · Token: example280.c:1:4: ASM "asm", · Token2: example280.c:1:8: '(', · Token3: example280.c:1:14: ':', · Token4: example280.c:1:28: ':', · Token5: example280.c:1:42: ':', · Token6: example280.c:1:48: ')', } Example (Case4) Code: fmt.Println(exampleAST(281, "\U00100002 a asm goto ( \"b\" : : \"c\" ( 'd' ) : \"e\" : f ) !")) Output: &cc.AssemblerStatement{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Token: example281.c:1:15: STRINGLITERAL "\"b\"", · }, · AssemblerOperands: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example281.c:1:29: CHARCONST "'d'", · · · }, · · · Token: example281.c:1:23: STRINGLITERAL "\"c\"", · · · Token2: example281.c:1:27: '(', · · · Token3: example281.c:1:33: ')', · · }, · }, · Case: 4, · Clobbers: &cc.Clobbers{ · · Token: example281.c:1:37: STRINGLITERAL "\"e\"", · }, · IdentifierList: &cc.IdentifierList{ · · Token: example281.c:1:43: IDENTIFIER "f", · }, · Token: example281.c:1:4: ASM "asm", · Token2: example281.c:1:8: GOTO "goto", · Token3: example281.c:1:13: '(', · Token4: example281.c:1:19: ':', · Token5: example281.c:1:21: ':', · Token6: example281.c:1:35: ':', · Token7: example281.c:1:41: ':', · Token8: example281.c:1:45: ')', } Example (Case5) Code: fmt.Println(exampleAST(282, "\U00100002 a asm ( \"b\" : ) !")) Output: &cc.AssemblerStatement{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Token: example282.c:1:10: STRINGLITERAL "\"b\"", · }, · Case: 5, · Token: example282.c:1:4: ASM "asm", · Token2: example282.c:1:8: '(', · Token3: example282.c:1:14: ':', · Token4: example282.c:1:16: ')', } Example (Case6) Code: fmt.Println(exampleAST(283, "\U00100002 a asm ( \"b\" : : \"c\" ( 'd' ) ) !")) Output: &cc.AssemblerStatement{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Token: example283.c:1:10: STRINGLITERAL "\"b\"", · }, · AssemblerOperands: &cc.AssemblerOperands{ · · AssemblerOperand: &cc.AssemblerOperand{ · · · Expression: &cc.Expression{ · · · · Case: 1, · · · · Token: example283.c:1:24: CHARCONST "'d'", · · · }, · · · Token: example283.c:1:18: STRINGLITERAL "\"c\"", · · · Token2: example283.c:1:22: '(', · · · Token3: example283.c:1:28: ')', · · }, · }, · Case: 6, · Token: example283.c:1:4: ASM "asm", · Token2: example283.c:1:8: '(', · Token3: example283.c:1:14: ':', · Token4: example283.c:1:16: ':', · Token5: example283.c:1:30: ')', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type AssemblerSymbolicNameOpt struct { Token xc.Token Token2 xc.Token Token3 xc.Token }

AssemblerSymbolicNameOpt represents data reduced by productions:

AssemblerSymbolicNameOpt: /* empty */ | '[' IDENTIFIER ']' // Case 1

Example Code: fmt.Println(exampleAST(273, "\U00100002 a asm goto ( \"b\" : : \"c\"") == (*AssemblerSymbolicNameOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(274, "\U00100002 a asm ( \"b\" : [ c ] \"d\"")) Output: &cc.AssemblerSymbolicNameOpt{ · Token: example274.c:1:16: '[', · Token2: example274.c:1:18: IDENTIFIER "c", · Token3: example274.c:1:20: ']', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type BasicAssemblerStatement struct { AssemblerInstructions *AssemblerInstructions Token xc.Token Token2 xc.Token Token3 xc.Token VolatileOpt *VolatileOpt }

BasicAssemblerStatement represents data reduced by production:

BasicAssemblerStatement: "asm" VolatileOpt '(' AssemblerInstructions ')'

Example Code: fmt.Println(exampleAST(267, "\U00100002 asm ( \"a\" ) !")) Output: &cc.BasicAssemblerStatement{ · AssemblerInstructions: &cc.AssemblerInstructions{ · · Token: example267.c:1:8: STRINGLITERAL "\"a\"", · }, · Token: example267.c:1:2: ASM "asm", · Token2: example267.c:1:6: '(', · Token3: example267.c:1:12: ')', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Binding struct { Node Node // contains filtered or unexported fields }

Binding records the declaration Node of a declared name.

In the NSIdentifiers namespace the dynamic type of Node for declared names is always *DirectDeclarator. The *Declarator associated with the direct declarator is available via (*DirectDeclarator).TopDeclarator().

int* p;

In the NSTags namespace the dynamic type of Node is xc.Token when a tag is declared:

struct foo; enum bar;

When a tag is defined, the dynamic type of Node is *EnumSpecifier or *StructOrUnionSpecifier:

struct foo { int i; }; enum bar { a = 1 };

❖ type Bindings struct { Identifiers map[int]Binding // NSIdentifiers name space bindings. map[int]Binding // NSTags name space bindings. Parent *Bindings // Parent scope or nil for ScopeFile. // contains filtered or unexported fields }

Bindings record names declared in a scope.

❖ func (b *Bindings) Lookup(ns Namespace, id int) Binding

Lookup returns the Binding of id in ns or any of its parents. If id is undeclared, the returned Binding has its Node field set to nil.

❖ func (b *Bindings) Lookup2(ns Namespace, id int) (Binding, *Bindings)

Lookup2 is like Lookup but addionally it returns also the scope in which id was found.

Scope retuns the kind of b.

❖ type BlockItem struct { Case int Declaration *Declaration Statement *Statement }

BlockItem represents data reduced by productions:

BlockItem: Declaration | Statement // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type BlockItemList struct { BlockItem *BlockItem BlockItemList *BlockItemList Case int }

BlockItemList represents data reduced by productions:

BlockItemList: BlockItem | BlockItemList BlockItem // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type BlockItemListOpt struct { BlockItemList *BlockItemList }

BlockItemListOpt represents data reduced by productions:

BlockItemListOpt: /* empty */ | BlockItemList // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Clobbers struct { Case int Clobbers *Clobbers Token xc.Token Token2 xc.Token }

Clobbers represents data reduced by productions:

Clobbers: STRINGLITERAL | Clobbers ',' STRINGLITERAL // Case 1

Example Code: fmt.Println(exampleAST(275, "\U00100002 a asm goto ( \"b\" : : \"c\" ( 'd' ) : \"e\" )")) Output: &cc.Clobbers{ · Token: example275.c:1:37: STRINGLITERAL "\"e\"", } Example (Case1) Code: fmt.Println(exampleAST(276, "\U00100002 a asm goto ( \"b\" : : \"c\" ( 'd' ) : \"e\" , \"f\" )")) Output: &cc.Clobbers{ · Clobbers: &cc.Clobbers{ · · Case: 1, · · Token: example276.c:1:41: ',', · · Token2: example276.c:1:43: STRINGLITERAL "\"f\"", · }, · Token: example276.c:1:37: STRINGLITERAL "\"e\"", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type CommaOpt struct { Token xc.Token }

CommaOpt represents data reduced by productions:

CommaOpt: /* empty */ | ',' // Case 1

Example Code: fmt.Println(exampleAST(135, "\U00100002 auto a = { }") == (*CommaOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(136, "\U00100002 auto a = { , }")) Output: &cc.CommaOpt{ · Token: example136.c:1:13: ',', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type CompoundStatement struct { BlockItemListOpt *BlockItemListOpt Token xc.Token Token2 xc.Token // contains filtered or unexported fields }

CompoundStatement represents data reduced by production:

CompoundStatement: '{' BlockItemListOpt '}'

Pos reports the position of the first component of n or zero if it's empty.

Scope returns n's scope.

String implements fmt.Stringer.

❖ type ComputedGotoID int

StringLitID is the type of an Expression.Value representing the numeric ID of a label name used in &&label.

❖ type ConstantExpression struct { Type Type // Type of expression. Value interface{} // Non nil for certain constant expressions. Expression *Expression // contains filtered or unexported fields }

ConstantExpression represents data reduced by production:

ConstantExpression: Expression

Example Code: fmt.Println(exampleAST(79, "\U00100001 'a'")) Output: &cc.ConstantExpression{ · Type: int, · Value: 97, · Expression: &cc.Expression{ · · Type: int, · · Value: 97, · · Case: 1, · · Token: example79.c:1:2: CHARCONST "'a'", · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ControlLine struct { Case int IdentifierList *IdentifierList IdentifierListOpt *IdentifierListOpt PPTokenList PPTokenList PPTokenListOpt PPTokenList ReplacementList PPTokenList Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token }

ControlLine represents data reduced by productions:

ControlLine: PPDEFINE IDENTIFIER ReplacementList | PPDEFINE IDENTIFIER_LPAREN "..." ')' ReplacementList // Case 1 | PPDEFINE IDENTIFIER_LPAREN IdentifierList ',' "..." ')' ReplacementList // Case 2 | PPDEFINE IDENTIFIER_LPAREN IdentifierListOpt ')' ReplacementList // Case 3 | PPERROR PPTokenListOpt // Case 4 | PPHASH_NL // Case 5 | PPINCLUDE PPTokenList '

' // Case 6 | PPLINE PPTokenList '

' // Case 7 | PPPRAGMA PPTokenListOpt // Case 8 | PPUNDEF IDENTIFIER '

' // Case 9 | PPDEFINE IDENTIFIER_LPAREN IdentifierList "..." ')' ReplacementList // Case 10 | PPDEFINE '

' // Case 11 | PPUNDEF IDENTIFIER PPTokenList '

' // Case 12 | PPINCLUDE_NEXT PPTokenList '

' // Case 13

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Declaration struct { Case int DeclarationSpecifiers *DeclarationSpecifiers InitDeclaratorListOpt *InitDeclaratorListOpt StaticAssertDeclaration *StaticAssertDeclaration Token xc.Token // contains filtered or unexported fields }

Declaration represents data reduced by productions:

Declaration: DeclarationSpecifiers InitDeclaratorListOpt ';' | StaticAssertDeclaration // Case 1

Example Code: fmt.Println(exampleAST(80, "\U00100002 auto ;")) Output: &cc.Declaration{ · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · Case: 3, · · · Token: example80.c:1:2: AUTO "auto", · · }, · }, · Token: example80.c:1:7: ';', } Example (Case1) Code: fmt.Println(exampleAST(81, "\U00100002 _Static_assert ( 'a' , \"b\" ) ;")) Output: &cc.Declaration{ · Case: 1, · StaticAssertDeclaration: &cc.StaticAssertDeclaration{ · · ConstantExpression: &cc.ConstantExpression{ · · · Type: int, · · · Value: 97, · · · Expression: &cc.Expression{ · · · · Type: int, · · · · Value: 97, · · · · Case: 1, · · · · Token: example81.c:1:19: CHARCONST "'a'", · · · }, · · }, · · Token: example81.c:1:2: STATIC_ASSERT "_Static_assert", · · Token2: example81.c:1:17: '(', · · Token3: example81.c:1:23: ',', · · Token4: example81.c:1:25: STRINGLITERAL "\"b\"", · · Token5: example81.c:1:29: ')', · · Token6: example81.c:1:31: ';', · }, }

Declarator returns a synthetic Declarator when n.InitDeclaratorListOpt is nil.

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DeclarationList struct { Case int Declaration *Declaration DeclarationList *DeclarationList }

DeclarationList represents data reduced by productions:

DeclarationList: Declaration | DeclarationList Declaration // Case 1

Example Code: fmt.Println(exampleAST(260, "\U00100002 a auto ; {")) Output: &cc.DeclarationList{ · Declaration: &cc.Declaration{ · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · Case: 3, · · · · Token: example260.c:1:4: AUTO "auto", · · · }, · · }, · · Token: example260.c:1:9: ';', · }, } Example (Case1) Code: fmt.Println(exampleAST(261, "\U00100002 a auto ; auto ; {")) Output: &cc.DeclarationList{ · Declaration: &cc.Declaration{ · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · Case: 3, · · · · Token: example261.c:1:4: AUTO "auto", · · · }, · · }, · · Token: example261.c:1:9: ';', · }, · DeclarationList: &cc.DeclarationList{ · · Case: 1, · · Declaration: &cc.Declaration{ · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · · Case: 3, · · · · · Token: example261.c:1:11: AUTO "auto", · · · · }, · · · }, · · · Token: example261.c:1:16: ';', · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DeclarationListOpt struct { DeclarationList *DeclarationList // contains filtered or unexported fields }

DeclarationListOpt represents data reduced by productions:

DeclarationListOpt: /* empty */ | DeclarationList // Case 1

Example Code: fmt.Println(exampleAST(262, "\U00100002 a {") == (*DeclarationListOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(264, "\U00100002 a auto ; {")) Output: &cc.DeclarationListOpt{ · DeclarationList: &cc.DeclarationList{ · · Declaration: &cc.Declaration{ · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · · Case: 3, · · · · · Token: example264.c:1:4: AUTO "auto", · · · · }, · · · }, · · · Token: example264.c:1:9: ';', · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DeclarationSpecifiers struct { Case int DeclarationSpecifiersOpt *DeclarationSpecifiersOpt FunctionSpecifier *FunctionSpecifier StorageClassSpecifier *StorageClassSpecifier TypeQualifier *TypeQualifier TypeSpecifier *TypeSpecifier // contains filtered or unexported fields }

DeclarationSpecifiers represents data reduced by productions:

DeclarationSpecifiers: StorageClassSpecifier DeclarationSpecifiersOpt | TypeSpecifier DeclarationSpecifiersOpt // Case 1 | TypeQualifier DeclarationSpecifiersOpt // Case 2 | FunctionSpecifier DeclarationSpecifiersOpt // Case 3

IsAuto implements specifier.

IsConst returns whether n includes the 'const' type qualifier.

IsExtern implements specifier.

IsInline implements specifier.

IsRegister implements specifier.

IsRestrict implements specifier.

IsStatic implements specifier.

IsTypedef implements specifier.

IsVolatile implements specifier.

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

TypedefName implements Specifier.

❖ type DeclarationSpecifiersOpt struct { DeclarationSpecifiers *DeclarationSpecifiers // contains filtered or unexported fields }

DeclarationSpecifiersOpt represents data reduced by productions:

DeclarationSpecifiersOpt: /* empty */ | DeclarationSpecifiers // Case 1

Example Code: fmt.Println(exampleAST(86, "\U00100002 auto (") == (*DeclarationSpecifiersOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(87, "\U00100002 auto auto (")) Output: &cc.DeclarationSpecifiersOpt{ · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · Case: 3, · · · Token: example87.c:1:7: AUTO "auto", · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Declarator struct { Linkage Linkage Type Type DirectDeclarator *DirectDeclarator PointerOpt *PointerOpt // contains filtered or unexported fields }

Declarator represents data reduced by production:

Declarator: PointerOpt DirectDeclarator

Example Code: fmt.Println(exampleAST(149, "\U00100002 a )")) Output: &cc.Declarator{ · Linkage: None, · DirectDeclarator: &cc.DirectDeclarator{ · · Token: example149.c:1:2: IDENTIFIER "a", · }, }

Identifier returns the ID of the name declared by n and the scope the name is declared in.

Pos reports the position of the first component of n or zero if it's empty.

RawSpecifier returns the raw Specifier associated with n before expanding typedefs. The effective Specifier is accessible via the Type field of n.

String implements fmt.Stringer.

❖ type DeclaratorOpt struct { Declarator *Declarator }

DeclaratorOpt represents data reduced by productions:

DeclaratorOpt: /* empty */ | Declarator // Case 1

Example Code: fmt.Println(exampleAST(150, "\U00100002 struct { _Bool :") == (*DeclaratorOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(151, "\U00100002 struct { _Bool a :")) Output: &cc.DeclaratorOpt{ · Declarator: &cc.Declarator{ · · Linkage: None, · · DirectDeclarator: &cc.DirectDeclarator{ · · · Token: example151.c:1:17: IDENTIFIER "a", · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Designation struct { DesignatorList *DesignatorList Token xc.Token }

Designation represents data reduced by production:

Designation: DesignatorList '='

Example Code: fmt.Println(exampleAST(207, "\U00100002 auto a = { . b = !")) Output: &cc.Designation{ · DesignatorList: &cc.DesignatorList{ · · Designator: &cc.Designator{ · · · Case: 1, · · · Token: example207.c:1:13: '.', · · · Token2: example207.c:1:15: IDENTIFIER "b", · · }, · }, · Token: example207.c:1:17: '=', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DesignationOpt struct { Designation *Designation }

DesignationOpt represents data reduced by productions:

DesignationOpt: /* empty */ | Designation // Case 1

Example Code: fmt.Println(exampleAST(208, "\U00100002 auto a = { !") == (*DesignationOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(209, "\U00100002 auto a = { . b = !")) Output: &cc.DesignationOpt{ · Designation: &cc.Designation{ · · DesignatorList: &cc.DesignatorList{ · · · Designator: &cc.Designator{ · · · · Case: 1, · · · · Token: example209.c:1:13: '.', · · · · Token2: example209.c:1:15: IDENTIFIER "b", · · · }, · · }, · · Token: example209.c:1:17: '=', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Designator struct { Case int ConstantExpression *ConstantExpression Token xc.Token Token2 xc.Token }

Designator represents data reduced by productions:

Designator: '[' ConstantExpression ']' | '.' IDENTIFIER // Case 1

Example Code: fmt.Println(exampleAST(212, "\U00100002 auto a = { [ 'b' ] .")) Output: &cc.Designator{ · ConstantExpression: &cc.ConstantExpression{ · · Type: int, · · Value: 98, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 98, · · · Case: 1, · · · Token: example212.c:1:15: CHARCONST "'b'", · · }, · }, · Token: example212.c:1:13: '[', · Token2: example212.c:1:19: ']', } Example (Case1) Code: fmt.Println(exampleAST(213, "\U00100002 auto a = { . b .")) Output: &cc.Designator{ · Case: 1, · Token: example213.c:1:13: '.', · Token2: example213.c:1:15: IDENTIFIER "b", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DesignatorList struct { Case int Designator *Designator DesignatorList *DesignatorList }

DesignatorList represents data reduced by productions:

DesignatorList: Designator | DesignatorList Designator // Case 1

Example Code: fmt.Println(exampleAST(210, "\U00100002 auto a = { . b .")) Output: &cc.DesignatorList{ · Designator: &cc.Designator{ · · Case: 1, · · Token: example210.c:1:13: '.', · · Token2: example210.c:1:15: IDENTIFIER "b", · }, } Example (Case1) Code: fmt.Println(exampleAST(211, "\U00100002 auto a = { . b . c .")) Output: &cc.DesignatorList{ · Designator: &cc.Designator{ · · Case: 1, · · Token: example211.c:1:13: '.', · · Token2: example211.c:1:15: IDENTIFIER "b", · }, · DesignatorList: &cc.DesignatorList{ · · Case: 1, · · Designator: &cc.Designator{ · · · Case: 1, · · · Token: example211.c:1:17: '.', · · · Token2: example211.c:1:19: IDENTIFIER "c", · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DirectAbstractDeclarator struct { AbstractDeclarator *AbstractDeclarator Case int DirectAbstractDeclarator *DirectAbstractDeclarator DirectAbstractDeclaratorOpt *DirectAbstractDeclaratorOpt Expression *Expression ExpressionOpt *ExpressionOpt ParameterTypeListOpt *ParameterTypeListOpt Token xc.Token Token2 xc.Token Token3 xc.Token TypeQualifierList *TypeQualifierList TypeQualifierListOpt *TypeQualifierListOpt // contains filtered or unexported fields }

DirectAbstractDeclarator represents data reduced by productions:

DirectAbstractDeclarator: '(' AbstractDeclarator ')' | DirectAbstractDeclaratorOpt '[' ExpressionOpt ']' // Case 1 | DirectAbstractDeclaratorOpt '[' TypeQualifierList ExpressionOpt ']' // Case 2 | DirectAbstractDeclaratorOpt '[' "static" TypeQualifierListOpt Expression ']' // Case 3 | DirectAbstractDeclaratorOpt '[' TypeQualifierList "static" Expression ']' // Case 4 | DirectAbstractDeclaratorOpt '[' '*' ']' // Case 5 | '(' ParameterTypeListOpt ')' // Case 6 | DirectAbstractDeclarator '(' ParameterTypeListOpt ')' // Case 7

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DirectAbstractDeclaratorOpt struct { DirectAbstractDeclarator *DirectAbstractDeclarator }

DirectAbstractDeclaratorOpt represents data reduced by productions:

DirectAbstractDeclaratorOpt: /* empty */ | DirectAbstractDeclarator // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type DirectDeclarator struct { EnumVal interface{} // Non nil if DD declares an enumeration constant. Case int Declarator *Declarator DirectDeclarator *DirectDeclarator Expression *Expression ExpressionOpt *ExpressionOpt IdentifierListOpt *IdentifierListOpt ParameterTypeList *ParameterTypeList Token xc.Token Token2 xc.Token Token3 xc.Token TypeQualifierList *TypeQualifierList TypeQualifierListOpt *TypeQualifierListOpt // contains filtered or unexported fields }

DirectDeclarator represents data reduced by productions:

DirectDeclarator: IDENTIFIER | '(' Declarator ')' // Case 1 | DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' // Case 2 | DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' // Case 3 | DirectDeclarator '[' TypeQualifierList "static" Expression ']' // Case 4 | DirectDeclarator '[' TypeQualifierListOpt '*' ']' // Case 5 | DirectDeclarator '(' ParameterTypeList ')' // Case 6 | DirectDeclarator '(' IdentifierListOpt ')' // Case 7

DeclarationScope returns the scope a name declared by n is in. If n does not declare a name or n declares a name of a built in type, DeclarationScope returns nil.

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

TopDeclarator returns the top level Declarator associated with n.

❖ type ElifGroup struct { GroupListOpt *GroupListOpt PPTokenList PPTokenList Token xc.Token Token2 xc.Token }

ElifGroup represents data reduced by production:

ElifGroup: PPELIF PPTokenList '

' GroupListOpt

Example Code: fmt.Println(exampleAST(302, "\U00100000

#if other_a

#elif other_b

#elif")) Output: &cc.ElifGroup{ · PPTokenList: []xc.Token{ // len 4 · · 0: example302.c:3:6: ' ', · · 1: example302.c:3:7: IDENTIFIER "other_b", · · 2: example302.c:3:14: ' ', · · 3: example302.c:3:16: ' ', · }, · Token: example302.c:3:2: PPELIF, · Token2: example302.c:3:16: '

', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ElifGroupList struct { Case int ElifGroup *ElifGroup ElifGroupList *ElifGroupList }

ElifGroupList represents data reduced by productions:

ElifGroupList: ElifGroup | ElifGroupList ElifGroup // Case 1

Example Code: fmt.Println(exampleAST(298, "\U00100000

#if other_a

#elif other_b

#elif")) Output: &cc.ElifGroupList{ · ElifGroup: &cc.ElifGroup{ · · PPTokenList: []xc.Token{ // len 4 · · · 0: example298.c:3:6: ' ', · · · 1: example298.c:3:7: IDENTIFIER "other_b", · · · 2: example298.c:3:14: ' ', · · · 3: example298.c:3:16: ' ', · · }, · · Token: example298.c:3:2: PPELIF, · · Token2: example298.c:3:16: '

', · }, } Example (Case1) Code: fmt.Println(exampleAST(299, "\U00100000

#if other_a

#elif other_b

#elif other_c

#elif")) Output: &cc.ElifGroupList{ · ElifGroup: &cc.ElifGroup{ · · PPTokenList: []xc.Token{ // len 4 · · · 0: example299.c:3:6: ' ', · · · 1: example299.c:3:7: IDENTIFIER "other_b", · · · 2: example299.c:3:14: ' ', · · · 3: example299.c:3:16: ' ', · · }, · · Token: example299.c:3:2: PPELIF, · · Token2: example299.c:3:16: '

', · }, · ElifGroupList: &cc.ElifGroupList{ · · Case: 1, · · ElifGroup: &cc.ElifGroup{ · · · PPTokenList: []xc.Token{ // len 4 · · · · 0: example299.c:4:6: ' ', · · · · 1: example299.c:4:7: IDENTIFIER "other_c", · · · · 2: example299.c:4:14: ' ', · · · · 3: example299.c:4:16: ' ', · · · }, · · · Token: example299.c:4:2: PPELIF, · · · Token2: example299.c:4:16: '

', · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ElifGroupListOpt struct { ElifGroupList *ElifGroupList }

ElifGroupListOpt represents data reduced by productions:

ElifGroupListOpt: /* empty */ | ElifGroupList // Case 1

Example Code: fmt.Println(exampleAST(300, "\U00100000

#if other_a

#else") == (*ElifGroupListOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(301, "\U00100000

#if other_a

#elif other_b

#else")) Output: &cc.ElifGroupListOpt{ · ElifGroupList: &cc.ElifGroupList{ · · ElifGroup: &cc.ElifGroup{ · · · PPTokenList: []xc.Token{ // len 4 · · · · 0: example301.c:3:6: ' ', · · · · 1: example301.c:3:7: IDENTIFIER "other_b", · · · · 2: example301.c:3:14: ' ', · · · · 3: example301.c:3:16: ' ', · · · }, · · · Token: example301.c:3:2: PPELIF, · · · Token2: example301.c:3:16: '

', · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ElseGroup struct { GroupListOpt *GroupListOpt Token xc.Token Token2 xc.Token }

ElseGroup represents data reduced by production:

ElseGroup: PPELSE '

' GroupListOpt

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ElseGroupOpt struct { ElseGroup *ElseGroup }

ElseGroupOpt represents data reduced by productions:

ElseGroupOpt: /* empty */ | ElseGroup // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type EndifLine struct { Token xc.Token }

EndifLine represents data reduced by production:

EndifLine: PPENDIF

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type EnumConstant struct { DefTok xc.Token // Enumeration constant name definition token. Value interface{} // Value represented by name. Type of Value is C int. Tokens []xc.Token // The tokens the constant expression consists of. }

EnumConstant represents the name/value pair defined by an Enumerator.

❖ type EnumSpecifier struct { Case int CommaOpt *CommaOpt EnumeratorList *EnumeratorList IdentifierOpt *IdentifierOpt Token xc.Token Token2 xc.Token Token3 xc.Token // contains filtered or unexported fields }

EnumSpecifier represents data reduced by productions:

EnumSpecifier: "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' | "enum" IDENTIFIER // Case 1

Example Code: fmt.Println(exampleAST(138, "\U00100002 enum { a } (")) Output: &cc.EnumSpecifier{ · EnumeratorList: &cc.EnumeratorList{ · · Enumerator: &cc.Enumerator{ · · · EnumerationConstant: &cc.EnumerationConstant{ · · · · Token: example138.c:1:9: IDENTIFIER "a", · · · }, · · }, · }, · Token: example138.c:1:2: ENUM "enum", · Token2: example138.c:1:7: '{', · Token3: example138.c:1:11: '}', } Example (Case1) Code: fmt.Println(exampleAST(139, "\U00100002 enum a (")) Output: &cc.EnumSpecifier{ · Case: 1, · Token: example139.c:1:2: ENUM "enum", · Token2: example139.c:1:7: IDENTIFIER "a", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type EnumerationConstant struct { Token xc.Token }

EnumerationConstant represents data reduced by production:

EnumerationConstant: IDENTIFIER

Example Code: fmt.Println(exampleAST(7, "\U00100002 enum { a ,")) Output: &cc.EnumerationConstant{ · Token: example7.c:1:9: IDENTIFIER "a", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Enumerator struct { Value interface{} // Enumerator's value. Case int ConstantExpression *ConstantExpression EnumerationConstant *EnumerationConstant Token xc.Token }

Enumerator represents data reduced by productions:

Enumerator: EnumerationConstant | EnumerationConstant '=' ConstantExpression // Case 1

Example Code: fmt.Println(exampleAST(142, "\U00100002 enum { a ,")) Output: &cc.Enumerator{ · EnumerationConstant: &cc.EnumerationConstant{ · · Token: example142.c:1:9: IDENTIFIER "a", · }, } Example (Case1) Code: fmt.Println(exampleAST(143, "\U00100002 enum { a = 'b' ,")) Output: &cc.Enumerator{ · Value: 98, · Case: 1, · ConstantExpression: &cc.ConstantExpression{ · · Type: int, · · Value: 98, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 98, · · · Case: 1, · · · Token: example143.c:1:13: CHARCONST "'b'", · · }, · }, · EnumerationConstant: &cc.EnumerationConstant{ · · Token: example143.c:1:9: IDENTIFIER "a", · }, · Token: example143.c:1:11: '=', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type EnumeratorList struct { Case int Enumerator *Enumerator EnumeratorList *EnumeratorList Token xc.Token }

EnumeratorList represents data reduced by productions:

EnumeratorList: Enumerator | EnumeratorList ',' Enumerator // Case 1

Example Code: fmt.Println(exampleAST(140, "\U00100002 enum { a ,")) Output: &cc.EnumeratorList{ · Enumerator: &cc.Enumerator{ · · EnumerationConstant: &cc.EnumerationConstant{ · · · Token: example140.c:1:9: IDENTIFIER "a", · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(141, "\U00100002 enum { a , b ,")) Output: &cc.EnumeratorList{ · Enumerator: &cc.Enumerator{ · · EnumerationConstant: &cc.EnumerationConstant{ · · · Token: example141.c:1:9: IDENTIFIER "a", · · }, · }, · EnumeratorList: &cc.EnumeratorList{ · · Case: 1, · · Enumerator: &cc.Enumerator{ · · · Value: 1, · · · EnumerationConstant: &cc.EnumerationConstant{ · · · · Token: example141.c:1:13: IDENTIFIER "b", · · · }, · · }, · · Token: example141.c:1:11: ',', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Expression struct { BinOpType Type // The type operands of binary expression are coerced into, if different from Type. Type Type // Type of expression. Value interface{} // Non nil for certain constant expressions. ArgumentExpressionListOpt *ArgumentExpressionListOpt Case int CommaOpt *CommaOpt CompoundStatement *CompoundStatement Expression *Expression Expression2 *Expression ExpressionList *ExpressionList InitializerList *InitializerList Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token TypeName *TypeName // contains filtered or unexported fields }

Expression represents data reduced by productions:

Expression: IDENTIFIER | CHARCONST // Case 1 | FLOATCONST // Case 2 | INTCONST // Case 3 | LONGCHARCONST // Case 4 | LONGSTRINGLITERAL // Case 5 | STRINGLITERAL // Case 6 | '(' ExpressionList ')' // Case 7 | Expression '[' ExpressionList ']' // Case 8 | Expression '(' ArgumentExpressionListOpt ')' // Case 9 | Expression '.' IDENTIFIER // Case 10 | Expression "->" IDENTIFIER // Case 11 | Expression "++" // Case 12 | Expression "--" // Case 13 | '(' TypeName ')' '{' InitializerList CommaOpt '}' // Case 14 | "++" Expression // Case 15 | "--" Expression // Case 16 | '&' Expression // Case 17 | '*' Expression // Case 18 | '+' Expression // Case 19 | '-' Expression // Case 20 | '~' Expression // Case 21 | '!' Expression // Case 22 | "sizeof" Expression // Case 23 | "sizeof" '(' TypeName ')' // Case 24 | '(' TypeName ')' Expression // Case 25 | Expression '*' Expression // Case 26 | Expression '/' Expression // Case 27 | Expression '%' Expression // Case 28 | Expression '+' Expression // Case 29 | Expression '-' Expression // Case 30 | Expression "<<" Expression // Case 31 | Expression ">>" Expression // Case 32 | Expression '<' Expression // Case 33 | Expression '>' Expression // Case 34 | Expression "<=" Expression // Case 35 | Expression ">=" Expression // Case 36 | Expression "==" Expression // Case 37 | Expression "!=" Expression // Case 38 | Expression '&' Expression // Case 39 | Expression '^' Expression // Case 40 | Expression '|' Expression // Case 41 | Expression "&&" Expression // Case 42 | Expression "||" Expression // Case 43 | Expression '?' ExpressionList ':' Expression // Case 44 | Expression '=' Expression // Case 45 | Expression "*=" Expression // Case 46 | Expression "/=" Expression // Case 47 | Expression "%=" Expression // Case 48 | Expression "+=" Expression // Case 49 | Expression "-=" Expression // Case 50 | Expression "<<=" Expression // Case 51 | Expression ">>=" Expression // Case 52 | Expression "&=" Expression // Case 53 | Expression "^=" Expression // Case 54 | Expression "|=" Expression // Case 55 | "_Alignof" '(' TypeName ')' // Case 56 | '(' CompoundStatement ')' // Case 57 | "&&" IDENTIFIER // Case 58 | Expression '?' ':' Expression // Case 59

IdentResolutionScope returns the scope an identifier is resolved in. If n is not an identifier (n.Case == 0), IdentResolutionScope returns nil.

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ExpressionList struct { Type Type // Type of expression. Value interface{} // Non nil for certain constant expressions. Case int Expression *Expression ExpressionList *ExpressionList Token xc.Token }

ExpressionList represents data reduced by productions:

ExpressionList: Expression | ExpressionList ',' Expression // Case 1

Example Code: fmt.Println(exampleAST(74, "\U00100001 ( 'a' )")) Output: &cc.ExpressionList{ · Expression: &cc.Expression{ · · Case: 1, · · Token: example74.c:1:4: CHARCONST "'a'", · }, } Example (Case1) Code: fmt.Println(exampleAST(75, "\U00100001 ( 'a' , 'b' )")) Output: &cc.ExpressionList{ · Expression: &cc.Expression{ · · Case: 1, · · Token: example75.c:1:4: CHARCONST "'a'", · }, · ExpressionList: &cc.ExpressionList{ · · Case: 1, · · Expression: &cc.Expression{ · · · Case: 1, · · · Token: example75.c:1:10: CHARCONST "'b'", · · }, · · Token: example75.c:1:8: ',', · }, }

Len returns the number of items in n.

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ExpressionListOpt struct { ExpressionList *ExpressionList }

ExpressionListOpt represents data reduced by productions:

ExpressionListOpt: /* empty */ | ExpressionList // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ExpressionOpt struct { Expression *Expression }

ExpressionOpt represents data reduced by productions:

ExpressionOpt: /* empty */ | Expression // Case 1

Example Code: fmt.Println(exampleAST(72, "\U00100001 ( _Bool [ ]") == (*ExpressionOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(73, "\U00100002 a [ 'b' ]")) Output: &cc.ExpressionOpt{ · Expression: &cc.Expression{ · · Type: int, · · Value: 98, · · Case: 1, · · Token: example73.c:1:6: CHARCONST "'b'", · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ExpressionStatement struct { ExpressionListOpt *ExpressionListOpt Token xc.Token }

ExpressionStatement represents data reduced by production:

ExpressionStatement: ExpressionListOpt ';'

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ExternalDeclaration struct { BasicAssemblerStatement *BasicAssemblerStatement Case int Declaration *Declaration FunctionDefinition *FunctionDefinition Token xc.Token }

ExternalDeclaration represents data reduced by productions:

ExternalDeclaration: FunctionDefinition | Declaration // Case 1 | BasicAssemblerStatement ';' // Case 2 | ';' // Case 3

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type FunctionBody struct { AssemblerStatement *AssemblerStatement Case int CompoundStatement *CompoundStatement Token xc.Token // contains filtered or unexported fields }

FunctionBody represents data reduced by productions:

FunctionBody: CompoundStatement | AssemblerStatement ';' // Case 1

Example Code: fmt.Println(exampleAST(257, "\U00100002 a { }")) Output: &cc.FunctionBody{ · CompoundStatement: &cc.CompoundStatement{ · · Token: example257.c:1:4: '{', · · Token2: example257.c:1:6: '}', · }, } Example (Case1) Code: fmt.Println(exampleAST(259, "\U00100002 a asm ( \"b\" ) ;")) Output: &cc.FunctionBody{ · AssemblerStatement: &cc.AssemblerStatement{ · · BasicAssemblerStatement: &cc.BasicAssemblerStatement{ · · · AssemblerInstructions: &cc.AssemblerInstructions{ · · · · Token: example259.c:1:10: STRINGLITERAL "\"b\"", · · · }, · · · Token: example259.c:1:4: ASM "asm", · · · Token2: example259.c:1:8: '(', · · · Token3: example259.c:1:14: ')', · · }, · }, · Case: 1, · Token: example259.c:1:16: ';', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type FunctionDefinition struct { Case int DeclarationListOpt *DeclarationListOpt DeclarationSpecifiers *DeclarationSpecifiers Declarator *Declarator FunctionBody *FunctionBody }

FunctionDefinition represents data reduced by productions:

FunctionDefinition: DeclarationSpecifiers Declarator DeclarationListOpt FunctionBody | Declarator DeclarationListOpt FunctionBody // Case 1

Example Code: fmt.Println(exampleAST(252, "\U00100002 auto a { }")) Output: &cc.FunctionDefinition{ · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · Case: 3, · · · Token: example252.c:1:2: AUTO "auto", · · }, · }, · Declarator: &cc.Declarator{ · · Linkage: None, · · Type: auto int, · · DirectDeclarator: &cc.DirectDeclarator{ · · · Token: example252.c:1:7: IDENTIFIER "a", · · }, · }, · FunctionBody: &cc.FunctionBody{ · · CompoundStatement: &cc.CompoundStatement{ · · · Token: example252.c:1:9: '{', · · · Token2: example252.c:1:11: '}', · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(255, "\U00100002 a { }")) Output: &cc.FunctionDefinition{ · Case: 1, · Declarator: &cc.Declarator{ · · Linkage: External, · · Type: int, · · DirectDeclarator: &cc.DirectDeclarator{ · · · Token: example255.c:1:2: IDENTIFIER "a", · · }, · }, · FunctionBody: &cc.FunctionBody{ · · CompoundStatement: &cc.CompoundStatement{ · · · Token: example255.c:1:4: '{', · · · Token2: example255.c:1:6: '}', · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type FunctionSpecifier struct { Case int Token xc.Token // contains filtered or unexported fields }

FunctionSpecifier represents data reduced by productions:

FunctionSpecifier: "inline" | "_Noreturn" // Case 1

Example Code: fmt.Println(exampleAST(147, "\U00100002 inline (")) Output: &cc.FunctionSpecifier{ · Token: example147.c:1:2: INLINE "inline", } Example (Case1) Code: fmt.Println(exampleAST(148, "\U00100002 _Noreturn (")) Output: &cc.FunctionSpecifier{ · Case: 1, · Token: example148.c:1:2: NORETURN "_Noreturn", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type GroupList struct { Case int GroupList *GroupList GroupPart Node }

GroupList represents data reduced by productions:

GroupList: GroupPart | GroupList GroupPart // Case 1

Example Code: fmt.Println(exampleAST(286, "\U00100000 ")) Output: &cc.GroupList{ } Example (Case1) Code: fmt.Println(exampleAST(287, "\U00100000int

f() {}")) Output: &cc.GroupList{ · GroupList: &cc.GroupList{ · · Case: 1, · · GroupPart: []xc.Token{ // len 6 · · · 0: example287.c:2:1: IDENTIFIER "f", · · · 1: example287.c:2:2: '(', · · · 2: example287.c:2:3: ')', · · · 3: example287.c:2:4: ' ', · · · 4: example287.c:2:5: '{', · · · 5: example287.c:2:6: '}', · · }, · }, · GroupPart: []xc.Token{ // len 2 · · 0: example287.c:1:1: IDENTIFIER "int", · · 1: example287.c:1:4: ' ', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type GroupListOpt struct { GroupList *GroupList }

GroupListOpt represents data reduced by productions:

GroupListOpt: /* empty */ | GroupList // Case 1

Example Code: fmt.Println(exampleAST(288, "\U00100000

#ifndef a

#elif") == (*GroupListOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(289, "\U00100000

#ifndef a

b

#elif")) Output: &cc.GroupListOpt{ · GroupList: &cc.GroupList{ · · GroupPart: []xc.Token{ // len 2 · · · 0: example289.c:3:1: IDENTIFIER "b", · · · 1: example289.c:3:2: ' ', · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type IdentifierList struct { Case int IdentifierList *IdentifierList Token xc.Token Token2 xc.Token }

IdentifierList represents data reduced by productions:

IdentifierList: IDENTIFIER | IdentifierList ',' IDENTIFIER // Case 1

Example Code: fmt.Println(exampleAST(177, "\U00100002 a ( b )")) Output: &cc.IdentifierList{ · Token: example177.c:1:6: IDENTIFIER "b", } Example (Case1) Code: fmt.Println(exampleAST(178, "\U00100002 a ( b , c )")) Output: &cc.IdentifierList{ · IdentifierList: &cc.IdentifierList{ · · Case: 1, · · Token: example178.c:1:8: ',', · · Token2: example178.c:1:10: IDENTIFIER "c", · }, · Token: example178.c:1:6: IDENTIFIER "b", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type IdentifierListOpt struct { IdentifierList *IdentifierList // contains filtered or unexported fields }

IdentifierListOpt represents data reduced by productions:

IdentifierListOpt: /* empty */ | IdentifierList // Case 1

Example Code: fmt.Println(exampleAST(179, "\U00100002 a ( )") == (*IdentifierListOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(180, "\U00100002 a ( b )")) Output: &cc.IdentifierListOpt{ · IdentifierList: &cc.IdentifierList{ · · Token: example180.c:1:6: IDENTIFIER "b", · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type IdentifierOpt struct { Token xc.Token }

IdentifierOpt represents data reduced by productions:

IdentifierOpt: /* empty */ | IDENTIFIER // Case 1

Example Code: fmt.Println(exampleAST(181, "\U00100002 struct {") == (*IdentifierOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(182, "\U00100002 enum a {")) Output: &cc.IdentifierOpt{ · Token: example182.c:1:7: IDENTIFIER "a", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type IfGroup struct { Case int GroupListOpt *GroupListOpt PPTokenList PPTokenList Token xc.Token Token2 xc.Token Token3 xc.Token }

IfGroup represents data reduced by productions:

IfGroup: PPIF PPTokenList '

' GroupListOpt | PPIFDEF IDENTIFIER '

' GroupListOpt // Case 1 | PPIFNDEF IDENTIFIER '

' GroupListOpt // Case 2

Example Code: fmt.Println(exampleAST(295, "\U00100000

#if other_a

#elif")) Output: &cc.IfGroup{ · PPTokenList: []xc.Token{ // len 4 · · 0: example295.c:2:4: ' ', · · 1: example295.c:2:5: IDENTIFIER "other_a", · · 2: example295.c:2:12: ' ', · · 3: example295.c:2:14: ' ', · }, · Token: example295.c:2:2: PPIF, · Token2: example295.c:2:14: '

', } Example (Case1) Code: fmt.Println(exampleAST(296, "\U00100000

#ifdef a

#elif")) Output: &cc.IfGroup{ · Case: 1, · Token: example296.c:2:2: PPIFDEF, · Token2: example296.c:2:8: IDENTIFIER "a", · Token3: example296.c:2:11: '

', } Example (Case2) Code: fmt.Println(exampleAST(297, "\U00100000

#ifndef a

#elif")) Output: &cc.IfGroup{ · Case: 2, · Token: example297.c:2:2: PPIFNDEF, · Token2: example297.c:2:9: IDENTIFIER "a", · Token3: example297.c:2:12: '

', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type IfSection struct { ElifGroupListOpt *ElifGroupListOpt ElseGroupOpt *ElseGroupOpt EndifLine *EndifLine IfGroup *IfGroup }

IfSection represents data reduced by production:

IfSection: IfGroup ElifGroupListOpt ElseGroupOpt EndifLine

Example Code: fmt.Println(exampleAST(294, "\U00100000

#if other_a

#endif")) Output: &cc.IfSection{ · EndifLine: &cc.EndifLine{ · · Token: example294.c:3:2: PPENDIF, · }, · IfGroup: &cc.IfGroup{ · · PPTokenList: []xc.Token{ // len 4 · · · 0: example294.c:2:4: ' ', · · · 1: example294.c:2:5: IDENTIFIER "other_a", · · · 2: example294.c:2:12: ' ', · · · 3: example294.c:2:14: ' ', · · }, · · Token: example294.c:2:2: PPIF, · · Token2: example294.c:2:14: '

', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type InitDeclarator struct { Case int Declarator *Declarator Initializer *Initializer Token xc.Token }

InitDeclarator represents data reduced by productions:

InitDeclarator: Declarator | Declarator '=' Initializer // Case 1

Example Code: fmt.Println(exampleAST(92, "\U00100002 a auto b ,")) Output: &cc.InitDeclarator{ · Declarator: &cc.Declarator{ · · Linkage: None, · · Type: auto undefined, · · DirectDeclarator: &cc.DirectDeclarator{ · · · Token: example92.c:1:9: IDENTIFIER "b", · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(94, "\U00100002 auto a = 'b' ,")) Output: &cc.InitDeclarator{ · Case: 1, · Declarator: &cc.Declarator{ · · Linkage: None, · · Type: auto undefined, · · DirectDeclarator: &cc.DirectDeclarator{ · · · Token: example94.c:1:7: IDENTIFIER "a", · · }, · }, · Initializer: &cc.Initializer{ · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 98, · · · Case: 1, · · · Token: example94.c:1:11: CHARCONST "'b'", · · }, · }, · Token: example94.c:1:9: '=', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type InitDeclaratorList struct { Case int InitDeclarator *InitDeclarator InitDeclaratorList *InitDeclaratorList Token xc.Token }

InitDeclaratorList represents data reduced by productions:

InitDeclaratorList: InitDeclarator | InitDeclaratorList ',' InitDeclarator // Case 1

Example Code: fmt.Println(exampleAST(88, "\U00100002 auto a ,")) Output: &cc.InitDeclaratorList{ · InitDeclarator: &cc.InitDeclarator{ · · Declarator: &cc.Declarator{ · · · Linkage: None, · · · Type: auto undefined, · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · Token: example88.c:1:7: IDENTIFIER "a", · · · }, · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(89, "\U00100002 auto a , b ,")) Output: &cc.InitDeclaratorList{ · InitDeclarator: &cc.InitDeclarator{ · · Declarator: &cc.Declarator{ · · · Linkage: None, · · · Type: auto undefined, · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · Token: example89.c:1:7: IDENTIFIER "a", · · · }, · · }, · }, · InitDeclaratorList: &cc.InitDeclaratorList{ · · Case: 1, · · InitDeclarator: &cc.InitDeclarator{ · · · Declarator: &cc.Declarator{ · · · · Linkage: None, · · · · Type: auto undefined, · · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · · Token: example89.c:1:11: IDENTIFIER "b", · · · · }, · · · }, · · }, · · Token: example89.c:1:9: ',', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type InitDeclaratorListOpt struct { InitDeclaratorList *InitDeclaratorList }

InitDeclaratorListOpt represents data reduced by productions:

InitDeclaratorListOpt: /* empty */ | InitDeclaratorList // Case 1

Example Code: fmt.Println(exampleAST(90, "\U00100002 auto ;") == (*InitDeclaratorListOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(91, "\U00100002 auto a ;")) Output: &cc.InitDeclaratorListOpt{ · InitDeclaratorList: &cc.InitDeclaratorList{ · · InitDeclarator: &cc.InitDeclarator{ · · · Declarator: &cc.Declarator{ · · · · Linkage: None, · · · · Type: auto undefined, · · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · · Token: example91.c:1:7: IDENTIFIER "a", · · · · }, · · · }, · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Initializer struct { Case int CommaOpt *CommaOpt Expression *Expression Initializer *Initializer InitializerList *InitializerList Token xc.Token Token2 xc.Token }

Initializer represents data reduced by productions:

Initializer: Expression | '{' InitializerList CommaOpt '}' // Case 1 | IDENTIFIER ':' Initializer // Case 2

Example Code: fmt.Println(exampleAST(201, "\U00100002 auto a = 'b' ,")) Output: &cc.Initializer{ · Expression: &cc.Expression{ · · Type: int, · · Value: 98, · · Case: 1, · · Token: example201.c:1:11: CHARCONST "'b'", · }, } Example (Case1) Code: fmt.Println(exampleAST(202, "\U00100002 auto a = { } ,")) Output: &cc.Initializer{ · Case: 1, · Token: example202.c:1:11: '{', · Token2: example202.c:1:13: '}', } Example (Case2) Code: fmt.Println(exampleAST(203, "\U00100002 auto a = b : 'c' ,")) Output: &cc.Initializer{ · Case: 2, · Initializer: &cc.Initializer{ · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 99, · · · Case: 1, · · · Token: example203.c:1:15: CHARCONST "'c'", · · }, · }, · Token: example203.c:1:11: IDENTIFIER "b", · Token2: example203.c:1:13: ':', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type InitializerList struct { Case int DesignationOpt *DesignationOpt Initializer *Initializer InitializerList *InitializerList Token xc.Token }

InitializerList represents data reduced by productions:

InitializerList: DesignationOpt Initializer | InitializerList ',' DesignationOpt Initializer // Case 1 | /* empty */ // Case 2

Example Code: fmt.Println(exampleAST(204, "\U00100002 auto a = { 'b' ,")) Output: &cc.InitializerList{ · Initializer: &cc.Initializer{ · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 98, · · · Case: 1, · · · Token: example204.c:1:13: CHARCONST "'b'", · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(205, "\U00100002 auto a = { , 'b' ,")) Output: &cc.InitializerList{ · Case: 1, · Initializer: &cc.Initializer{ · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 98, · · · Case: 1, · · · Token: example205.c:1:15: CHARCONST "'b'", · · }, · }, · Token: example205.c:1:13: ',', } Example (Case2) Code: fmt.Println(exampleAST(206, "\U00100002 auto a = { ,") == (*InitializerList)(nil)) Output: true

Len returns the number of items in n.

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type IterationStatement struct { Case int Declaration *Declaration ExpressionList *ExpressionList ExpressionListOpt *ExpressionListOpt ExpressionListOpt2 *ExpressionListOpt ExpressionListOpt3 *ExpressionListOpt Statement *Statement Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token }

IterationStatement represents data reduced by productions:

IterationStatement: "while" '(' ExpressionList ')' Statement | "do" Statement "while" '(' ExpressionList ')' ';' // Case 1 | "for" '(' ExpressionListOpt ';' ExpressionListOpt ';' ExpressionListOpt ')' Statement // Case 2 | "for" '(' Declaration ExpressionListOpt ';' ExpressionListOpt ')' Statement // Case 3

Example Code: fmt.Println(exampleAST(236, "\U00100001 ( { while ( 'a' ) ; !")) Output: &cc.IterationStatement{ · ExpressionList: &cc.ExpressionList{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example236.c:1:14: CHARCONST "'a'", · · }, · }, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example236.c:1:20: ';', · · }, · }, · Token: example236.c:1:6: WHILE "while", · Token2: example236.c:1:12: '(', · Token3: example236.c:1:18: ')', } Example (Case1) Code: fmt.Println(exampleAST(237, "\U00100001 ( { do ; while ( 'a' ) ; !")) Output: &cc.IterationStatement{ · Case: 1, · ExpressionList: &cc.ExpressionList{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example237.c:1:19: CHARCONST "'a'", · · }, · }, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example237.c:1:9: ';', · · }, · }, · Token: example237.c:1:6: DO "do", · Token2: example237.c:1:11: WHILE "while", · Token3: example237.c:1:17: '(', · Token4: example237.c:1:23: ')', · Token5: example237.c:1:25: ';', } Example (Case2) Code: fmt.Println(exampleAST(238, "\U00100001 ( { for ( ; ; ) ; !")) Output: &cc.IterationStatement{ · Case: 2, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example238.c:1:18: ';', · · }, · }, · Token: example238.c:1:6: FOR "for", · Token2: example238.c:1:10: '(', · Token3: example238.c:1:12: ';', · Token4: example238.c:1:14: ';', · Token5: example238.c:1:16: ')', } Example (Case3) Code: fmt.Println(exampleAST(239, "\U00100001 ( { for ( auto ; ; ) ; !")) Output: &cc.IterationStatement{ · Case: 3, · Declaration: &cc.Declaration{ · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · Case: 3, · · · · Token: example239.c:1:12: AUTO "auto", · · · }, · · }, · · Token: example239.c:1:17: ';', · }, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example239.c:1:23: ';', · · }, · }, · Token: example239.c:1:6: FOR "for", · Token2: example239.c:1:10: '(', · Token3: example239.c:1:19: ';', · Token4: example239.c:1:21: ')', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type JumpStatement struct { Case int Expression *Expression ExpressionListOpt *ExpressionListOpt Token xc.Token Token2 xc.Token Token3 xc.Token }

JumpStatement represents data reduced by productions:

JumpStatement: "goto" IDENTIFIER ';' | "continue" ';' // Case 1 | "break" ';' // Case 2 | "return" ExpressionListOpt ';' // Case 3 | "goto" Expression ';' // Case 4

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Kind int

Kind is a type category. Kind formally implements Type the only method returning a non nil value is Kind.

❖ const ( Undefined Kind = iota Void Ptr UintPtr // Type used for pointer arithmetic. Char SChar UChar Short UShort Int UInt Long ULong LongLong ULongLong Float Double LongDouble Bool FloatComplex DoubleComplex LongDoubleComplex Struct Union Enum TypedefName Function Array )

Values of type Kind.

❖ type LabeledStatement struct { Case int ConstantExpression *ConstantExpression Statement *Statement Token xc.Token Token2 xc.Token }

LabeledStatement represents data reduced by productions:

LabeledStatement: IDENTIFIER ':' Statement | "case" ConstantExpression ':' Statement // Case 1 | "default" ':' Statement // Case 2

Example Code: fmt.Println(exampleAST(221, "\U00100001 ( { a : ; !")) Output: &cc.LabeledStatement{ · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example221.c:1:10: ';', · · }, · }, · Token: example221.c:1:6: IDENTIFIER "a", · Token2: example221.c:1:8: ':', } Example (Case1) Code: fmt.Println(exampleAST(222, "\U00100001 ( { case 'a' : ; !")) Output: &cc.LabeledStatement{ · Case: 1, · ConstantExpression: &cc.ConstantExpression{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example222.c:1:11: CHARCONST "'a'", · · }, · }, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example222.c:1:17: ';', · · }, · }, · Token: example222.c:1:6: CASE "case", · Token2: example222.c:1:15: ':', } Example (Case2) Code: fmt.Println(exampleAST(223, "\U00100001 ( { default : ; !")) Output: &cc.LabeledStatement{ · Case: 2, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example223.c:1:16: ';', · · }, · }, · Token: example223.c:1:6: DEFAULT "default", · Token2: example223.c:1:14: ':', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Linkage int

Linkage is a C linkage kind ([0], 6.2.2, p. 30)

❖ const ( None Linkage = iota Internal External )

Values of type Linkage.

❖ type LongStringLitID int

LongStringLitID is the type of an Expression.Value representing the numeric ID of a long string literal.

❖ type Macro struct { Args []int // Numeric IDs of argument identifiers. DefTok xc.Token // Macro name definition token. IsFnLike bool // Whether the macro is function like. Type Type // Non nil if macro expands to a constant expression. Value interface{} // Non nil if macro expands to a constant expression. // contains filtered or unexported fields }

Macro represents a C preprocessor macro.

ReplacementToks returns the tokens that replace m.

❖ type Member struct { BitFieldType Type BitFieldGroup int // Ordinal number of the packed bits field. BitOffsetOf int // Bit field starting bit. Bits int // Size in bits for bit fields, 0 otherwise. Declarator *Declarator // Possibly nil for bit fields. Name int OffsetOf int Padding int // Number of unused bytes added to the end of the field to force proper alignment requirements. Type Type }

Member describes a member of a struct or union.

BitFieldGroup represents the ordinal number of the packed bit fields:

struct foo { int i; int j:1; // BitFieldGroup: 0 int k:2; // BitFieldGroup: 0 double l; int m:1; // BitFieldGroup: 1 int n:2; // BitFieldGroup: 1 }

❖ type Model struct { Items map[Kind]ModelItem BoolType Type CharType Type DoubleComplexType Type DoubleType Type FloatComplexType Type FloatType Type IntType Type LongDoubleComplexType Type LongDoubleType Type LongLongType Type LongType Type ShortType Type UCharType Type UIntType Type ULongLongType Type ULongType Type UShortType Type UintPtrType Type VoidType Type Signed [kindMax]bool // Signed[Kind] reports whether Kind is a signed integer type. // contains filtered or unexported fields }

Model describes size and align requirements of predeclared types.

❖ func (m *Model) BinOpType(a, b Type) Type

BinOpType returns the evaluation type of a binop b, ie. the type operands are converted to before performing the operation. Operands must be arithmetic types.

See [0], 6.3.1.8 - Usual arithmetic conversions.

❖ func (m *Model) MustConvert(v interface{}, typ Type) interface{}

MustConvert returns v converted to the type of typ. If the conversion is impossible, the method panics.

Conversion an integer type to any pointer type yields an uintptr.

❖ type ModelItem struct { Size int // Size of the entity in bytes. Align int // Alignment of the entity when it's not a struct field. StructAlign int // Alignment of the entity when it's a struct field. More interface{} // Optional user data. }

ModelItem is a single item of a model.

Note about StructAlign: To provide GCC ABI compatibility set, for example, Align of Double to 8 and StructAlign of Double to 4.

❖ type Namespace int

Namespace is a binding category.

❖ const ( NSIdentifiers Namespace = iota )

Values of type Namespace.

❖ type Node interface { Pos () token.Pos }

Node represents an AST node.

❖ type Opt func(*lexer)

Opt is a configuration/setup function that can be passed to the Parser function.

AllowCompatibleTypedefRedefinitions makes the parser accept compatible typedef redefinitions.

typedef int foo; typedef int foo; // ok with this option. typedef long int foo; // never ok.

Cpp registers a preprocessor hook function which is called for every line, or group of lines the preprocessor produces before it is consumed by the parser. The token slice must not be modified by the hook.

CrashOnError is an debugging option.

EnableAlignOf enables recognizing the reserved word _Alignof.

EnableAlternateKeywords makes the parser accept, for example, non standard

__asm__

as an equvalent of keyowrd asm (which first hast be permitted by EnableAsm).

EnableAnonymousStructFields makes the parser accept non standard

struct { int i; struct { int j; }; int k; };

EnableAsm enables recognizing the reserved word asm.

EnableBuiltinClassifyType makes the parser handle specially

__builtin_constant_p(expr)

See https://gcc.gnu.org/onlinedocs/gccint/Varargs.html

EnableBuiltinConstantP makes the parser handle specially

__builtin_constant_p(expr)

See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

EnableComputedGotos makes the parser accept non standard

variable = &&label; goto *variable;

See https://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Labels-as-Values.html

EnableDefineOmitCommaBeforeDDD makes the parser accept non standard

#define foo(a, b...) // Note the missing comma after identifier list.

EnableDlrInIdentifiers makes the parser accept non standard

int foo$bar

EnableEmptyDeclarations makes the parser accept non standard

; // C++11 empty declaration

EnableEmptyDefine makes the parser accept non standard

#define

EnableEmptyStructs makes the parser accept non standard

struct foo {};

EnableImaginarySuffix makes the parser accept non standard

4.2i, 5.6j etc

See https://gcc.gnu.org/onlinedocs/gcc/Complex.html

EnableImplicitFuncDef makes the parser accept non standard

int f() { return g(); // g is undefined, but assumed to be returning int. }

EnableImplicitIntType makes the parser accept non standard omitting type specifier. For example

static i;

becomes the same as

static int i;

EnableIncludeNext makes the parser accept non standard

#include_next "foo.h"

EnableLegacyDesignators makes the parser accept legacy designators

{ a: 42 } // Obsolete since GCC 2.5, standard is { .a=42 }

See https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

EnableNonConstStaticInitExpressions makes the parser accept non standard

static int i = f();

[0], 6.7.8/4: All the expressions in an initializer for an object that has static storage duration shall be constant expressions or string literals.

EnableNoreturn enables recognizing the reserved word _Noreturn.

EnableOmitConditionalOperand makes the parser accept non standard

x ? : y

See https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Conditionals.html#Conditionals

EnableOmitFuncArgTypes makes the parser accept non standard

f(a) // Same as int f(int a).

EnableOmitFuncRetType makes the parser accept non standard

f() // Same as int f().

EnableParenthesizedCompoundStatemen makes the parser accept non standard

({ ... })

as an expression. See [3].

EnableStaticAssert enables recognizing the reserved word _Static_assert.

EnableTypeOf enables recognizing the reserved word typeof.

EnableUndefExtraTokens makes the parser accept non standard

#undef foo(bar)

EnableUnsignedEnums makes the parser handle choose unsigned int as the type of an enumeration with no negative members.

EnableWideBitFieldTypes makes the parser accept non standard bitfield types (i.e, long long and unsigned long long).

unsigned long long bits : 2;

EnableWideEnumValues makes the parser accept non standard

enum { v = X }; for X wider than 32 bits.

ErrLimit limits the number of calls to the error reporting methods. After the limit is reached, all errors are reported using log.Print and then log.Fatal() is called with a message about too many errors. To disable error limit, set ErrLimit to value less or equal zero. Default value is 10.

IncludePaths option configures where to search for include files (eg. "name.h"). Multiple IncludePaths options may be used, the resulting search path list is produced by appending the option arguments in order of appearance.

KeepComments makes the parser keep comments.

Mode99c turns on support for the 99c compiler.

SysIncludePaths option configures where to search for system include files (eg. <name.h>). Multiple SysIncludePaths options may be used, the resulting search path list is produced by appending the option arguments in order of appearance.

Trigraphs enables processing of trigraphs.

YyDebug sets the parser debug level.

❖ type PPTokenList int

PPTokenList represents a sequence of tokens.

❖ type Parameter struct { Declarator *Declarator Name int Type Type }

Parameter describes a function argument.

❖ type ParameterDeclaration struct { AbstractDeclaratorOpt *AbstractDeclaratorOpt Case int DeclarationSpecifiers *DeclarationSpecifiers Declarator *Declarator // contains filtered or unexported fields }

ParameterDeclaration represents data reduced by productions:

ParameterDeclaration: DeclarationSpecifiers Declarator | DeclarationSpecifiers AbstractDeclaratorOpt // Case 1

Example Code: fmt.Println(exampleAST(175, "\U00100002 a ( auto b )")) Output: &cc.ParameterDeclaration{ · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · Case: 3, · · · Token: example175.c:1:6: AUTO "auto", · · }, · }, · Declarator: &cc.Declarator{ · · Linkage: None, · · Type: auto undefined, · · DirectDeclarator: &cc.DirectDeclarator{ · · · Token: example175.c:1:11: IDENTIFIER "b", · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(176, "\U00100002 a ( auto )")) Output: &cc.ParameterDeclaration{ · Case: 1, · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · Case: 3, · · · Token: example176.c:1:6: AUTO "auto", · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ParameterList struct { Case int ParameterDeclaration *ParameterDeclaration ParameterList *ParameterList Token xc.Token }

ParameterList represents data reduced by productions:

ParameterList: ParameterDeclaration | ParameterList ',' ParameterDeclaration // Case 1

Example Code: fmt.Println(exampleAST(173, "\U00100002 a ( auto )")) Output: &cc.ParameterList{ · ParameterDeclaration: &cc.ParameterDeclaration{ · · Case: 1, · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · Case: 3, · · · · Token: example173.c:1:6: AUTO "auto", · · · }, · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(174, "\U00100002 a ( auto , auto )")) Output: &cc.ParameterList{ · ParameterDeclaration: &cc.ParameterDeclaration{ · · Case: 1, · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · Case: 3, · · · · Token: example174.c:1:6: AUTO "auto", · · · }, · · }, · }, · ParameterList: &cc.ParameterList{ · · Case: 1, · · ParameterDeclaration: &cc.ParameterDeclaration{ · · · Case: 1, · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · · Case: 3, · · · · · Token: example174.c:1:13: AUTO "auto", · · · · }, · · · }, · · }, · · Token: example174.c:1:11: ',', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ParameterTypeList struct { Case int ParameterList *ParameterList Token xc.Token Token2 xc.Token // contains filtered or unexported fields }

ParameterTypeList represents data reduced by productions:

ParameterTypeList: ParameterList | ParameterList ',' "..." // Case 1

Example Code: fmt.Println(exampleAST(169, "\U00100002 a ( auto )")) Output: &cc.ParameterTypeList{ · ParameterList: &cc.ParameterList{ · · ParameterDeclaration: &cc.ParameterDeclaration{ · · · Case: 1, · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · · Case: 3, · · · · · Token: example169.c:1:6: AUTO "auto", · · · · }, · · · }, · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(170, "\U00100002 a ( auto , ... )")) Output: &cc.ParameterTypeList{ · Case: 1, · ParameterList: &cc.ParameterList{ · · ParameterDeclaration: &cc.ParameterDeclaration{ · · · Case: 1, · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · · Case: 3, · · · · · Token: example170.c:1:6: AUTO "auto", · · · · }, · · · }, · · }, · }, · Token: example170.c:1:11: ',', · Token2: example170.c:1:13: DDD, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type ParameterTypeListOpt struct { ParameterTypeList *ParameterTypeList }

ParameterTypeListOpt represents data reduced by productions:

ParameterTypeListOpt: /* empty */ | ParameterTypeList // Case 1

Example Code: fmt.Println(exampleAST(171, "\U00100001 ( _Bool ( )") == (*ParameterTypeListOpt)(nil)) Output: true Example (Case1) Code: fmt.Println(exampleAST(172, "\U00100001 ( _Bool ( auto )")) Output: &cc.ParameterTypeListOpt{ · ParameterTypeList: &cc.ParameterTypeList{ · · ParameterList: &cc.ParameterList{ · · · ParameterDeclaration: &cc.ParameterDeclaration{ · · · · Case: 1, · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ · · · · · · Case: 3, · · · · · · Token: example172.c:1:12: AUTO "auto", · · · · · }, · · · · }, · · · }, · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Pointer struct { Case int Pointer *Pointer Token xc.Token TypeQualifierListOpt *TypeQualifierListOpt }

Pointer represents data reduced by productions:

Pointer: '*' TypeQualifierListOpt | '*' TypeQualifierListOpt Pointer // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type PointerOpt struct { Pointer *Pointer }

PointerOpt represents data reduced by productions:

PointerOpt: /* empty */ | Pointer // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type PreprocessingFile struct { GroupList *GroupList // contains filtered or unexported fields }

PreprocessingFile represents data reduced by production:

PreprocessingFile: GroupList

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Scope int

Scope is a bindings category.

❖ const ( ScopeFile Scope = iota ScopeBlock ScopeMembers ScopeParams )

Values of type Scope

❖ type SelectionStatement struct { Case int ExpressionList *ExpressionList Statement *Statement Statement2 *Statement Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token }

SelectionStatement represents data reduced by productions:

SelectionStatement: "if" '(' ExpressionList ')' Statement | "if" '(' ExpressionList ')' Statement "else" Statement // Case 1 | "switch" '(' ExpressionList ')' Statement // Case 2

Example Code: fmt.Println(exampleAST(233, "\U00100001 ( { if ( 'a' ) ; !")) Output: &cc.SelectionStatement{ · ExpressionList: &cc.ExpressionList{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example233.c:1:11: CHARCONST "'a'", · · }, · }, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example233.c:1:17: ';', · · }, · }, · Token: example233.c:1:6: IF "if", · Token2: example233.c:1:9: '(', · Token3: example233.c:1:15: ')', } Example (Case1) Code: fmt.Println(exampleAST(234, "\U00100001 ( { if ( 'a' ) ; else ; !")) Output: &cc.SelectionStatement{ · Case: 1, · ExpressionList: &cc.ExpressionList{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example234.c:1:11: CHARCONST "'a'", · · }, · }, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example234.c:1:17: ';', · · }, · }, · Statement2: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example234.c:1:24: ';', · · }, · }, · Token: example234.c:1:6: IF "if", · Token2: example234.c:1:9: '(', · Token3: example234.c:1:15: ')', · Token4: example234.c:1:19: ELSE "else", } Example (Case2) Code: fmt.Println(exampleAST(235, "\U00100001 ( { switch ( 'a' ) ; !")) Output: &cc.SelectionStatement{ · Case: 2, · ExpressionList: &cc.ExpressionList{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example235.c:1:15: CHARCONST "'a'", · · }, · }, · Statement: &cc.Statement{ · · Case: 2, · · ExpressionStatement: &cc.ExpressionStatement{ · · · Token: example235.c:1:21: ';', · · }, · }, · Token: example235.c:1:6: SWITCH "switch", · Token2: example235.c:1:13: '(', · Token3: example235.c:1:19: ')', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Specifier interface { IsAuto () bool // StorageClassSpecifier "auto" present. IsConst () bool // TypeQualifier "const" present. IsExtern () bool // StorageClassSpecifier "extern" present. IsInline () bool // FunctionSpecifier "inline" present. IsRegister () bool // StorageClassSpecifier "register" present. IsRestrict () bool // TypeQualifier "restrict" present. IsStatic () bool // StorageClassSpecifier "static" present. IsTypedef () bool // StorageClassSpecifier "typedef" present. IsVolatile () bool // TypeQualifier "volatile" present. TypedefName () int // TypedefName returns the typedef name ID used, if any, zero otherwise. // contains filtered or unexported methods }

Specifier describes a combination of {Function,StorageClass,Type}Specifiers and TypeQualifiers.

❖ type SpecifierQualifierList struct { Case int SpecifierQualifierListOpt *SpecifierQualifierListOpt TypeQualifier *TypeQualifier TypeSpecifier *TypeSpecifier // contains filtered or unexported fields }

SpecifierQualifierList represents data reduced by productions:

SpecifierQualifierList: TypeSpecifier SpecifierQualifierListOpt | TypeQualifier SpecifierQualifierListOpt // Case 1

Example Code: fmt.Println(exampleAST(127, "\U00100001 ( _Bool (")) Output: &cc.SpecifierQualifierList{ · TypeSpecifier: &cc.TypeSpecifier{ · · Case: 9, · · Token: example127.c:1:4: BOOL "_Bool", · }, } Example (Case1) Code: fmt.Println(exampleAST(128, "\U00100001 ( const (")) Output: &cc.SpecifierQualifierList{ · Case: 1, · TypeQualifier: &cc.TypeQualifier{ · · Token: example128.c:1:4: CONST "const", · }, }

IsAuto implements specifier.

IsConst returns whether n includes the 'const' type qualifier.

IsExtern implements specifier.

IsInline implements specifier.

IsRegister implements specifier.

IsRestrict implements specifier.

IsStatic implements specifier.

IsTypedef implements specifier.

IsVolatile implements specifier.

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

TypedefName implements Specifier.

❖ type SpecifierQualifierListOpt struct { SpecifierQualifierList *SpecifierQualifierList // contains filtered or unexported fields }

SpecifierQualifierListOpt represents data reduced by productions:

SpecifierQualifierListOpt: /* empty */ | SpecifierQualifierList // Case 1

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type Statement struct { AssemblerStatement *AssemblerStatement Case int CompoundStatement *CompoundStatement ExpressionStatement *ExpressionStatement IterationStatement *IterationStatement JumpStatement *JumpStatement LabeledStatement *LabeledStatement SelectionStatement *SelectionStatement }

Statement represents data reduced by productions:

Statement: LabeledStatement | CompoundStatement // Case 1 | ExpressionStatement // Case 2 | SelectionStatement // Case 3 | IterationStatement // Case 4 | JumpStatement // Case 5 | AssemblerStatement // Case 6

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StaticAssertDeclaration struct { ConstantExpression *ConstantExpression Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token Token6 xc.Token }

StaticAssertDeclaration represents data reduced by production:

StaticAssertDeclaration: "_Static_assert" '(' ConstantExpression ',' STRINGLITERAL ')' ';'

Example Code: fmt.Println(exampleAST(284, "\U00100002 _Static_assert ( 'a' , \"b\" ) ;")) Output: &cc.StaticAssertDeclaration{ · ConstantExpression: &cc.ConstantExpression{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example284.c:1:19: CHARCONST "'a'", · · }, · }, · Token: example284.c:1:2: STATIC_ASSERT "_Static_assert", · Token2: example284.c:1:17: '(', · Token3: example284.c:1:23: ',', · Token4: example284.c:1:25: STRINGLITERAL "\"b\"", · Token5: example284.c:1:29: ')', · Token6: example284.c:1:31: ';', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StorageClassSpecifier struct { Case int Token xc.Token // contains filtered or unexported fields }

StorageClassSpecifier represents data reduced by productions:

StorageClassSpecifier: "typedef" | "extern" // Case 1 | "static" // Case 2 | "auto" // Case 3 | "register" // Case 4

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StringLitID int

StringLitID is the type of an Expression.Value representing the numeric ID of a string literal.

❖ type StructDeclaration struct { Case int SpecifierQualifierList *SpecifierQualifierList StaticAssertDeclaration *StaticAssertDeclaration StructDeclaratorList *StructDeclaratorList Token xc.Token }

StructDeclaration represents data reduced by productions:

StructDeclaration: SpecifierQualifierList StructDeclaratorList ';' | SpecifierQualifierList ';' // Case 1 | StaticAssertDeclaration // Case 2

Example Code: fmt.Println(exampleAST(124, "\U00100002 struct { _Bool a ; }")) Output: &cc.StructDeclaration{ · SpecifierQualifierList: &cc.SpecifierQualifierList{ · · TypeSpecifier: &cc.TypeSpecifier{ · · · Case: 9, · · · Token: example124.c:1:11: BOOL "_Bool", · · }, · }, · StructDeclaratorList: &cc.StructDeclaratorList{ · · StructDeclarator: &cc.StructDeclarator{ · · · Declarator: &cc.Declarator{ · · · · Linkage: None, · · · · Type: bool, · · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · · Token: example124.c:1:17: IDENTIFIER "a", · · · · }, · · · }, · · }, · }, · Token: example124.c:1:19: ';', } Example (Case1) Code: fmt.Println(exampleAST(125, "\U00100002 struct { _Bool ; }")) Output: &cc.StructDeclaration{ · Case: 1, · SpecifierQualifierList: &cc.SpecifierQualifierList{ · · TypeSpecifier: &cc.TypeSpecifier{ · · · Case: 9, · · · Token: example125.c:1:11: BOOL "_Bool", · · }, · }, · Token: example125.c:1:17: ';', } Example (Case2) Code: fmt.Println(exampleAST(126, "\U00100002 struct { _Static_assert ( 'a' , \"b\" ) ; }")) Output: &cc.StructDeclaration{ · Case: 2, · StaticAssertDeclaration: &cc.StaticAssertDeclaration{ · · ConstantExpression: &cc.ConstantExpression{ · · · Type: int, · · · Value: 97, · · · Expression: &cc.Expression{ · · · · Type: int, · · · · Value: 97, · · · · Case: 1, · · · · Token: example126.c:1:28: CHARCONST "'a'", · · · }, · · }, · · Token: example126.c:1:11: STATIC_ASSERT "_Static_assert", · · Token2: example126.c:1:26: '(', · · Token3: example126.c:1:32: ',', · · Token4: example126.c:1:34: STRINGLITERAL "\"b\"", · · Token5: example126.c:1:38: ')', · · Token6: example126.c:1:40: ';', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StructDeclarationList struct { Case int StructDeclaration *StructDeclaration StructDeclarationList *StructDeclarationList }

StructDeclarationList represents data reduced by productions:

StructDeclarationList: StructDeclaration | StructDeclarationList StructDeclaration // Case 1

Example Code: fmt.Println(exampleAST(122, "\U00100002 struct { _Bool ; }")) Output: &cc.StructDeclarationList{ · StructDeclaration: &cc.StructDeclaration{ · · Case: 1, · · SpecifierQualifierList: &cc.SpecifierQualifierList{ · · · TypeSpecifier: &cc.TypeSpecifier{ · · · · Case: 9, · · · · Token: example122.c:1:11: BOOL "_Bool", · · · }, · · }, · · Token: example122.c:1:17: ';', · }, } Example (Case1) Code: fmt.Println(exampleAST(123, "\U00100002 struct { _Bool ; _Bool ; }")) Output: &cc.StructDeclarationList{ · StructDeclaration: &cc.StructDeclaration{ · · Case: 1, · · SpecifierQualifierList: &cc.SpecifierQualifierList{ · · · TypeSpecifier: &cc.TypeSpecifier{ · · · · Case: 9, · · · · Token: example123.c:1:11: BOOL "_Bool", · · · }, · · }, · · Token: example123.c:1:17: ';', · }, · StructDeclarationList: &cc.StructDeclarationList{ · · Case: 1, · · StructDeclaration: &cc.StructDeclaration{ · · · Case: 1, · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ · · · · TypeSpecifier: &cc.TypeSpecifier{ · · · · · Case: 9, · · · · · Token: example123.c:1:19: BOOL "_Bool", · · · · }, · · · }, · · · Token: example123.c:1:25: ';', · · }, · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StructDeclarator struct { Case int ConstantExpression *ConstantExpression Declarator *Declarator DeclaratorOpt *DeclaratorOpt Token xc.Token }

StructDeclarator represents data reduced by productions:

StructDeclarator: Declarator | DeclaratorOpt ':' ConstantExpression // Case 1

Example Code: fmt.Println(exampleAST(133, "\U00100002 struct { _Bool a ,")) Output: &cc.StructDeclarator{ · Declarator: &cc.Declarator{ · · Linkage: None, · · Type: bool, · · DirectDeclarator: &cc.DirectDeclarator{ · · · Token: example133.c:1:17: IDENTIFIER "a", · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(134, "\U00100002 struct { _Bool : 'a' ,")) Output: &cc.StructDeclarator{ · Case: 1, · ConstantExpression: &cc.ConstantExpression{ · · Type: int, · · Value: 97, · · Expression: &cc.Expression{ · · · Type: int, · · · Value: 97, · · · Case: 1, · · · Token: example134.c:1:19: CHARCONST "'a'", · · }, · }, · Token: example134.c:1:17: ':', }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StructDeclaratorList struct { Case int StructDeclarator *StructDeclarator StructDeclaratorList *StructDeclaratorList Token xc.Token }

StructDeclaratorList represents data reduced by productions:

StructDeclaratorList: StructDeclarator | StructDeclaratorList ',' StructDeclarator // Case 1

Example Code: fmt.Println(exampleAST(131, "\U00100002 struct { _Bool a ,")) Output: &cc.StructDeclaratorList{ · StructDeclarator: &cc.StructDeclarator{ · · Declarator: &cc.Declarator{ · · · Linkage: None, · · · Type: bool, · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · Token: example131.c:1:17: IDENTIFIER "a", · · · }, · · }, · }, } Example (Case1) Code: fmt.Println(exampleAST(132, "\U00100002 struct { _Bool a , b ,")) Output: &cc.StructDeclaratorList{ · StructDeclarator: &cc.StructDeclarator{ · · Declarator: &cc.Declarator{ · · · Linkage: None, · · · Type: bool, · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · Token: example132.c:1:17: IDENTIFIER "a", · · · }, · · }, · }, · StructDeclaratorList: &cc.StructDeclaratorList{ · · Case: 1, · · StructDeclarator: &cc.StructDeclarator{ · · · Declarator: &cc.Declarator{ · · · · Linkage: None, · · · · Type: bool, · · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · · Token: example132.c:1:21: IDENTIFIER "b", · · · · }, · · · }, · · }, · · Token: example132.c:1:19: ',', · }, }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StructOrUnion struct { Case int Token xc.Token }

StructOrUnion represents data reduced by productions:

StructOrUnion: "struct" | "union" // Case 1

Example Code: fmt.Println(exampleAST(120, "\U00100002 struct {")) Output: &cc.StructOrUnion{ · Token: example120.c:1:2: STRUCT "struct", } Example (Case1) Code: fmt.Println(exampleAST(121, "\U00100002 union {")) Output: &cc.StructOrUnion{ · Case: 1, · Token: example121.c:1:2: UNION "union", }

Pos reports the position of the first component of n or zero if it's empty.

String implements fmt.Stringer.

❖ type StructOrUnionSpecifier struct { Case int IdentifierOpt *IdentifierOpt StructDeclarationList *StructDeclarationList StructOrUnion *StructOrUnion Token xc.Token Token2 xc.Token // contains filtered or unexported fields }

StructOrUnionSpecifier represents data reduced by productions:

StructOrUnionSpecifier: StructOrUnion IdentifierOpt '{' StructDeclarationList '}' | StructOrUnion IDENTIFIER // Case 1 | StructOrUnion IdentifierOpt '{' '}' // Case 2

Example Code: fmt.Println(exampleAST(117, "\U00100002 struct { int i; } (")) Output: &cc.StructOrUnionSpecifier{ · StructDeclarationList: &cc.StructDeclarationList{ · · StructDeclaration: &cc.StructDeclaration{ · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ · · · · TypeSpecifier: &cc.TypeSpecifier{ · · · · · Case: 3, · · · · · Token: example117.c:1:11: INT "int", · · · · }, · · · }, · · · StructDeclaratorList: &cc.StructDeclaratorList{ · · · · StructDeclarator: &cc.StructDeclarator{ · · · · · Declarator: &cc.Declarator{ · · · · · · Linkage: None, · · · · · · Type: int, · · · · · · DirectDeclarator: &cc.DirectDeclarator{ · · · · · · · Token: example117.c:1:15: IDENTIFIER "i", · · · · · · }, · · · · · }, · · · · }, · · · }, · · · Token: example117.c:1:16: ';', · · }, · }, · StructOrUnion: &cc.StructOrUnion{ · · Token: example117.c:1:2: STRUCT "struct", · }, · Token: example117.c:1:9: '{', · Token2: example117.c:1:18: '}', } Example (Case1) Code: fmt.Println(exampleAST(118, "\U00100002 struct a (")) Output: &cc.StructOrUnionSpecifier{ · Case: 1, · StructOrUnion: &cc.StructOrUnion{ · · Token: example118.c:1:2: STRUCT "struct", · }, · Token: example118.c:1:9: IDENTIFIER "a", } Example (Ca