codekingpro/portable-devtools
114k
1#-----------------------------------------------------------------2# pycparser: _c_ast.cfg3#4# Defines the AST Node classes used in pycparser.5#6# Each entry is a Node sub-class name, listing the attributes7# and child nodes of the class:8# <name>* - a child node9# <name>** - a sequence of child nodes10# <name> - an attribute11#12# Eli Bendersky [https://eli.thegreenplace.net/]13# License: BSD14#-----------------------------------------------------------------15 16# ArrayDecl is a nested declaration of an array with the given type.17# dim: the dimension (for example, constant 42)18# dim_quals: list of dimension qualifiers, to support C99's allowing 'const'19# and 'static' within the array dimension in function declarations.20ArrayDecl: [type*, dim*, dim_quals]21 22ArrayRef: [name*, subscript*]23 24# op: =, +=, /= etc.25#26Assignment: [op, lvalue*, rvalue*]27 28Alignas: [alignment*]29 30BinaryOp: [op, left*, right*]31 32Break: []33 34Case: [expr*, stmts**]35 36Cast: [to_type*, expr*]37 38# Compound statement in C99 is a list of block items (declarations or39# statements).40#41Compound: [block_items**]42 43# Compound literal (anonymous aggregate) for C99.44# (type-name) {initializer_list}45# type: the typename46# init: InitList for the initializer list47#48CompoundLiteral: [type*, init*]49 50# type: int, char, float, string, etc.51#52Constant: [type, value]53 54Continue: []55 56# name: the variable being declared57# quals: list of qualifiers (const, volatile)58# funcspec: list function specifiers (i.e. inline in C99)59# storage: list of storage specifiers (extern, register, etc.)60# type: declaration type (probably nested with all the modifiers)61# init: initialization value, or None62# bitsize: bit field size, or None63#64Decl: [name, quals, align, storage, funcspec, type*, init*, bitsize*]65 66DeclList: [decls**]67 68Default: [stmts**]69 70DoWhile: [cond*, stmt*]71 72# Represents the ellipsis (...) parameter in a function73# declaration74#75EllipsisParam: []76 77# An empty statement (a semicolon ';' on its own)78#79EmptyStatement: []80 81# Enumeration type specifier82# name: an optional ID83# values: an EnumeratorList84#85Enum: [name, values*]86 87# A name/value pair for enumeration values88#89Enumerator: [name, value*]90 91# A list of enumerators92#93EnumeratorList: [enumerators**]94 95# A list of expressions separated by the comma operator.96#97ExprList: [exprs**]98 99# This is the top of the AST, representing a single C file (a100# translation unit in K&R jargon). It contains a list of101# "external-declaration"s, which is either declarations (Decl),102# Typedef or function definitions (FuncDef).103#104FileAST: [ext**]105 106# for (init; cond; next) stmt107#108For: [init*, cond*, next*, stmt*]109 110# name: Id111# args: ExprList112#113FuncCall: [name*, args*]114 115# type <decl>(args)116#117FuncDecl: [args*, type*]118 119# Function definition: a declarator for the function name and120# a body, which is a compound statement.121# There's an optional list of parameter declarations for old122# K&R-style definitions123#124FuncDef: [decl*, param_decls**, body*]125 126Goto: [name]127 128ID: [name]129 130# Holder for types that are a simple identifier (e.g. the built131# ins void, char etc. and typedef-defined types)132#133IdentifierType: [names]134 135If: [cond*, iftrue*, iffalse*]136 137# An initialization list used for compound literals.138#139InitList: [exprs**]140 141Label: [name, stmt*]142 143# A named initializer for C99.144# The name of a NamedInitializer is a sequence of Nodes, because145# names can be hierarchical and contain constant expressions.146#147NamedInitializer: [name**, expr*]148 149# a list of comma separated function parameter declarations150#151ParamList: [params**]152 153PtrDecl: [quals, type*]154 155Return: [expr*]156 157StaticAssert: [cond*, message*]158 159# name: struct tag name160# decls: declaration of members161#162Struct: [name, decls**]163 164# type: . or ->165# name.field or name->field166#167StructRef: [name*, type, field*]168 169Switch: [cond*, stmt*]170 171# cond ? iftrue : iffalse172#173TernaryOp: [cond*, iftrue*, iffalse*]174 175# A base type declaration176#177TypeDecl: [declname, quals, align, type*]178 179# A typedef declaration.180# Very similar to Decl, but without some attributes181#182Typedef: [name, quals, storage, type*]183 184Typename: [name, quals, align, type*]185 186UnaryOp: [op, expr*]187 188# name: union tag name189# decls: declaration of members190#191Union: [name, decls**]192 193While: [cond*, stmt*]194 195Pragma: [string]196 