ސ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                        ! " # $ % & ' ( ) * + ,-./0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E FGHIJK L M N OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ghc experimentalbenedikt.huber@gmail.com   ghc experimentalbenedikt.huber@gmail.com*C unary operator (K& R A7.3-4) logical negation one' s complement  prefix minus  prefix plus indirection operator address operator postfix decrement operator postfix increment operator prefix decrement operator prefix increment operator C binary operators (K& R A7.6-15)  logical or  logical and inclusive bitwise or exclusive bitwise or  bitwise and  not equal equal greater or equal less or equal greater less  shift right  shift left remainder of division C assignment operators (K& R A7.17)  !"#$%&remainder and assignment '()*  !"#$%&'()*)('&%$#"!    *    )('&%$#"!  !"#$%&'()ghc experimentalbenedikt.huber@gmail.com*5class of type which aggregate a source code location +,Luniform representation of source file positions; the order of the arguments F is important as it leads to the desired ordering of source positions -.<get the source file of the specified position. Fails unless isSourcePos pos. /<get the line number of the specified position. Fails unless isSourcePos pos 07get the column of the specified position. Fails unless isSourcePos pos 1returns True7 if the given position refers to an actual source file 2/no position (for unknown position information) 34&position attached to built-in objects 5returns True6 if the given position refers to a builtin definition 6"position used for internal errors 7returns True# if the given position is internal 8advance column 9Uadvance column to next tab positions (tabs are considered to be at every 8th column) :advance to next line *+,-./0123456789:,-./0123456789:*+*++,--./0123456789:ghc experimentalbenedikt.huber@gmail.com;Name is a unique identifier <=>return an infinite stream of <;s starting with nameId 0 ?Hget the infinite stream of unique names starting from the given integer ;<=>?;<=>?;<=<=>?ghc experimentalbenedikt.huber@gmail.com @Ha class for convenient access to the attributes of an attributed object ABParsed entity attribute CDEFGHequality by name IJ@Given only a source position, create a new attribute identifier KBGiven a source position and a unique name, create a new attribute  identifier @ABCDEFGHIJK BDCIJK@AGFEH @AABDCCDEFGHIJKghc experimentalbenedikt.huber@gmail.com5LMNC String literals OP Floats (represented as strings) QRST.datatype representing type flags for integers UVWXY9datatype for memorizing the representation of an integer Z[\]C char constants (abstract) ^_`showCharConst cG prepends _a_ String representing the C char constant corresponding to c. ; If neccessary uses octal or hexadecimal escape sequences. a2get the haskell representation of a char constant b'get integer value of a C char constant 0 undefined result for multi-char char constants creturn true if the character constant is wide. d.construct a character constant from a haskell   Use cchar_w( if you want a wide character constant. e&construct a wide chararacter constant f,create a multi-character character constant ghiIconstruct a integer constant (without type flags) from a haskell integer jklmno(concatenate a list of C string literals pshowStringLiteral sF prepends a String representing the C string literal corresponding to s. > If neccessary it uses octal or hexadecimal escape sequences. isAsciiSourceChar b returns True- if the given character is a character which 9 may appear in a ASCII C source file and is printable.  isCChar cO returns true, if c is a source character which does not have to be escaped in # C char constants (C99: 6.4.4.4)  escapeCChar c& escapes c for use in a char constant  isSChar cW returns true if c is a source character which does not have to be escaped in C string  literals (C99: 6.4.5) qrstuvw,LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw,qrsLMtuvwdef]_^abc`TXWVUY\[ZiRShgjPQklmNOnpo,LMMNOOPQQRSSTXWVUUVWXY\[ZZ[\]_^^_`abcdefghijklmnopqrstuvwghc experimentalbenedikt.huber@gmail.comxC identifiers yz>References uniquely determining a struct, union or enum type. E Those are either identified by an string identifier, or by a unique  name (anonymous types). {|}Return true if the struct/union/enum reference is anonymous. ~#build an identifier from a string. I only minimal error checking, e.g., the characters of the identifier are G not checked for being alphanumerical only; the correct lexis of the B identifier should be ensured by the caller, e.g., the scanner. : for reasons of simplicity the complete lexeme is hashed.  returns an internal7 identifier (has internal position and no unique name)  return an internal identifier with position info  returns a builtin6 identifier (has builtin position and no unique name) return True if the given identifier is internal string of an identifier Ddump the identifier string and its positions for debugging purposes xyz{|}~ xyz|{}~ xyyz|{{|}~ghc experimentalbenedikt.huber@gmail.comAttributed string literals  C constant (K&R A2.5 & A7.2) +GNU Builtins, which cannot be typed in C99   (type,type) (type, designator-list)  (expr, type)C expression (K&R A7) 7 these can be arbitrary expression, as the argument of sizeof can be 9 arbitrary, even if appearing in a constant expression  GNU C extensions: alignof, __real, __imag, ({ stmt-expr }), && label and built-ins builtin expressions, see  GNU C address of label !GNU C compound statement as expr C99 compound literal 8integer, character, floating point and string constants  __attribute__ annotations Those are of the form )CAttr attribute-name attribute-parameters, ? and serve as generic properties of some syntax tree elements.  Designators VA designator specifies a member of an object, either an element or range of an array, ! or the named member of a struct / union. array range designator CRangeDesig from to _ (GNU C) member designator array position designator Initializer List 3The members of an initializer list are of the form (designator-list,initializer).  designator-listE is allowed to be empty - in this case the initializer refers to the  ''next''. member of the compound type (see C99 6.7.8). 3Examples (simplified expressions and identifiers):  ! -- { [0], [3] = 4, [2] = 5, 8 } 7 let init1 = ([CArrDesig 0, CArrDesig 3], CInitExpr 4) * init2 = ([CArrDesig 2], CInitExpr 5)  init3 = ([], CInitExpr 8) % in CInitList [init1, init2, init3] $ -- { .s = { {2,3} , .a = { 1 } } } % let init_1 = [ ([], CInitExpr 1) ] : init_23 = zip (repeat []) [CInitExpr 2, CInitExpr 3] ( init_s_1 = ([], CInitList init_23) 7 init_s_a = ([CMemberDesig "a"], CInitList init_1) C init_s = ((CMemberDesig "s"), CInitList [init_s_1,init_s_a])  in CInitList [init_s] C initialization (K&R A8.7, C99 6.7.8) DInitializers are either assignment expressions or initializer lists = (surrounded in curly braces), whose elements are themselves < initializers, paired with an optional list of designators. initialization list (see ) assignment expression C enumeration specifier (K&R A8.4, C99 6.7.2.2) &CEnum identifier enumerator-list attrs represent as enum specifier L Either the identifier or the enumerator-list (or both) have to be present.  If enumerator-list% is present, it has to be non-empty. $ The enumerator list is of the form *(enumeration-constant, enumeration-value?), where the latter 1 is an optional constant integral expression.  attrs is a list of  __attribute__7 annotations associated with the enumeration specifier (A tag to determine wheter we refer to a struct or union, see . "C structure or union specifiers (K&R A8.3, C99 6.7.2.1) +CStruct tag identifier struct-decls c-attrs6 represents a struct or union specifier (depending on tag).  either  identifier or the declaration list  struct-decls (or both) have to be present.  Example: in  struct foo x; , the identifier is present, in struct { int y; } x the declaration list, and  in struct foo { int y; } x; both of them.  c-attrs is a list of  __attribute__; annotations associated with the struct or union specifier C type qualifiers (K&ER A8.2, C99 6.7.3), function specifiers (C99 6.7.4), and attributes. const, volatile and restrict type qualifiers and inline function specifier.  Additionally,  __attribute__/ annotations for declarations and declarators. C type specifier (K&R A8.2, C99 6.7.2) /Type specifiers are either basic types such as char or int,  struct, union or enum specifiers or typedef names. As a GNU extension, a typeof& expression also is a type specifier.   typeof(type)  typeof(expr) Typedef name Enumeration specifier Struct or Union specifier +C storage class specifier (and typedefs) (K&R A8.1, C99 6.7.1) GNUC thread local storage typedef extern static  register auto (C declaration specifiers and qualifiers PDeclaration specifiers include at most one storage-class specifier (C99 6.7.1), 6 type specifiers (6.7.2) and type qualifiers (6.7.3). type qualifier  type name #storage-class specifier or typedef C99 Block items OThings that may appear in compound statements: either statements, declarations # or nested function definitions. A nested function (GNU C) A local declaration  A statement Assembler operand 'CAsmOperand argName? constraintExpr arg' specifies an operand for an assembler  statement. GNU Assembler statement  = CAsmStatement type-qual? asm-expr out-ops in-ops clobbers _ "is an inline assembler statement. - The only type-qualifier (if any) allowed is volatile.  asm-expr0 is the actual assembler epxression (a string), out-ops and in-ops are the input ' and output operands of the statement.  clobbersS is a list of registers which are clobbered when executing the assembler statement C statement (K&R A9, C99 6.8) assembly statement return statement CReturn returnExpr break statement continue statement computed goto CGotoPtr labelExpr goto statement  CGoto label for statement CFor init expr-2 expr-3 stmt, where init is either a declaration or  initializing expression while or do-while statement CWhile guard stmt isDoWhile at switch statement CSwitch selectorExpr switchStmt, where  switchStmt usually includes  case, break and default statements conditional statement $CIf ifExpr thenStmt maybeElseStmt at compound statement #CCompound localLabels blockItems at MA simple statement, that is in C: evaluating an expression with side-effects  and discarding the result. The default case default : stmt A case range of the form case lower ... upper : stmt A statement of the form case expr : stmt .An (attributed) label followed by a statement Size of an array  CArrSize isStatic expr CUnknownSize isCompleteTypeDerived declarators, see  ZIndirections are qualified using type-qualifiers and generic attributes, and additionally H The size of an array is either a constant expression, variable length ($) or missing; in the last case, the t type of the array is incomplete. The qualifier static is allowed for function arguments only, indicating that D the supplied argument is an array of at least the given size. ) New style parameter lists have the form  Right (declarations, isVariadic)%, old style parameter lists have the  form Left (parameter-names) Function declarator =CFunDeclr declr (old-style-params | new-style-params) c-attrs Array declarator "CArrDeclr declr tyquals size-expr? Pointer declarator CPtrDeclr tyquals declr C declarator (K&-R A8.5, C99 6.7.5) and abstract declarator (K&R A8.8, C99 6.7.6) WA declarator declares a single object, function, or type. It is always associated with  a declaration ("), which specifies the declaration'1s type and the additional storage qualifiers and 1 attributes, which apply to the declared object. A declarator is of the form +CDeclr name? indirections asm-name? attrs _, where  nameH is the name of the declared object (missing for abstract declarators),   declquals0 is a set of additional declaration specifiers,  asm-name; is the optional assembler name and attributes is a set of  attrs is a set of  __attribute__& annotations for the declared object.  indirectionsf is a set of pointer, array and function declarators, which modify the type of the declared object as  described below. If the  declaration specifies the non-derived type T,  and we have indirections = [D1, D2, ..., Dn]# than the declared object has type  (D1 indirect (D2 indirect ... (Dn indirect T))), where  (CPtrDeclr attrs) indirect T is attributed pointer to T  (CFunDeclr attrs) indirect T is attributed function returning T  (CArrayDeclr attrs) indirect T is (attributed array of elemements of type T "Examples (simplified attributes):  x is an int   int x;  CDeclr "x" []  x1 is a restrict pointer to a const pointer to int  ! const int * const * restrict x; 6 CDeclr "x" [CPtrDeclr [restrict], CPtrDeclr [const]]  f1 is an function return a constant pointer to int   int* const f(); - CDeclr "f" [CFunDeclr [],CPtrDeclr [const]]  f3 is a constant pointer to a function returning int  int (* const f)(); ==> . CDeclr "f" [CPtrDeclr [const], CFunDeclr []] C declarations (K&<R A8, C99 6.7), including structure declarations, parameter  declarations and type names. A declaration is of the form %CDecl specifiers init-declarator-list', where the form of the declarator list's / elements depends on the kind of declaration: 1) Toplevel declarations (K&R A8, C99 6.7 declaration) b C99 requires that there is at least one specifier, though this is merely a syntactic restriction @ at most one storage class specifier is allowed per declaration  the elements of the non-empty init-declarator-list are of the form (Just declr, init?, Nothing).  The declarator declrI has to be present and non-abstract and the initialization expression is  optional. 2) Structure declarations (K&(R A8.3, C99 6.7.2.1 struct-declaration) )Those are the declarations of a structure' s members. ! do not allow storage specifiers < in strict C99, the list of declarators has to be non-empty  the elements of init-declarator-list are either of the form (Just declr, Nothing, size?), H representing a member with optional bit-field size, or of the form (Nothing, Nothing, Just size),  for unnamed bitfields. declr has to be non-abstract. 5 no member of a structure shall have incomplete type 3) Parameter declarations (K&+R A8.6.3, C99 6.7.5 parameter-declaration)  init-declarator-list- must contain at most one triple of the form (Just declr, Nothing, Nothing), Z i.e. consist of a single declarator, which is allowed to be abstract (i.e. unnamed).  4) Type names (A8.8, C99 6.7.6) ! do not allow storage specifiers  init-declarator-list- must contain at most one triple of the form (Just declr, Nothing, Nothing).  where declr& is an abstract declarator (i.e. doesn'!t contain a declared identifier) #C function definition (C99 6.9.1, K& R A10.1) %A function definition is of the form ,CFunDef specifiers declarator decllist? stmt.   specifiers< are the type and storage-class specifiers of the function. 1 The only storage-class specifiers allowed are extern and static.  The  declarator/ must be such that the declared identifier has  function type. J The return type shall be void or an object type other than array type.  The optional declaration list decllist) is for old-style function declarations.  The statement stmt is a compound statement. "External C declaration (C99 6.9, K&R A10) JEither a toplevel declaration, function definition or external assembler. 'Complete C tranlsation unit (C99 6.9, K&R A10) SA complete C translation unit, for example representing a C header or source file. A It consists of a list of external (i.e. toplevel) declarations. $Seperate the declaration specifiers Note that inline isn'7t actually a type qualifier, but a function specifier.   __attribute__G of a declaration qualify declarations or declarators (but not types), & and are therefore seperated as well. returns True2 if the given typespec is a struct, union or enum  definition &Lift a string literal to a C constant   !"#$%&'())('&%$#"!   portablebenedikt.huber@gmail.com   portablealphabenedikt.huber@gmail.comNameSpaceMap a is a Map from identifiers to a, which manages  global and local name spaces. create a name space Add global definition (ns'!,oldDef) = defGlobal ns ident def  adds a global definition  ident := def to the namespace. % It returns the modified namespace ns'. If the identifier is K already declared in the global namespace, the definition is overwritten  and the old definition oldDef is returned. Enter new local scope ns' = enterNewScope ns' creates and enters a new local scope. Leave innermost local scope (ns',defs) = leaveScope ns( pops leaves the innermost local scope.  and returns its definitions Add local definition (ns' ,oldDef) = defLocal ns ident def adds the local definition   ident := def: to the innermost local scope, if there is a local scope, ( and to the global scope otherwise. & It returns the modified name space ns' and the old binding of  the identifier oldDef, which is overwritten. Search for a definition def = find ns ident8 returns the definition in some scope (inner to outer),  if there is one. &flatten a namespace into a assoc list [nameSpaceToList ns = (localDefInnermost ns ++ .. ++ localDefsOutermost ns) ++ globalDefs ns  %portable C Tokens for the C lexer.benedikt.huber@gmail.comh     h     h_           ghc experimentalbenedikt.huber@gmail.com Ounspecified error raised by the user (in case the user does not want to define  her own error types).  Terror raised if a operation requires an unsupported or not yet implemented feature.   %errors in Language.C are instance of    (obtain source location etc. of an error wrap error in  try to cast a generic  to the specific error type modify the error level  supertype of all errors 2information attached to every error in Language.C Error levels (severity) return True6 when the given error makes it impossible to continue  analysis or compilation. position of an Error severity level of an Error message lines of an Error  !"5converts an error into a string using a fixed format U either the lines of the long error message or the short message has to be non-empty  the format is . <fname>:<row>: (column <col>) [<err lvl>]  >>> <line_1>  <line_2>  ...  <line_n> !#>raise a fatal internal error; message may have multiple lines "#     !"#  !"   #      !"# ghc experimentalbenedikt.huber@gmail.com$%(c,is') = takeChar is reads and removes  the first character c from the $ is &return True$ if the given input stream is empty 'str = takeChars n is returns the first n characters 2 of the given input stream, without removing them (read a file into an $ )convert $ to $ * convert a $ to an $ + countLines* returns the number of text lines in the  given $ $%&'()*+$()*%&'+$%&'()*+portablebenedikt.huber@gmail.com ,%&'()*+,-./01-./7execute the given parser on the supplied input stream.  returns .-% if the parser failed, and a pair of . result and remaining name supply otherwise  Synopsis: JexecParser parser inputStream initialPos predefinedTypedefs uniqNameSupply 23456789:;<=>?@,-./456789:;<=>?@,-../456789:;<=>?@&ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefdfdf portable experimentalbenedikt.huber@gmail.com0'Generic arguments for the preprocessor 1234567%Generic Options for the preprocessor 89:;<<B encapsulates the abstract interface for invoking C preprocessors =Zparse the given command line arguments, and return a pair of parsed and ignored arguments >run the preprocessor g&file extension of a preprocessed file h5Cpp arguments that only specify the input file name. ?<use the given preprocessor arguments without analyzing them @7add a typed option to the given preprocessor arguments A8add a string option to the given preprocessor arguments B#run the preprocessor and return an $ if preprocesssing succeeded icreate an output file, given  Maybe tmpdir and  inputfile j.compute output file name from input file name kcreate a temporary file C8guess whether a file is preprocessed (file end with .i) 0123456789:;<=>?@ABC<=>7;:980123456?@ABC01234561234567;:9889:;<=>=>?@ABC portable experimentalbenedikt.huber@gmail.comlDGCC, represents a reference to the gcc compiler mnEcreate a reference to gcc o+Parse arguments for preprocessing via GCC. 6 At least one .c, .hc or .h file has to be present. ; For now we only support the most important gcc options. '1) Parse all flags relevant to CppArgs # 2) Move -c,-S,-M? to other_args  3) Strip -E $ 4) The rest goes into extra_args pDEDEDEghc experimentalbenedikt.huber@gmail.com  !"#$%&'()LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw/qrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~FparseC input initialPos] parses the given preprocessed C-source input and returns the AST or a list of parse errors. G translUnitP\ provides a parser for a complete C translation unit, i.e. a list of external declarations. HextDeclP< provides a parser for an external (file-scope) declaration I statementP$ provides a parser for C statements J expressionP% provides a parser for C expressions FGHIJFGHIJghc experimentalbenedikt.huber@gmail.comH*+,-./0124567;<=>@ABCDEFGIJKxz{|}~     !"#$%&'()*+&z|{}x~;<=>,-*+./0246157BDC@AGFEIJK portable experimentalbenedikt.huber@gmail.com K-A class of types which can be pretty printed Lpretty print the given value MprettyPrec prec p pretty prints p assuming 2 that the surrounding context has a precedence of  prec NXPretty print the given tranlation unit, but replace declarations from header files with #include directives. 7The resulting file may not compile (because of missing #define5 directives and similar things), but is very usefull l for testing, as otherwise the pretty printed file will be cluttered with declarations from system headers. KLMNKLMNKLMLMNghc experimentalbenedikt.huber@gmail.comOBrun the given parser using a new name supply and builtin typedefs  see /  Synopsis: 'runParser parser inputStream initialPos  ,-./FGHIJO F,/O GHIJ-.Oghcalphabenedikt.huber@gmail.comPP is currently an alias for  (Syntax) QQ is an alias for  (Syntax) RS __attribute__ annotations Those are of the form (Attr attribute-name attribute-parameters, ? and serve as generic properties of some syntax tree elements. Some examples:  labels can be attributed with unused! to indicate that their not used + struct definitions can be attributed with packed= to tell the compiler to use the most compact representation % declarations can be attributed with  deprecated . function declarations can be attributes with noreturn; to tell the compiler that the function will never return,  or with const( to indicate that it is a pure function TODON: ultimatively, we want to parse attributes and represent them in a typed way TUAssembler name (alias for CStrLit) V%Top level assembler block (alias for CStrLit) WVarName name assembler-name! is a name of an declared object XYZZ is currently an alias for . We'Sre planning a normalized representation, but this depends on the implementation of  constant expression evaluation [1Type qualifiers: constant, volatile and restrict \]^_`YAn Enumerator consists of an identifier, a constant expressions and the link to its type ab&Representation of C enumeration types c .EnumType name enumeration-constants attrs noded(a tag to determine wheter we refer to a struct or union, see hg. efg"Composite type (struct or union). hijkcomposite type declarations lm"floating point type (C99 6.7.2.2) nopqintegral types (C99 6.7.2.2) rstuvwxyz{|}~typdef references = If the actual type is known, it is attached for convenience Builtin type (va_list) normalized type representation nAn array type may either have unknown size or a specified array size, the latter either variable or constant. O Furthermore, when used as a function parameters, the size may be qualified as static. * In a function prototype, the size may be `Unspecified variable size' ([*]).  "FixedSizeArray is-static size-expr UnknownArraySize is-starredFunction types are of the form +FunType return-type params isVariadic attrs. If the parameter types aren'#t yet known, the function has type FunTypeIncomplete type attrs. types of C objects (GNU) typeof (brokenI and should be removed, but we do not yet have expression type analysis) a defined type function type  array type  pointer type a non-derived type =Linkage: Either internal to the translation unit or external +Storage duration and linkage of a variable .function, either internal or external linkage @static storage, with linkage and thread local specifier (gnu c) 'automatic storage (optional: register)  no storage #Declaration attributes of the form 0DeclAttrs isInlineFunction storage linkage attrs ;They specify the storage and linkage of a declared object.  DeclAttrs inline storage attrsGeneric variable declarations typedef definitions. 1The identifier is a new name for the given type. Struct/Union member declaration  AnonBitField typ size $MemberDecl vardecl bitfieldsize nodeParameter declaration Function definitions VA function definition is a declaration together with a statement (the function body). Object Definitions DAn object definition is a declaration together with an initializer. DIf the initializer is missing, it is a tentative definition, i.e. a / definition which might be overriden later on. Declarations, which aren't definitions Declaration events QThose events are reported to callbacks, which are executed during the traversal. assembler block a type definition %file-scope declaration or definition file-scope struct/union/ enum event global declaration/*definition table returned by the analysis @identifiers, typedefs and enumeration constants (namespace sum) definition of an enumerator function definition object definition object or function declaration 9All datatypes aggregating a declaration are instances of  Declaration Mget the name, type and declaration attributes of a declaration or definition "Composite type definitions (tags) 7accessor class : composite type tags (struct or union) accessor class : struct/union/ enum names 2return the type corresponding to a tag definition 2get the declaration corresponding to a definition ?get the variable identifier of a declaration (only safe if the - the declaration is known to have a name) get the variable name of a  Declaration get the type of a  Declaration $get the declaration attributes of a  Declaration -textual description of the kind of an object splitIdentDecls includeAllDecls[ splits a map of object, function and enumerator declarations and definitions into one map o holding declarations, and three maps for object definitions, enumerator definitions and function definitions.  If includeAllDecls is Trueg all declarations are present in the first map, otherwise only those where no corresponding definition  is available. empty global declaration table filter global declarations merge global declarations Returns True. if the given object definition is tentative. return the idenitifier of a typedef get the  of a declaration return True if the object has linkage resolve typedefs, if possible return True& if the given type is a function type HResult is undefined in the presence of TypeOfExpr or undefined typeDefs /return the type of a composite type definition &return the type of an enum definition no type qualifiers merge (&&) two type qualifier sets PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~~q}|{zyxwvutsrmponklghdfeijbc`a[\]^_WYXUSTRQPZVPQRSTTUVWYXXYZ[\]^_\]^_`aabccdfeefghhijjkllmponnopq }|{zyxwvutsrrstuvwxyz{|}~ghcalphabenedikt.huber@gmail.comORedefError is caused by an invalid redefinition of the same identifier or type DBadSpecifierError is caused by an invalid combination of specifiers FInvalidASTError is caused by the violation of an invariant in the AST ghc prototypebenedikt.huber@gmail.com0express storage in terms of storage specifiers. This isn'It always possible and depends on the context the identifier is declared. ! Most importantly, if there is a  conflicting- declaration in scope, export is impossible. = Furthermore, automatic storage is impossible in file scope. B If the storage can actually be specified, the export is correct.    ghc prototypebenedikt.huber@gmail.comghcalphabenedikt.huber@gmail.com3Status of a declaration kind mismatch #new def shadows one in outer scope new def was discarded old def was overwritten  new entry "Table holding current definitions   declared `ordinary identifiers'  declared structunion enum tags  defined labels  !member declarations (only local)  link names with definitions >Tag names map to forward declarations or definitions of struct/union/ enum types  All ordinary identifiers map to  IdenTyDecl: either a typedef or a object/function/ enumerator Aempty definition table, with all name space maps in global scope 7get the globally defined entries of a definition table 9Enter function scope (and the corresponding block scope) :Leave function scope, and return the associated DefTable. # Error if not in function scope. Enter new block scope Leave innermost block scope #Enter new member declaration scope )Leave innermost member declaration scope sameTagKind ty1 ty2 returns True if ty1,ty21 are the same kind of tag (struct,union or enum) declare/define a global object/function/typeDef returns Redeclared def if there is already an object/function/typeDef  in global scope, or DifferentKindRedec def0 if the old declaration is of a different kind. declare/define a object/function/typeDef with lexical scope returns Redeclared def or DifferentKindRedec def if there is already an object/function/typeDef  in the same scope.  declare/define a object/function/DtypeDef with lexical scope, if the given predicate holds on the old  entry. returns  Keep old_def if the old definition shouldn' t be overwritten, and otherwise Redeclared def or  DifferentKindRedec def if there is already an object/function/typeDef in the same scope. !3declare a tag (fwd decl in case the struct name isn't defined yet) " define a tag #define a label ? Return the old label if it is already defined in this function's scope $:lookup identifier (object, function, typeDef, enumerator) % lookup tag & lookup label '(lookup an object in the innermost scope (,lookup an identifier in the innermost scope (      !"#$%&'((      !"#$%&'((           !"#$%&'(ghcalphabenedikt.huber@gmail.comB)*+;simple traversal monad, providing user state and callbacks ,Traversal monad - throw an   . catch an  3 (we could implement dynamically-typed catch here) /remember that an   occured (without throwing it) 0#return the list of recorded errors 1return the definition table 21perform an action modifying the definition table 3unique name generation 4&handling declarations and definitions 5[forward declaration of a tag. Only neccessary for name analysis, but otherwise no semantic  consequences. 6/define the given composite type or enumeration F If there is a declaration visible, overwrite it with the definition. = Otherwise, enter a new definition in the current namespace. K If there is already a definition present, yield an error (redeclaration). 789:Thandle variable declarations (external object declarations and function prototypes) ^ variable declarations are either function prototypes, or external declarations, and not very U interesting on their own. we only put them in the symbol table and call the handle. ) declarations never override definitions ;Vhandle parameter declaration. The interesting part is that parameters can be abstract y (if they are part of a type). If they have a name, we enter the name (usually in function prototype or function scope), / checking if there are duplicate definitions. _ FIXME: I think it would be more transparent to handle parameter declarations in a special way <handle function definitions =+handle object defintions (maybe tentative) >?@ABCDlookup a type definition  the 'wrong kind of object' is an internal error here, : because the parser should distinguish typeDefs and other  objects E)lookup an object, function or enumerator Fcreate a reference to a struct/union/enum MThis currently depends on the fact the structs are tagged with unique names. R We could use the name generation of TravMonad as well, which might be the better . choice when dealing with autogenerated code. GH,check wheter non-recoverable errors occured I)raise an error caused by a malformed AST J+raise an error based on an Either argument KLMNOPQRST,)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST-,-./012345678=<:;9>?@ABCDEFHGJIK+LM)*ONP*QRST,)**+,-./01234-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTghcalphabenedikt.huber@gmail.comAUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx.analyse and translate a parameter declaration 5 Should be called in either prototype or block scope Ka parameter declaration has no linkage and either auto or register storage +analyse and translate a member declaration yanalyse declarators zget the type of a type declaration A type declaration T may appear in thre forms:   typeof(T)7 as abstract declarator in a function prototype, as in f(int) - in a declaration without declarators, as in struct x { int a } ;  Currently, analyseTypeDecl/ is exlusively used for analysing types for GNU's  typeof(T). TWe move attributes to the type, as they have no meaning for the abstract declarator {translate a type |2translate a type without (syntactic) indirections  Due to the GNU typeof7 extension and typeDefs, this can be an arbitrary type Merge type attributes "This handles for example the form   const typeof(char volatile) x; translate a enum type decl  enum my_enum  enum your_enum { x, y=3 } *translate and analyse an enumeration type }VMapping from num type specs to C types (C99 6.7.2-2), ignoring the complex qualifier. ~convert old style parameters VThis requires matching parameter names and declarations, as in the following example:   int f(d,c,a,b)  char a,*b;  int c;  { } is converted to  & int f(int d, int c, char a, char* b) DTODO: This could be moved to syntax, as it operates on the AST only Wsplit a CDecl into declarators, hereby eliding SUE defs from the second declarator on. jThere are several reasons why this isn;t the preferred way for handling multiple-declarator declarations, ( but it can be convinient some times.  - splitCDecl [d| struct x { int z; } a,*b; |] / [ [d| struct x { int z; } a, struct x *b |] ] TODO@: This could be moved to syntax, as it operates on the AST only  translate  __attribute__ annotations & TODO: This is a unwrap and wrap stub  construct a name for a variable  TODO: more or less bogus 2UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2z{|}~jonmlkfihgaedcb[\]^_`UZYXWVrxwvutsypq2UZYXWVVWXYZ[\]^_`\]^_`aedcbbcdefihgghijonmlkklmnopqqrxwvutsstuvwxyz{|}~ghcalphabenedikt.huber@gmail.comAnalyse the given AST analyseAST ast- results in global declaration dictionaries. Y If you want to perform specific actions on declarations or definitions, you may provide  callbacks in the  MonadTrav m. \Returns the set of global declarations and definitions which where successfully translated. J It is the users responsibility to check whether any hard errors occured (runTrav does this for you). !Analyse an top-level declaration Analyse a function definition AAnalyse a top-level declaration other than a function definition Analyse a typedef Analyse declarators )compute storage of a function definition La function definition has static storage with internal linkage if specified static, + the previously declared linkage if any if extern8 or no specifier are present. (See C99 6.2.2, clause 5) This function won'Pt raise an Trav error if the declaration is incompatible with the existing one,  this case is handled in <. handle a function prototype handle a object declaration / definition IWe have to check the storage specifiers here, as they determine wheter we're dealing with decalartions  or definitions  see [doc/ExternalDefinitions.txt] TODO: Bogus TODO: Bogus TODO: Bogus TODO: Bogus  ghcalphabenedikt.huber@gmail.com PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ghc experimentalbenedikt.huber@gmail.com%preprocess and parse a C source file ; Synopsis: parseCFile preprocesssor tmp-dir? cpp-opts file V Example: parseCFile (newGCC "gcc") Nothing ["-I/usr/include/gtk-2.0"] my-gtk-exts.c 2  !"#$%&'()*+,-./0124567;<=>@ABCDEFGIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxz{|}~      !"#$%&'()*+,-./FGHIJKLMNO!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI?JKLLMNOPQRSTUVWXYZZ[\]^_``abcdefghiijjkkllmnopqrstuvwvxyz{|}~                          ! " # $ % & ' ( ) * + , - . /0112 3 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F GHIJKL M N O PQRSTUUVWXYXZ[[\]^__``abcddeeffghijklmnopqrstuvwxxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>>?@ABCDEFGHIJKLMNOPQRRSTUVWXYZ[\]^_`abcdefghijklmnnopqrstuvwxyz{|}~?     ?0      !" #!$%$&'()*+,-./0123456789:;<=>?@AB C D E F G H F I J KLMNNOPQQRSTUUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr s t u v w x y z {|}~language-c-0.3.1Language.C.Syntax.OpsLanguage.C.Data.PositionLanguage.C.Data.NameLanguage.C.Data.NodeLanguage.C.Syntax.ConstantsLanguage.C.Data.IdentLanguage.C.Syntax.ASTLanguage.C.ParserLanguage.C.Data.ErrorLanguage.C.Data.InputStreamLanguage.C.System.PreprocessLanguage.C.System.GCCLanguage.C.PrettyLanguage.C.Analysis.SemRepLanguage.C.Analysis.SemErrorLanguage.C.Analysis.ExportLanguage.C.Analysis.DebugLanguage.C.Analysis.DefTableLanguage.C.Analysis.TravMonad Language.C.Analysis.DeclAnalysisLanguage.C.Analysis.AstAnalysis Language.CLanguage.C.Data.RListLanguage.C.Parser.Builtin Language.C.Analysis.NameSpaceMapLanguage.C.Parser.TokensLanguage.C.Parser.ParserMonadLanguage.C.Parser.LexerLanguage.C.SyntaxLanguage.C.Parser.ParserLanguage.C.DataLanguage.C.AnalysisCUnaryOpCNegOpCCompOpCMinOpCPlusOpCIndOpCAdrOp CPostDecOp CPostIncOp CPreDecOp CPreIncOp CBinaryOpCLorOpCLndOpCOrOpCXorOpCAndOpCNeqOpCEqOpCGeqOpCLeqOpCGrOpCLeOpCShrOpCShlOpCSubOpCAddOpCRmdOpCDivOpCMulOp CAssignOpCOrAssOp CXorAssOp CAndAssOp CShrAssOp CShlAssOp CSubAssOp CAddAssOp CRmdAssOp CDivAssOp CMulAssOpPosposOfPositionposFileposRow posColumn isSourcePosnoposisNoPos builtinPos isBuiltinPos internalPos isInternalPosincPostabPosretPosNamenameId newNameSupplynamesStartingFromCNodenodeInfoNodeInfoOnlyPos nameOfNode posOfNode fileOfNodeeqByName internalNodemkNodeInfoOnlyPos mkNodeInfoFlagsCStringCFloatCIntegerCIntFlagFlagImag FlagLongLongFlagLong FlagUnsignedCIntRepr OctalReprHexReprDecReprCCharCChars showCharConstgetCChar getCCharAsInt isWideCharcCharcChar_wcChars readCInteger getCIntegercIntegercFloat readCFloatcString cString_w getCStringconcatCStrings showStringLit escapeChar unescapeCharunescapeStringnoFlagssetFlag clearFlagtestFlagIdentSUERefNamedRef AnonymousRefisAnonymousRefmkIdent internalIdentinternalIdentAt builtinIdentisInternalIdent identToString dumpIdentCStrLitCConst CStrConst CFloatConst CCharConst CIntConstCBuiltinCBuiltinTypesCompatibleCBuiltinOffsetOf CBuiltinVaArgCExpr CBuiltinExpr CLabAddrExpr CStatExpr CCompoundLitCVarCMemberCCallCIndex CComplexImag CComplexReal CAlignofType CAlignofExpr CSizeofType CSizeofExprCUnaryCCastCBinaryCCondCAssignCCommaCAttr CDesignator CRangeDesig CMemberDesig CArrDesig CInitListCInit CInitExprCEnum CStructTag CUnionTag CStructUnionCStruct CTypeQual CAttrQual CInlineQual CRestrQual CVolatQual CConstQual CTypeSpec CTypeOfType CTypeOfExprCTypeDef CEnumTypeCSUType CComplexType CBoolType CUnsigType CSignedType CDoubleType CFloatType CLongTypeCIntType CShortType CCharType CVoidType CStorageSpecCThreadCTypedefCExternCStatic CRegisterCAuto CDeclSpec CBlockItem CNestedFunDef CBlockDecl CBlockStmt CAsmOperandCAsmStmtCStatCAsmCReturnCBreakCContCGotoPtrCGotoCForCWhileCSwitchCIf CCompoundCDefaultCCasesCCaseCLabelCArrSize CNoArrSize CDerivedDeclr CFunDeclr CArrDeclr CPtrDeclrCDeclrCDeclCFunDefCExtDeclCAsmExtCFDefExtCDeclExt CTranslUnitpartitionDeclSpecsisSUEDef cstringOfLit liftStrLitbuiltinTypeNames UserErrorUnsupportedFeatureError errorInfotoError fromErrorchangeErrorLevelCError ErrorInfo ErrorLevel LevelFatal LevelError LevelWarn isHardError mkErrorInfoerrorPos errorLevel errorMsgsunsupportedFeatureunsupportedFeature_userErr showError showErrorInfo internalErr InputStreamtakeCharinputStreamEmpty takeCharsreadInputStreaminputStreamToStringinputStreamFromString countLinesP ParseError execParserCppArgs cppOptions extraOptions cppTmpDir inputFile outputFile CppOption IncludeFileUndefineDefine IncludeDir Preprocessor parseCPPArgsrunCPP rawCppArgs addCppOptionaddExtraOptionrunPreprocessorisPreprocessedGCCnewGCCparseC translUnitPextDeclP statementP expressionPPrettypretty prettyPrecprettyUsingInclude execParser_ExprStmt AttributesAttrAsmNameAsmBlockVarNameNoName Initializer TypeQualsconstantvolatilerestrict EnumeratorEnumType CompTyKindUnionTag StructTagCompType EnumTypeRef CompTypeRef FloatType TyLDoubleTyDoubleTyFloatIntTypeTyULLongTyLLongTyULongTyLongTyUIntTyIntTyUShortTyShortTyUCharTySCharTyCharTyBool TypeDefRef BuiltinTypeTyVaListTypeName TyBuiltinTyEnumTyComp TyComplex TyFloating TyIntegralTyVoid ArraySizeUnknownArraySizeFunTypeFunTypeIncompleteType TypeOfExpr TypeDefType FunctionType ArrayTypePtrType DirectTypeLinkageExternalLinkageInternalLinkageRegister ThreadLocalStorage FunLinkageStaticAuto NoStorage DeclAttrsVarDeclTypeDef MemberDecl AnonBitField ParamDeclAbstractParamDeclFunDefObjDefDecl DeclEventAsmEvent TypeDefEventTagEvent GlobalDeclsgObjsgTags gTypeDefs IdentDecl EnumeratorDef FunctionDef ObjectDef Declaration getVarDeclTagDefEnumDefCompDef HasCompTyKindcompTag HasSUERefsueRef typeOfTagDef declIdentdeclNamedeclType declAttrs objKindDescrsplitIdentDeclsemptyGlobalDeclsfilterGlobalDeclsmergeGlobalDecls isTentativeidentOfTypeDef isExtDecl declStorage derefTypeDefreferencedType hasTypeOfExprisFunctionType typeOfCompDef typeOfEnumDef noTypeQualsmergeTypeQualsidentOfVarName TypeMismatch RedefKind ShadowedDefDiffKindRedecl DuplicateDef RedefInfo RedefErrorBadSpecifierErrorInvalidASTError InvalidAST invalidASTbadSpecifierError typeMismatch redefinitionexportTypeDecl exportTypeDef exportTypeexportTypeSpecexportCompTypeDeclexportEnumTypeDeclexportCompTypeexportCompTypeRefexportEnumTypeexportEnumTypeRef prettyAssocsprettyAssocsWithglobalDeclStatsDeclarationStatus KindMismatchShadowedKeepDef RedeclaredNewDeclDefTable identDeclstagDecls labelDefs memberDeclsrefTableTagEntry TagFwdDeclEnumDeclCompDecl IdentEntry identOfTyDecl emptyDefTable globalDefsenterFunctionScopeleaveFunctionScopeenterBlockScopeleaveBlockScopeenterMemberDeclleaveMemberDecldeclStatusDescr defineTypeDefdefineGlobalIdentdefineScopedIdentdefineScopedIdentWhen declareTag defineTag defineLabel lookupIdent lookupTag lookupLabellookupIdentInnerlookupTagInner TravState userStateTrav MonadTravthrowTravErrorcatchTravError recordError getErrors getDefTable withDefTablegenName handleDecl handleTagDecl handleTagDefhandleEnumeratorDef handleTypeDefhandleAsmBlock handleVarDeclhandleParamDecl handleFunDefhandleObjectDefenterPrototypeScopeleavePrototypeScope lookupTypeDef lookupObject createSUERefhandleTravError hadHardErrorsastError throwOnLeftwarnrunTravrunTrav_withExtDeclHandler initTravStatemodifyUserState mapMaybeMmaybeMmapSndM concatMapMTypeSpecAnalysis TSNonBasicTSNumTSBoolTSVoidTSNone NumTypeSpecbasesignSpecsizeMod isComplexSizeMod LongLongModLongModShortMod NoSizeModSignSpecUnsignedSigned NoSignSpec NumBaseType BaseDouble BaseFloatBaseIntBaseChar NoBaseType VarDeclInfo StorageSpec ExternSpec StaticSpec ThreadSpecRegSpecAutoSpec NoStorageSpechasThreadLocalSpecanalyseTypeDecltType tDirectTypetNumType tArraySize tTypeQualscanonicalTypeSpeccanonicalStorageSpec mergeOldStyletAttr mkVarName nameOfDecl getOnlyDeclr analyseAST analyseExt analyseFunDefanalyseExtDecls parseCFileRListReversedempty singletonsnocrappendappendrrappendrrmapreverseviewr readInternal _showWideFlagghc-prim GHC.TypesChar isWideStringisAsciiSourceCharisCChar escapeCCharisSCharsQuotedQuotehead'quadbits7bits14bits21bits28GHC.Num* NameSpaceMapNsMap globalNames hasLocalNames localNames nameSpaceMap defGlobal enterNewScope leaveScopedefLocal lookupName lookupGloballookupInnermostScope nsMapToListGnuCTokGnuCComplexImagGnuCComplexReal GnuCTyCompat GnuCOffsetof GnuCVaArg GnuCExtTok GnuCAttrTokCTokenCTokEofCTokGnuC CTokTyIdent CTokIdentCTokSLitCTokFLitCTokILitCTokCLit CTokWhile CTokVolatileCTokVoid CTokUnsigned CTokUnion CTokThread CTokTypeof CTokTypedef CTokSwitch CTokStruct CTokStatic CTokSizeof CTokSigned CTokShort CTokReturn CTokRestrict CTokRegister CTokLabelCTokLongCTokInt CTokInlineCTokIfCTokGotoCTokFor CTokFloat CTokExternCTokEnumCTokElse CTokDoubleCTokDo CTokDefault CTokComplex CTokContinue CTokConstCTokCharCTokCaseCTokBool CTokBreakCTokAutoCTokAsm CTokAlignof CTokEllipsis CTokRBrace CTokLBrace CTokSemic CTokComma CTokSRAss CTokSLAss CTokBarAss CTokHatAss CTokAmpAss CTokPercAss CTokSlashAss CTokStarAss CTokMinusAss CTokPlusAss CTokAssign CTokColon CTokQuestCTokOrCTokAndCTokBarCTokHat CTokUnequal CTokEqual CTokHighEqCTokHigh CTokLessEqCTokLess CTokShiftR CTokShiftL CTokAmper CTokPercent CTokSlashCTokStar CTokMinusCTokPlusCTokDecCTokInc CTokTilde CTokExclamCTokDot CTokArrow CTokRBracket CTokLBracket CTokRParen CTokLPareninternalErrPrefixindent indentLinesGHC.BaseStringunPPStatecurPoscurInput prevToken namesupplytyidentsscopes ParseResultPFailedPOkreturnPthenPfailP getNewNamesetPosgetPos addTypedef shadowTypedef isTypeIdent enterScopegetInputsetInput getLastToken setLastToken AlexAccPredAlexAccAlexAccSkipPred AlexAccSkip AlexLastAcc AlexLastSkipAlexNone AlexReturn AlexTokenAlexSkip AlexErrorAlexEOFAlexAddrAlexA# AlexInput alex_base alex_table alex_check alex_defltidkwtokignoreAttributetok adjustPosunescapeMultiCharstoken_ token_failtoken token_plusalexInputPrevChar alexGetCharalexMove lexicalError parseErrorlexTokenlexCpreprocessedExtcppFile mkOutputFilegetOutputFileName mkTmpFileParseArgsStategccPathgccParseCPPArgs buildCppArgs HappyAddrHappyA#HappyStk Happy_IntList HappyConsCDeclrRLocatedLHappyAny HappyAbsSynhappyIn7 happyOut7happyIn8 happyOut8happyIn9 happyOut9 happyIn10 happyOut10 happyIn11 happyOut11 happyIn12 happyOut12 happyIn13 happyOut13 happyIn14 happyOut14 happyIn15 happyOut15 happyIn16 happyOut16 happyIn17 happyOut17 happyIn18 happyOut18 happyIn19 happyOut19 happyIn20 happyOut20 happyIn21 happyOut21 happyIn22 happyOut22 happyIn23 happyOut23 happyIn24 happyOut24 happyIn25 happyOut25 happyIn26 happyOut26 happyIn27 happyOut27 happyIn28 happyOut28 happyIn29 happyOut29 happyIn30 happyOut30 happyIn31 happyOut31 happyIn32 happyOut32 happyIn33 happyOut33 happyIn34 happyOut34 happyIn35 happyOut35 happyIn36 happyOut36 happyIn37 happyOut37 happyIn38 happyOut38 happyIn39 happyOut39 happyIn40 happyOut40 happyIn41 happyOut41 happyIn42 happyOut42 happyIn43 happyOut43 happyIn44 happyOut44 happyIn45 happyOut45 happyIn46 happyOut46 happyIn47 happyOut47 happyIn48 happyOut48 happyIn49 happyOut49 happyIn50 happyOut50 happyIn51 happyOut51 happyIn52 happyOut52 happyIn53 happyOut53 happyIn54 happyOut54 happyIn55 happyOut55 happyIn56 happyOut56 happyIn57 happyOut57 happyIn58 happyOut58 happyIn59 happyOut59 happyIn60 happyOut60 happyIn61 happyOut61 happyIn62 happyOut62 happyIn63 happyOut63 happyIn64 happyOut64 happyIn65 happyOut65 happyIn66 happyOut66 happyIn67 happyOut67 happyIn68 happyOut68 happyIn69 happyOut69 happyIn70 happyOut70 happyIn71 happyOut71 happyIn72 happyOut72 happyIn73 happyOut73 happyIn74 happyOut74 happyIn75 happyOut75 happyIn76 happyOut76 happyIn77 happyOut77 happyIn78 happyOut78 happyIn79 happyOut79 happyIn80 happyOut80 happyIn81 happyOut81 happyIn82 happyOut82 happyIn83 happyOut83 happyIn84 happyOut84 happyIn85 happyOut85 happyIn86 happyOut86 happyIn87 happyOut87 happyIn88 happyOut88 happyIn89 happyOut89 happyIn90 happyOut90 happyIn91 happyOut91 happyIn92 happyOut92 happyIn93 happyOut93 happyIn94 happyOut94 happyIn95 happyOut95 happyIn96 happyOut96 happyIn97 happyOut97 happyIn98 happyOut98 happyIn99 happyOut99 happyIn100 happyOut100 happyIn101 happyOut101 happyIn102 happyOut102 happyIn103 happyOut103 happyIn104 happyOut104 happyIn105 happyOut105 happyIn106 happyOut106 happyIn107 happyOut107 happyIn108 happyOut108 happyIn109 happyOut109 happyIn110 happyOut110 happyIn111 happyOut111 happyIn112 happyOut112 happyIn113 happyOut113 happyIn114 happyOut114 happyIn115 happyOut115 happyIn116 happyOut116 happyIn117 happyOut117 happyIn118 happyOut118 happyIn119 happyOut119 happyIn120 happyOut120 happyIn121 happyOut121 happyIn122 happyOut122 happyIn123 happyOut123 happyIn124 happyOut124 happyIn125 happyOut125 happyIn126 happyOut126 happyIn127 happyOut127 happyIn128 happyOut128 happyIn129 happyOut129 happyIn130 happyOut130 happyIn131 happyOut131 happyInTok happyOutTokhappyActOffsetshappyGotoOffsetshappyDefActions happyCheck happyTable happyThen happyReturn happyReturn1 happyError' reverseListunL withNodeInfo reverseDeclr withAttributewithAttributePFappendObjAttrsappendObjAttrsR setAsmNamewithAsmNameAttrsappendDeclrAttrsptrDeclrfunDeclrarrDeclr liftTypeQuals liftCAttrsaddTrailingAttrs doDeclIdentdoFuncParamDeclIdentgetCDeclrIdent happyError happyTcHack happyDoSeq happyDontSeqmaybePifPmlistPidentP attrlistP parenPrecii prettyDeclrbinPrec declOfDef hasLinkagetypeMismatchInfo redefErrLabelredefErrorInforedefErrReason prevDeclMsg exportDeclrexportTypeQualsexportTypeQualsAttrsexportArraySize exportIntTypeexportFloatTypeexportComplexType exportSUERefexportMemberDecl exportVarDeclexportParamDeclexportDeclAttrs exportStorage threadLocal exportAttrsfromDirectTypeni joinComma terminateSemiterminateSemi_ TagEntryKindEnumKindCompKind leaveScope_enterLocalScopeleaveLocalScopecompatIdentEntrytagKindcompatTagEntrydefRedeclStatusdefRedeclStatusLocal symbolTablererrors nameGeneratordoHandleExtDeclunTrav checkRedefredefErrcheckIdentTyRedef checkVarRedef enterDecl isDeclarationcheckCompatibleTypes updDefTable mismatchErrmodifygetsgetput travErrors generateName tParamDeclcomputeParamStorage tMemberDeclsanalyseVarDecl isTypeDefmergeTypeAttributes typeDefRef tCompTypeDecltTag tCompType tEnumTypeDecl tEnumTypeemptyNumTypeSpec splitCDecl emptyDeclranalyseTypeDefcomputeFunDefStorage extFunProto extVarDeclanalyseFunctionBodytStmttExprtInit hasTypeDef