bool get uses diagram line colour const return m busesdiagramlinecolour getusesdiagramlinecolour m_busesdiagramlinecolour bool get uses diagram line width const return m busesdiagramlinewidth getusesdiagramlinewidth m_busesdiagramlinewidth void set uses diagram line colour bool uses diagram line colour m busesdiagramlinecolour uses diagram line colour setusesdiagramlinecolour usesdiagramlinecolour m_busesdiagramlinecolour usesdiagramlinecolour void set uses diagram line width bool uses diagram line width m busesdiagramlinewidth uses diagram line width setusesdiagramlinewidth usesdiagramlinewidth m_busesdiagramlinewidth usesdiagramlinewidth void ast set parent ast parent ifndef cppparser no children if m parent m parent remove child this endif m parent parent ifndef cppparser no children if m parent m parent append child this endif setparent cppparser_no_children m_parent m_parent removechild m_parent cppparser_no_children m_parent m_parent appendchild void ast set start position int line int col m startline line m startcolumn col setstartposition m_startline m_startcolumn void ast get start position int line int col const if line line m startline if col col m startcolumn getstartposition m_startline m_startcolumn void ast set end position int line int col m endline line m endcolumn col setendposition m_endline m_endcolumn void ast get end position int line int col const if line line m endline if col col m endcolumn getendposition m_endline m_endcolumn void ast append child ast child m children append child appendchild m_children void ast remove child ast child m children remove child removechild m_children void groupast add node ast node node if node get return node set parent this m nodelist append node release addnode setparent m_nodelist template argument listast template argument listast m argumentlist set auto delete true templateargumentlistast templateargumentlistast m_argumentlist setautodelete void template argument listast add argument ast node arg if arg get return arg set parent this m argumentlist append arg release templateargumentlistast addargument setparent m_argumentlist class or namespace nameast class or namespace nameast classornamespacenameast classornamespacenameast void class or namespace nameast set name ast node name m name name if m name get m name set parent this classornamespacenameast setname m_name m_name m_name setparent void class or namespace nameast set template argument list template argument listast node template argument list m templateargumentlist template argument list if m templateargumentlist get m templateargumentlist set parent this classornamespacenameast settemplateargumentlist templateargumentlistast templateargumentlist m_templateargumentlist templateargumentlist m_templateargumentlist m_templateargumentlist setparent m global false m classornamespacenamelist set auto delete true m_global m_classornamespacenamelist setautodelete void nameast set global bool b m global b setglobal m_global void nameast add class or namespace name class or namespace nameast node class or namespace name if class or namespace name get return class or namespace name set parent this m classornamespacenamelist append class or namespace name release addclassornamespacename classornamespacenameast classornamespacename classornamespacename classornamespacename setparent m_classornamespacenamelist classornamespacename void nameast set unqualified name class or namespace nameast node unqualified name m unqualifiedname unqualified name if m unqualifiedname get m unqualifiedname set parent this setunqualifiedname classornamespacenameast unqualifiedname m_unqualifiedname unqualifiedname m_unqualifiedname m_unqualifiedname setparent void type parameterast set kind ast node kind m kind kind if m kind get m kind set parent this typeparameterast setkind m_kind m_kind m_kind setparent void type parameterast set template parameter list template parameter listast node template parameter list m templateparameterlist template parameter list if m templateparameterlist get m templateparameterlist set parent this typeparameterast settemplateparameterlist templateparameterlistast templateparameterlist m_templateparameterlist templateparameterlist m_templateparameterlist m_templateparameterlist setparent void type parameterast set name nameast node name m name name if m name get m name set parent this typeparameterast setname m_name m_name m_name setparent void type parameterast set type id ast node type id m typeid type id if m typeid get m typeid set parent this typeparameterast settypeid typeid m_typeid typeid m_typeid m_typeid setparent void access declarationast add access ast node access if access get return access set parent this m accesslist append access release accessdeclarationast addaccess setparent m_accesslist void type specifierast set name nameast node name m name name if m name get m name set parent this typespecifierast setname m_name m_name m_name setparent void type specifierast set cv qualify groupast node cv qualify m cvqualify cv qualify if m cvqualify get m cvqualify set parent this typespecifierast setcvqualify cvqualify m_cvqualify cvqualify m_cvqualify m_cvqualify setparent void type specifierast set cv2 qualify groupast node cv2 qualify m cv2qualify cv2 qualify if m cv2qualify get m cv2qualify set parent this typespecifierast setcv2qualify cv2qualify m_cv2qualify cv2qualify m_cv2qualify m_cv2qualify setparent base specifierast base specifierast basespecifierast basespecifierast void base specifierast set is virtual ast node is virtual m isvirtual is virtual if m isvirtual get m isvirtual set parent this basespecifierast setisvirtual isvirtual m_isvirtual isvirtual m_isvirtual m_isvirtual setparent void base specifierast set access ast node access m access access if m access get m access set parent this basespecifierast setaccess m_access m_access m_access setparent void base specifierast set name nameast node name m name name if m name get m name set parent this basespecifierast setname m_name m_name m_name setparent base clauseast base clauseast m basespecifierlist set auto delete true baseclauseast baseclauseast m_basespecifierlist setautodelete void base clauseast add base specifier base specifierast node base specifier if base specifier get return base specifier set parent this m basespecifierlist append base specifier release baseclauseast addbasespecifier basespecifierast basespecifier basespecifier basespecifier setparent m_basespecifierlist basespecifier void class specifierast set win decl spec groupast node win decl spec m windeclspec win decl spec if m windeclspec get m windeclspec set parent this classspecifierast setwindeclspec windeclspec m_windeclspec windeclspec m_windeclspec m_windeclspec setparent void class specifierast set class key ast node class key m classkey class key if m classkey get m classkey set parent this classspecifierast setclasskey classkey m_classkey classkey m_classkey m_classkey setparent void class specifierast set base clause base clauseast node base clause m baseclause base clause if m baseclause get m baseclause set parent this classspecifierast setbaseclause baseclauseast baseclause m_baseclause baseclause m_baseclause m_baseclause setparent void class specifierast add declaration declarationast node declaration if declaration get return declaration set parent this m declarationlist append declaration release classspecifierast adddeclaration setparent m_declarationlist void enumeratorast set id ast node id m id id if m id get m id set parent this setid m_id m_id m_id setparent void enumeratorast set expr ast node expr m expr expr if m expr get m expr set parent this setexpr m_expr m_expr m_expr setparent enum specifierast enum specifierast m enumeratorlist set auto delete true enumspecifierast enumspecifierast m_enumeratorlist setautodelete void enum specifierast add enumerator enumeratorast node enumerator if enumerator get return enumerator set parent this m enumeratorlist append enumerator release enumspecifierast addenumerator setparent m_enumeratorlist elaborated type specifierast elaborated type specifierast elaboratedtypespecifierast elaboratedtypespecifierast void elaborated type specifierast set kind ast node kind m kind kind if m kind get m kind set parent this elaboratedtypespecifierast setkind m_kind m_kind m_kind setparent void linkage bodyast add declaration declarationast node ast if ast get return ast set parent this m declarationlist append ast release linkagebodyast adddeclaration setparent m_declarationlist linkage specificationast linkage specificationast linkagespecificationast linkagespecificationast void linkage specificationast set extern type ast node extern type m externtype extern type if m externtype get m externtype set parent this linkagespecificationast setexterntype externtype m_externtype externtype m_externtype m_externtype setparent void linkage specificationast set linkage body linkage bodyast node linkage body m linkagebody linkage body if m linkagebody get m linkagebody set parent this linkagespecificationast setlinkagebody linkagebodyast linkagebody m_linkagebody linkagebody m_linkagebody m_linkagebody setparent void linkage specificationast set declaration declarationast node decl m declaration decl if m declaration get m declaration set parent this linkagespecificationast setdeclaration m_declaration m_declaration m_declaration setparent namespaceast namespaceast void namespaceast set namespace name ast node namespace name m namespacename namespace name if m namespacename get m namespacename set parent this setnamespacename namespacename m_namespacename namespacename m_namespacename m_namespacename setparent void namespaceast set linkage body linkage bodyast node linkage body m linkagebody linkage body if m linkagebody get m linkagebody set parent this setlinkagebody linkagebodyast linkagebody m_linkagebody linkagebody m_linkagebody m_linkagebody setparent namespace aliasast namespace aliasast namespacealiasast namespacealiasast void namespace aliasast set namespace name ast node namespace name m namespacename namespace name if m namespacename get m namespacename set parent this namespacealiasast setnamespacename namespacename m_namespacename namespacename m_namespacename m_namespacename setparent void namespace aliasast set alias name nameast node name m aliasname name if m aliasname get m aliasname set parent this namespacealiasast setaliasname m_aliasname m_aliasname m_aliasname setparent usingast usingast void usingast set type name ast node type name m typename type name if m typename get m typename set parent this settypename typename m_typename typename m_typename m_typename setparent void usingast set name nameast node name m name name if m name get m name set parent this setname m_name m_name m_name setparent using directiveast using directiveast usingdirectiveast usingdirectiveast void using directiveast set name nameast node name m name name if m name get m name set parent this usingdirectiveast setname m_name m_name m_name setparent declaratorast declaratorast m ptroplist set auto delete true m arraydimensionlist set auto delete true m_ptroplist setautodelete m_arraydimensionlist setautodelete void declaratorast add ptr op ast node ptr op if ptr op get return ptr op set parent this m ptroplist append ptr op release addptrop ptrop ptrop ptrop setparent m_ptroplist ptrop void declaratorast set sub declarator declaratorast node sub declarator m subdeclarator sub declarator if m subdeclarator get m subdeclarator set parent this setsubdeclarator subdeclarator m_subdeclarator subdeclarator m_subdeclarator m_subdeclarator setparent void declaratorast set declarator id nameast node declarator id m declaratorid declarator id if m declaratorid get m declaratorid set parent this setdeclaratorid declaratorid m_declaratorid declaratorid m_declaratorid m_declaratorid setparent void declaratorast set bitfield initialization ast node bitfield initialization m bitfieldinitialization bitfield initialization if m bitfieldinitialization get m bitfieldinitialization set parent this setbitfieldinitialization bitfieldinitialization m_bitfieldinitialization bitfieldinitialization m_bitfieldinitialization m_bitfieldinitialization setparent void declaratorast add array dimension ast node array dimension if array dimension get return array dimension set parent this m arraydimensionlist append array dimension release addarraydimension arraydimension arraydimension arraydimension setparent m_arraydimensionlist arraydimension void declaratorast set parameter declaration clause parameter declaration clauseast node parameter declaration clause m parameterdeclarationclause parameter declaration clause if m parameterdeclarationclause get m parameterdeclarationclause set parent this setparameterdeclarationclause parameterdeclarationclauseast parameterdeclarationclause m_parameterdeclarationclause parameterdeclarationclause m_parameterdeclarationclause m_parameterdeclarationclause setparent void declaratorast set constant ast node constant m constant constant if m constant get m constant set parent this setconstant m_constant m_constant m_constant setparent void declaratorast set exception specification groupast node exception specification m exceptionspecification exception specification if m exceptionspecification get m exceptionspecification set parent this setexceptionspecification exceptionspecification m_exceptionspecification exceptionspecification m_exceptionspecification m_exceptionspecification setparent parameter declarationast parameter declarationast parameterdeclarationast parameterdeclarationast void parameter declarationast set type spec type specifierast node type spec m typespec type spec if m typespec get m typespec set parent this parameterdeclarationast settypespec typespecifierast typespec m_typespec typespec m_typespec m_typespec setparent void parameter declarationast set declarator declaratorast node declarator m declarator declarator if m declarator get m declarator set parent this parameterdeclarationast setdeclarator m_declarator m_declarator m_declarator setparent void parameter declarationast set expression ast node expression m expression expression if m expression get m expression set parent this parameterdeclarationast setexpression m_expression m_expression m_expression setparent void parameter declaration listast add parameter parameter declarationast node parameter if parameter get return parameter set parent this m parameterlist append parameter release parameterdeclarationlistast addparameter parameterdeclarationast setparent m_parameterlist void parameter declaration clauseast set parameter declaration list parameter declaration listast node parameter declaration list m parameterdeclarationlist parameter declaration list if m parameterdeclarationlist get m parameterdeclarationlist set parent this parameterdeclarationclauseast setparameterdeclarationlist parameterdeclarationlistast parameterdeclarationlist m_parameterdeclarationlist parameterdeclarationlist m_parameterdeclarationlist m_parameterdeclarationlist setparent void parameter declaration clauseast set ellipsis ast node ellipsis m ellipsis ellipsis if m ellipsis get m ellipsis set parent this parameterdeclarationclauseast setellipsis m_ellipsis m_ellipsis m_ellipsis setparent init declaratorast init declaratorast initdeclaratorast initdeclaratorast void init declaratorast set declarator declaratorast node declarator m declarator declarator if m declarator get m declarator set parent this initdeclaratorast setdeclarator m_declarator m_declarator m_declarator setparent void init declaratorast set initializer ast node initializer m initializer initializer if m initializer get m initializer set parent this initdeclaratorast setinitializer m_initializer m_initializer m_initializer setparent init declarator listast init declarator listast m initdeclaratorlist set auto delete true initdeclaratorlistast initdeclaratorlistast m_initdeclaratorlist setautodelete void init declarator listast add init declarator init declaratorast node decl if decl get return decl set parent this m initdeclaratorlist append decl release initdeclaratorlistast addinitdeclarator initdeclaratorast setparent m_initdeclaratorlist typedefast typedefast void typedefast set type spec type specifierast node type spec m typespec type spec if m typespec get m typespec set parent this settypespec typespecifierast typespec m_typespec typespec m_typespec m_typespec setparent void typedefast set init declarator list init declarator listast node init declarator list m initdeclaratorlist init declarator list if m initdeclaratorlist get m initdeclaratorlist set parent this setinitdeclaratorlist initdeclaratorlistast initdeclaratorlist m_initdeclaratorlist initdeclaratorlist m_initdeclaratorlist m_initdeclaratorlist setparent template parameterast template parameterast templateparameterast templateparameterast void template parameterast set type parameter type parameterast node type parameter m typeparameter type parameter if m typeparameter get m typeparameter set parent this templateparameterast settypeparameter typeparameterast typeparameter m_typeparameter typeparameter m_typeparameter m_typeparameter setparent void template parameterast set type value parameter parameter declarationast node type value parameter m typevalueparameter type value parameter if m typevalueparameter get m typevalueparameter set parent this templateparameterast settypevalueparameter parameterdeclarationast typevalueparameter m_typevalueparameter typevalueparameter m_typevalueparameter m_typevalueparameter setparent template parameter listast template parameter listast m templateparameterlist set auto delete true templateparameterlistast templateparameterlistast m_templateparameterlist setautodelete void template parameter listast add template parameter template parameterast node template parameter if template parameter get return template parameter set parent this m templateparameterlist append template parameter release templateparameterlistast addtemplateparameter templateparameterast templateparameter templateparameter templateparameter setparent m_templateparameterlist templateparameter void template declarationast set exported ast node exported m exported exported if m exported get m exported set parent this templatedeclarationast setexported m_exported m_exported m_exported setparent void template declarationast set template parameter list template parameter listast node template parameter list m templateparameterlist template parameter list if m templateparameterlist get m templateparameterlist set parent this templatedeclarationast settemplateparameterlist templateparameterlistast templateparameterlist m_templateparameterlist templateparameterlist m_templateparameterlist m_templateparameterlist setparent void template declarationast set declaration declarationast node declaration m declaration declaration if m declaration get m declaration set parent this templatedeclarationast setdeclaration m_declaration m_declaration m_declaration setparent simple declarationast simple declarationast simpledeclarationast simpledeclarationast void simple declarationast set function specifier groupast node function specifier m functionspecifier function specifier if m functionspecifier get m functionspecifier set parent this simpledeclarationast setfunctionspecifier functionspecifier m_functionspecifier functionspecifier m_functionspecifier m_functionspecifier setparent void simple declarationast set storage specifier groupast node storage specifier m storagespecifier storage specifier if m storagespecifier get m storagespecifier set parent this simpledeclarationast setstoragespecifier storagespecifier m_storagespecifier storagespecifier m_storagespecifier m_storagespecifier setparent void simple declarationast set type spec type specifierast node type spec m typespec type spec if m typespec get m typespec set parent this simpledeclarationast settypespec typespecifierast typespec m_typespec typespec m_typespec m_typespec setparent void simple declarationast set init declarator list init declarator listast node init declarator list m initdeclaratorlist init declarator list if m initdeclaratorlist get m initdeclaratorlist set parent this simpledeclarationast setinitdeclaratorlist initdeclaratorlistast initdeclaratorlist m_initdeclaratorlist initdeclaratorlist m_initdeclaratorlist m_initdeclaratorlist setparent void simple declarationast set win decl spec groupast node win decl spec m windeclspec win decl spec if m windeclspec get m windeclspec set parent this simpledeclarationast setwindeclspec windeclspec m_windeclspec windeclspec m_windeclspec m_windeclspec setparent expression statementast expression statementast expressionstatementast expressionstatementast void expression statementast set expression ast node expression m expression expression if m expression get m expression set parent this expressionstatementast setexpression m_expression m_expression m_expression setparent conditionast conditionast void conditionast set type spec type specifierast node type spec m typespec type spec if m typespec get m typespec set parent this settypespec typespecifierast typespec m_typespec typespec m_typespec m_typespec setparent void conditionast set declarator declaratorast node declarator m declarator declarator if m declarator get m declarator set parent this setdeclarator m_declarator m_declarator m_declarator setparent void conditionast set expression ast node expression m expression expression if m expression get m expression set parent this setexpression m_expression m_expression m_expression setparent if statementast if statementast ifstatementast ifstatementast void if statementast set condition conditionast node condition m condition condition if m condition get m condition set parent this ifstatementast setcondition m_condition m_condition m_condition setparent void if statementast set statement statementast node statement m statement statement if m statement get m statement set parent this ifstatementast setstatement m_statement m_statement m_statement setparent void if statementast set else statement statementast node else statement m elsestatement else statement if m elsestatement get m elsestatement set parent this ifstatementast setelsestatement elsestatement m_elsestatement elsestatement m_elsestatement m_elsestatement setparent while statementast while statementast whilestatementast whilestatementast void while statementast set condition conditionast node condition m condition condition if m condition get m condition set parent this whilestatementast setcondition m_condition m_condition m_condition setparent void while statementast set statement statementast node statement m statement statement if m statement get m statement set parent this whilestatementast setstatement m_statement m_statement m_statement setparent do statementast do statementast dostatementast dostatementast void do statementast set condition conditionast node condition m condition condition if m condition get m condition set parent this dostatementast setcondition m_condition m_condition m_condition setparent void do statementast set statement statementast node statement m statement statement if m statement get m statement set parent this dostatementast setstatement m_statement m_statement m_statement setparent for statementast for statementast forstatementast forstatementast void for statementast set init statement statementast node init statement m initstatement init statement if m initstatement get m initstatement set parent this forstatementast setinitstatement initstatement m_initstatement initstatement m_initstatement m_initstatement setparent void for statementast set condition conditionast node condition m condition condition if m condition get m condition set parent this forstatementast setcondition m_condition m_condition m_condition setparent void for statementast set expression ast node expression m expression expression if m expression get m expression set parent this forstatementast setexpression m_expression m_expression m_expression setparent void for statementast set statement statementast node statement m statement statement if m statement get m statement set parent this forstatementast setstatement m_statement m_statement m_statement setparent switch statementast switch statementast switchstatementast switchstatementast void switch statementast set condition conditionast node condition m condition condition if m condition get m condition set parent this switchstatementast setcondition m_condition m_condition m_condition setparent void switch statementast set statement statementast node statement m statement statement if m statement get m statement set parent this switchstatementast setstatement m_statement m_statement m_statement setparent statement listast statement listast m statementlist set auto delete true statementlistast statementlistast m_statementlist setautodelete void statement listast add statement statementast node statement if statement get return statement set parent this m statementlist append statement release statementlistast addstatement setparent m_statementlist declaration statementast declaration statementast declarationstatementast declarationstatementast void declaration statementast set declaration declarationast node declaration m declaration declaration if m declaration get m declaration set parent this declarationstatementast setdeclaration m_declaration m_declaration m_declaration setparent function definitionast function definitionast functiondefinitionast functiondefinitionast void function definitionast set function specifier groupast node function specifier m functionspecifier function specifier if m functionspecifier get m functionspecifier set parent this functiondefinitionast setfunctionspecifier functionspecifier m_functionspecifier functionspecifier m_functionspecifier m_functionspecifier setparent void function definitionast set storage specifier groupast node storage specifier m storagespecifier storage specifier if m storagespecifier get m storagespecifier set parent this functiondefinitionast setstoragespecifier storagespecifier m_storagespecifier storagespecifier m_storagespecifier m_storagespecifier setparent void function definitionast set type spec type specifierast node type spec m typespec type spec if m typespec get m typespec set parent this functiondefinitionast settypespec typespecifierast typespec m_typespec typespec m_typespec m_typespec setparent void function definitionast set init declarator init declaratorast node init declarator m initdeclarator init declarator if m initdeclarator get m initdeclarator set parent this functiondefinitionast setinitdeclarator initdeclaratorast initdeclarator m_initdeclarator initdeclarator m_initdeclarator m_initdeclarator setparent void function definitionast set function body statement listast node function body m functionbody function body if m functionbody get m functionbody set parent this functiondefinitionast setfunctionbody statementlistast functionbody m_functionbody functionbody m_functionbody m_functionbody setparent void function definitionast set win decl spec groupast node win decl spec m windeclspec win decl spec if m windeclspec get m windeclspec set parent this functiondefinitionast setwindeclspec windeclspec m_windeclspec windeclspec m_windeclspec m_windeclspec setparent translation unitast translation unitast kd debug 9007 translation unitast translation unitast endl m declarationlist set auto delete true translationunitast translationunitast kddebug translationunitast translationunitast m_declarationlist setautodelete void translation unitast add declaration declarationast node ast if ast get return ast set parent this m declarationlist append ast release translationunitast adddeclaration setparent m_declarationlist m reportmessages false m tokens set auto delete true reset d begin scope m_reportmessages m_tokens setautodelete beginscope lexer lexer d end scope delete d endscope inline bool lexer record comments const return m recordcomments recordcomments m_recordcomments inline void lexer set record comments bool record m recordcomments record setrecordcomments m_recordcomments inline bool lexer record white spaces const return m recordwhitespaces recordwhitespaces m_recordwhitespaces inline void lexer set record white spaces bool record m recordwhitespaces record setrecordwhitespaces m_recordwhitespaces inline bool lexer report warnings const return m reportwarnings reportwarnings m_reportwarnings inline void lexer set report warnings bool enable m reportwarnings enable setreportwarnings m_reportwarnings inline bool lexer report messages const return m reportmessages reportmessages m_reportmessages inline void lexer set report messages bool enable m reportmessages enable setreportmessages m_reportmessages inline bool lexer skip words enabled const return m skipwordsenabled skipwordsenabled m_skipwordsenabled inline void lexer set skip words enabled bool enabled m skipwordsenabled enabled setskipwordsenabled m_skipwordsenabled inline bool lexer preprocessor enabled const return m preprocessorenabled preprocessorenabled m_preprocessorenabled inline void lexer set preprocessor enabled bool enabled m preprocessorenabled enabled setpreprocessorenabled m_preprocessorenabled void lexer reset skip words m words clear resetskipwords m_words inline int lexer index const return m index m_index inline void lexer set index int index m index index setindex m_index void lexer reset m index 0 m size 0 m tokens clear m source q string null m ptr 0 m endptr 0 m startline false m iflevel 0 m skipping resize 200 m skipping fill 0 m truetest resize 200 m truetest fill 0 m currentline 0 m currentcolumn 0 m_index m_size m_tokens m_source qstring m_ptr m_endptr m_startline m_iflevel m_skipping m_skipping m_truetest m_truetest m_currentline m_currentcolumn inline const token lexer token at int n const return m tokens qmin n m size 1 tokenat m_tokens m_size inline const token lexer next token if m index m size return m tokens m index return m tokens m index nexttoken m_index m_size m_tokens m_index m_tokens m_index inline const token lexer look ahead int n const return m tokens qmin m index n m size 1 lookahead m_tokens m_index m_size int lexer to int const token token q string s token text if token type token number literal hex literal if s 0 0 s 1 x s 1 x return s mid 2 to int 0 16 q string n int i 0 while i int s length s i is digit n s i respect more prefixes and suffixes return n to int else if token type token char literal int i s 0 l 2 1 wide char if s i escaped char int c s i 1 unicode switch c case 0 return 0 case n return n more default return c else return s i unicode else return 0 toint qstring token_number_literal toint qstring isdigit toint token_char_literal inline int lexer token position const token token const return token position tokenposition void lexer get token position const token token int line int col token get start position line col gettokenposition getstartposition inline int lexer current position const return m ptr currentposition m_ptr void lexer tokenize m startline true m size 0 for token tk next token tk if tk type 1 add token tk if current char is null break token tk create token token eof current position 0 tk set start position m currentline m currentcolumn tk set end position m currentline m currentcolumn add token tk m_startline m_size nexttoken add_token currentchar isnull create_token token_eof currentposition setstartposition m_currentline m_currentcolumn setendposition m_currentline m_currentcolumn add_token void lexer next token token tk bool stop on newline int op 0 if m size int m tokens size m tokens resize m tokens size 5000 read white spaces stop on newline int start line m currentline int start column m currentcolumn q char ch current char q char ch1 peek char if ch is null ch is space skip else if m startline ch next char skip read white spaces false skip white spaces m startline false int start current position read identifier read the directive q string directive m source mid start current position start handle directive directive else if m startline m skipping m iflevel skip line and continue m startline false int ppe preprocessor enabled set preprocessor enabled false while current char current char n token tok next token tok true m startline true set preprocessor enabled ppe return else if ch ch1 int start current position read line comment if record comments tk create token token comment start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else if ch ch1 int start current position next char 2 read multi line comment if record comments tk create token token comment start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else if ch ch l ch1 int start current position read char literal tk create token token char literal start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else if ch int start current position read string literal tk create token token string literal start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else if ch is letter ch int start current position read identifier q string ide m source mid start current position start int k lookup find keyword ide if m preprocessorenabled m driver has macro ide k 1 m driver macro ide body is empty bool preproc m preprocessorenabled m preprocessorenabled false d begin scope int sv line current line int sv column current column macro m m driver macro ide macro m m driver macro ide m driver remove macro m name q string ellipsis arg if m has arguments int end ide current position read white spaces if current char next char int arg idx 0 int arg count m argument list size while current char arg idx arg count read white spaces q string arg name m argument list arg idx bool ellipsis arg name q string arg read argument if ellipsis d bind arg name arg else ellipsis arg arg if current char next char if ellipsis arg idx else ellipsis arg else if current char break if current char valid macro next char else tk create token token identifier start end ide start tk set start position sv line sv column tk set end position sv line sv column end ide start m startline false d end scope ops m preprocessorenabled preproc return int args end at line current line int args end at column current column if defined kdevelop bgparser qthread yield endif m source insert current position m body tokenize the macro body q string text to insert m endptr current position m body length while current char read white spaces token tok next token tok bool stringify m inpreproc tok bool merge m inpreproc tok token concat if stringify merge next token tok if tok token eof break q string tok text tok text q string str tok token identifier d has bind tok text d apply tok text tok text if str ide problem p i18n unsafe use of macro 1 arg ide m currentline m currentcolumn m driver add problem m driver current file name p m driver remove macro ide str q string null if stringify text to insert append q string from latin1 str q string from latin1 else if merge text to insert truncate text to insert length 1 text to insert append str else if tok token ellipsis d has bind text to insert append ellipsis arg else text to insert append str q string from latin1 if defined kdevelop bgparser qthread yield endif m source insert current position text to insert d end scope m preprocessorenabled preproc m driver add macro m m currentline args end at line m currentcolumn args end at column m endptr m source length else if k 1 tk create token k start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else if m skipwordsenabled q map q string q pair skip type q string iterator pos m words find ide if pos m words end if pos first skip word and arguments read white spaces if current char skip if pos second is empty if defined kdevelop bgparser qthread yield endif m source insert current position q string pos second q string m endptr m source length else if qt rx exact match ide ide ends with export ide starts with q export ide q export interface ide starts with qm export ide starts with qm template read white spaces if current char skip else if ide starts with k typelist ide starts with typelist tk create token token identifier start current position start tk set start position start line start column tk set end position m currentline m currentcolumn read white spaces if current char skip else tk create token token identifier start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else tk create token token identifier start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else if ch is number int start current position read number literal tk create token token number literal start current position start tk set start position start line start column tk set end position m currentline m currentcolumn else if 1 op find operator3 tk create token op current position 3 next char 3 tk set start position start line start column tk set end position m currentline m currentcolumn else if 1 op find operator2 tk create token op current position 2 next char 2 tk set start position start line start column tk set end position m currentline m currentcolumn else tk create token ch unicode current position 1 next char tk set start position start line start column tk set end position m currentline m currentcolumn m startline false nexttoken stoponnewline m_size m_tokens m_tokens m_tokens readwhitespaces stoponnewline startline m_currentline startcolumn m_currentcolumn qchar currentchar qchar peekchar isnull isspace m_startline nextchar readwhitespaces m_startline currentposition readidentifier qstring m_source currentposition handledirective m_startline m_skipping m_iflevel m_startline preprocessorenabled setpreprocessorenabled currentchar currentchar nexttoken m_startline setpreprocessorenabled currentposition readlinecomment recordcomments create_token token_comment currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn currentposition nextchar readmultilinecomment recordcomments create_token token_comment currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn currentposition readcharliteral create_token token_char_literal currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn currentposition readstringliteral create_token token_string_literal currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn isletter _ currentposition readidentifier qstring m_source currentposition m_preprocessorenabled m_driver hasmacro m_driver isempty m_preprocessorenabled m_preprocessorenabled beginscope svline currentline svcolumn currentcolumn m_driver m_driver m_driver removemacro qstring ellipsisarg hasarguments endide currentposition readwhitespaces currentchar nextchar argidx argcount argumentlist currentchar argidx argcount readwhitespaces qstring argname argumentlist argidx argname qstring readargument argname ellipsisarg currentchar nextchar argidx ellipsisarg currentchar currentchar nextchar create_token token_identifier endide setstartposition svline svcolumn setendposition svline svcolumn endide m_startline endscope m_preprocessorenabled argsendatline currentline argsendatcolumn currentcolumn kdevelop_bgparser qthread_yield m_source currentposition qstring texttoinsert m_endptr currentposition currentchar readwhitespaces nexttoken m_inpreproc m_inpreproc token_concat nexttoken token_eof qstring toktext qstring token_identifier hasbind toktext toktext toktext m_currentline m_currentcolumn m_driver addproblem m_driver currentfilename m_driver removemacro qstring texttoinsert qstring fromlatin1 qstring fromlatin1 texttoinsert texttoinsert texttoinsert token_ellipsis hasbind texttoinsert ellipsisarg texttoinsert qstring fromlatin1 kdevelop_bgparser qthread_yield m_source currentposition texttoinsert endscope m_preprocessorenabled m_driver addmacro m_currentline argsendatline m_currentcolumn argsendatcolumn m_endptr m_source create_token currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn m_skipwordsenabled qmap qstring qpair skiptype qstring m_words m_words skipwordandarguments readwhitespaces currentchar isempty kdevelop_bgparser qthread_yield m_source currentposition qstring qstring m_endptr m_source qt_rx exactmatch endswith startswith q_export q_export_interface startswith qm_export startswith qm_template readwhitespaces currentchar startswith k_typelist_ startswith typelist_ create_token token_identifier currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn readwhitespaces currentchar create_token token_identifier currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn create_token token_identifier currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn isnumber currentposition readnumberliteral create_token token_number_literal currentposition setstartposition startline startcolumn setendposition m_currentline m_currentcolumn findoperator3 create_token currentposition nextchar setstartposition startline startcolumn setendposition m_currentline m_currentcolumn findoperator2 create_token currentposition nextchar setstartposition startline startcolumn setendposition m_currentline m_currentcolumn create_token currentposition nextchar setstartposition startline startcolumn setendposition m_currentline m_currentcolumn m_startline inline void lexer next char if m source m ptr n m currentline m currentcolumn 0 m startline true else m currentcolumn nextchar m_source m_ptr m_currentline m_currentcolumn m_startline m_currentcolumn inline void lexer next char int n m currentcolumn n m ptr n nextchar m_currentcolumn m_ptr void lexer skip int l int r int sv current line m currentline int sv current column m currentcolumn int count 0 while eof token tk next token tk if int tk l count else if int tk r count if count 0 break m currentline sv current line m currentcolumn sv current column svcurrentline m_currentline svcurrentcolumn m_currentcolumn nexttoken m_currentline svcurrentline m_currentcolumn svcurrentcolumn inline void lexer read identifier while current char is letter or number current char next char readidentifier currentchar isletterornumber currentchar _ nextchar inline void lexer read white spaces bool skip new line while current char is null q char ch current char if ch n skip new line break else if ch is space next char else if m inpreproc current char next char read white spaces true else break readwhitespaces skipnewline currentchar isnull qchar currentchar skipnewline isspace nextchar m_inpreproc currentchar nextchar readwhitespaces inline void lexer read line comment while current char is null current char n if m reportmessages current char m source mid current position 1 4 lower todo next char 5 q string msg int line m currentline int col m currentcolumn while current char if current char peek char break else if current char n break msg current char next char m driver add problem m driver current file name problem msg line col problem level todo else if m reportmessages m source mid current position 5 lower fixme next char 5 q string msg int line m currentline int col m currentcolumn while current char if current char peek char break else if current char n break msg current char next char m driver add problem m driver current file name problem msg line col problem level fixme else next char readlinecomment currentchar isnull currentchar m_reportmessages currentchar m_source currentposition nextchar qstring m_currentline m_currentcolumn currentchar currentchar peekchar currentchar currentchar nextchar m_driver addproblem m_driver currentfilename level_todo m_reportmessages m_source currentposition nextchar qstring m_currentline m_currentcolumn currentchar currentchar peekchar currentchar currentchar nextchar m_driver addproblem m_driver currentfilename level_fixme nextchar inline void lexer read multi line comment while current char is null if current char peek char next char 2 return else if m reportmessages current char m source mid current position 1 4 lower todo next char 5 q string msg int line m currentline int col m currentcolumn while current char if current char peek char break else if current char n break msg current char next char m driver add problem m driver current file name problem msg line col problem level todo else if m reportmessages m source mid current position 5 lower fixme next char 5 q string msg int line m currentline int col m currentcolumn while current char if current char peek char break else if current char n break msg current char next char m driver add problem m driver current file name problem msg line col problem level fixme else next char readmultilinecomment currentchar isnull currentchar peekchar nextchar m_reportmessages currentchar m_source currentposition nextchar qstring m_currentline m_currentcolumn currentchar currentchar peekchar currentchar currentchar nextchar m_driver addproblem m_driver currentfilename level_todo m_reportmessages m_source currentposition nextchar qstring m_currentline m_currentcolumn currentchar currentchar peekchar currentchar currentchar nextchar m_driver addproblem m_driver currentfilename level_fixme nextchar inline void lexer read char literal if current char next char skip else if current char l peek char next char 2 slip l else return while current char is null int len m endptr current position if len 2 current char peek char next char 2 else if len 2 current char peek char next char 2 else if current char next char break else next char readcharliteral currentchar nextchar currentchar peekchar nextchar currentchar isnull m_endptr currentposition currentchar peekchar nextchar currentchar peekchar nextchar currentchar nextchar nextchar inline void lexer read string literal if current char return next char skip while current char is null int len m endptr m ptr if len 2 current char peek char next char 2 else if len 2 current char peek char next char 2 else if current char next char break else next char readstringliteral currentchar nextchar currentchar isnull m_endptr m_ptr currentchar peekchar nextchar currentchar peekchar nextchar currentchar nextchar nextchar inline void lexer read number literal while current char is letter or number current char next char readnumberliteral currentchar isletterornumber currentchar nextchar inline int lexer find operator3 const int n int m endptr m ptr if n 3 q char ch current char ch1 peek char ch2 peek char 2 if ch ch1 ch2 return token assign else if ch ch1 ch2 return token assign else if ch ch1 ch2 return token ptrmem else if ch ch1 ch2 return token ellipsis return 1 findoperator3 m_endptr m_ptr qchar currentchar peekchar peekchar token_assign token_assign token_ptrmem token_ellipsis inline int lexer find operator2 const int n int m endptr m ptr if n 2 q char ch current char ch1 peek char if ch ch1 return token scope else if ch ch1 return token ptrmem else if ch ch1 return token assign else if ch ch1 return token assign else if ch ch1 return token assign else if ch ch1 return token assign else if ch ch1 return token assign else if ch ch1 return token assign else if ch ch1 return token assign else if ch ch1 return token assign else if ch ch1 return token shift else if ch ch1 return token shift else if ch ch1 return token eq else if ch ch1 return token eq else if ch ch1 return token leq else if ch ch1 return token geq else if ch ch1 return token and else if ch ch1 return token or else if ch ch1 return token incr else if ch ch1 return token decr else if ch ch1 return token arrow else if ch ch1 return token concat return 1 findoperator2 m_endptr m_ptr qchar currentchar peekchar token_scope token_ptrmem token_assign token_assign token_assign token_assign token_assign token_assign token_assign token_assign token_shift token_shift token_eq token_eq token_leq token_geq token_and token_or token_incr token_decr token_arrow token_concat inline bool lexer eof const return m ptr m endptr m_ptr m_endptr int lexer test if level int rtn m skipping m iflevel m skipping m iflevel m skipping m iflevel 1 return rtn testiflevel m_skipping m_iflevel m_skipping m_iflevel m_skipping m_iflevel int lexer macro defined read white spaces false int start word current position read identifier q string word m source mid start word current position start word bool r m driver has macro word return r macrodefined readwhitespaces startword currentposition readidentifier qstring m_source startword currentposition startword m_driver hasmacro int lexer macro primary read white spaces false int result 0 switch current char unicode case next char result macro expression if current char todo report error return 0 next char return result case case case case q char tk current char next char int result macro primary if tk return result else if tk return result else if tk return result break default token tk next token tk false switch tk type case token identifier if tk text defined return macro primary todo implement return m driver has macro tk text case token number literal case token char literal return to int tk default break end switch end default end switch return 0 macroprimary readwhitespaces currentchar nextchar macroexpression currentchar nextchar qchar currentchar nextchar macroprimary nexttoken token_identifier macroprimary m_driver hasmacro token_number_literal token_char_literal toint int lexer macro multiply divide int result macro primary int iresult op for read white spaces false if current char op 0 else if current char peek char peek char op 1 else if current char op 2 else break next char iresult macro primary result op 0 result iresult op 1 iresult 0 0 result iresult iresult 0 0 result iresult return result macromultiplydivide macroprimary readwhitespaces currentchar currentchar peekchar peekchar currentchar nextchar macroprimary int lexer macro add subtract int result macro multiply divide int iresult ad read white spaces false while current char current char ad current char next char iresult macro multiply divide result ad result iresult result iresult return result macroaddsubtract macromultiplydivide readwhitespaces currentchar currentchar currentchar nextchar macromultiplydivide int lexer macro relational int result macro add subtract int iresult read white spaces false while current char current char int lt current char next char if current char next char iresult macro add subtract result lt result iresult result iresult else iresult macro add subtract result lt result iresult result iresult return result macrorelational macroaddsubtract readwhitespaces currentchar currentchar currentchar nextchar currentchar nextchar macroaddsubtract macroaddsubtract int lexer macro equality int result macro relational int iresult eq read white spaces false while current char current char peek char eq current char next char 2 iresult macro relational result eq result iresult result iresult return result macroequality macrorelational readwhitespaces currentchar currentchar peekchar currentchar nextchar macrorelational int lexer macro bool and int result macro equality read white spaces false while current char peek char next char result macro equality return result macrobooland macroequality readwhitespaces currentchar peekchar nextchar macroequality int lexer macro bool xor int result macro bool and read white spaces false while current char next char result macro bool and return result macroboolxor macrobooland readwhitespaces currentchar nextchar macrobooland int lexer macro bool or int result macro bool xor read white spaces false while current char peek char next char result macro bool xor return result macroboolor macroboolxor readwhitespaces currentchar peekchar nextchar macroboolxor int lexer macro logical and int result macro bool or read white spaces false while current char peek char next char 2 int start current position result macro bool or result q string s m source mid start current position start return result macrologicaland macroboolor readwhitespaces currentchar peekchar nextchar currentposition macroboolor qstring m_source currentposition int lexer macro logical or int result macro logical and read white spaces false while current char peek char next char 2 result macro logical and result return result macrologicalor macrologicaland readwhitespaces currentchar peekchar nextchar macrologicaland int lexer macro expression read white spaces false return macro logical or macroexpression readwhitespaces macrologicalor void lexer process define macro m m set file name m driver current file name read white spaces false int start macro name current position read identifier q string macro name m source mid start macro name int current position start macro name m driver remove macro macro name m set name macro name if current char m set has arguments true next char read white spaces false while current char current char read white spaces false int start arg current position if current char peek char peek char 2 next char 3 else read identifier q string arg m source mid start arg int current position start arg m add argument macro argument arg read white spaces false if current char break next char skip if current char next char skip set preprocessor enabled true q string body while current char current char n if current char is space read white spaces false body else token tk next token tk true if tk type 1 q string s tk text body s m set body body m driver add macro m processdefine setfilename m_driver currentfilename readwhitespaces startmacroname currentposition readidentifier qstring macroname m_source startmacroname currentposition startmacroname m_driver removemacro macroname setname macroname currentchar sethasarguments nextchar readwhitespaces currentchar currentchar readwhitespaces startarg currentposition currentchar peekchar peekchar nextchar readidentifier qstring m_source startarg currentposition startarg addargument readwhitespaces currentchar nextchar currentchar nextchar setpreprocessorenabled qstring currentchar currentchar currentchar isspace readwhitespaces nexttoken qstring setbody m_driver addmacro void lexer process else if m iflevel 0 todo report error return if m iflevel 0 m skipping m iflevel 1 m skipping m iflevel m skipping m iflevel 1 else m skipping m iflevel m truetest m iflevel processelse m_iflevel m_iflevel m_skipping m_iflevel m_skipping m_iflevel m_skipping m_iflevel m_skipping m_iflevel m_truetest m_iflevel void lexer process elif if m iflevel 0 todo report error return if m truetest m iflevel todo implement the correct semantic for elif bool in skip m iflevel 0 m skipping m iflevel 1 m truetest m iflevel macro expression 0 m skipping m iflevel in skip in skip m truetest m iflevel else m skipping m iflevel true processelif m_iflevel m_truetest m_iflevel inskip m_iflevel m_skipping m_iflevel m_truetest m_iflevel macroexpression m_skipping m_iflevel inskip inskip m_truetest m_iflevel m_skipping m_iflevel void lexer process endif if m iflevel 0 todo report error return m skipping m iflevel 0 m truetest m iflevel 0 processendif m_iflevel m_skipping m_iflevel m_truetest m_iflevel void lexer process if bool in skip m skipping m iflevel if test if level if 0 int n if n test defined 0 int isdef macro defined m truetest m iflevel n 1 isdef n 1 isdef else endif m truetest m iflevel macro expression 0 m skipping m iflevel in skip in skip m truetest m iflevel processif inskip m_skipping m_iflevel testiflevel testdefined macrodefined m_truetest m_iflevel m_truetest m_iflevel macroexpression m_skipping m_iflevel inskip inskip m_truetest m_iflevel void lexer process ifdef bool in skip m skipping m iflevel if test if level m truetest m iflevel macro defined m skipping m iflevel in skip in skip m truetest m iflevel processifdef inskip m_skipping m_iflevel testiflevel m_truetest m_iflevel macrodefined m_skipping m_iflevel inskip inskip m_truetest m_iflevel void lexer process ifndef bool in skip m skipping m iflevel if test if level m truetest m iflevel macro defined m skipping m iflevel in skip in skip m truetest m iflevel processifndef inskip m_skipping m_iflevel testiflevel m_truetest m_iflevel macrodefined m_skipping m_iflevel inskip inskip m_truetest m_iflevel void lexer process include if m skipping m iflevel return read white spaces false if current char q char ch current char if ch ch next char q char ch2 ch q char q char q char int start word current position while current char current char ch2 next char if current char q string word m source mid start word int current position start word m driver add dependence m driver current file name dependence word ch dep local dep global next char processinclude m_skipping m_iflevel readwhitespaces currentchar qchar currentchar nextchar qchar qchar qchar qchar startword currentposition currentchar currentchar nextchar currentchar qstring m_source startword currentposition startword m_driver adddependence m_driver currentfilename dep_local dep_global nextchar void lexer process undef read white spaces int start word current position read identifier q string word m source mid start word current position start word m driver remove macro word processundef readwhitespaces startword currentposition readidentifier qstring m_source startword currentposition startword m_driver removemacro bool operator const problem p const return m text p m text m line p m line m column p m column m level p m level m_text m_text m_line m_line m_column m_column m_level m_level bool operator const macro source const return m name source m name m filename source m filename m body source m body m hasarguments source m hasarguments m argumentlist source m argumentlist m_name m_name m_filename m_filename m_body m_body m_hasarguments m_hasarguments m_argumentlist m_argumentlist depresolv false lexer 0 m sourceprovider new default source provider m_sourceprovider defaultsourceprovider driver driver reset delete m sourceprovider m_sourceprovider source provider driver source provider return m sourceprovider sourceprovider sourceprovider m_sourceprovider void driver set source provider source provider source provider if m sourceprovider delete m sourceprovider m sourceprovider source provider setsourceprovider sourceprovider sourceprovider m_sourceprovider m_sourceprovider m_sourceprovider sourceprovider void driver reset m dependences clear m macros clear m problems clear m includepaths clear while m parsedunits size translation unitast unit m parsedunits begin m parsedunits remove m parsedunits begin delete unit m_dependences m_macros m_problems m_includepaths m_parsedunits translationunitast m_parsedunits m_parsedunits m_parsedunits void driver add macro const macro macro m macros insert macro name macro addmacro m_macros void driver set resolve dependences enabled bool enabled depresolv enabled if depresolv setup pre processor setresolvedependencesenabled setuppreprocessor void driver setup lexer lexer lexer stl lexer add skip word stl begin namespace lexer add skip word stl end namespace lexer add skip word stl begin relops namespace lexer add skip word stl end relops namespace lexer add skip word stl template null lexer add skip word stl try lexer add skip word stl unwind lexer add skip word stl nothrow lexer add skip word stl null tmpl args lexer add skip word stl unwind skip word and arguments lexer add skip word gc const lexer add skip word hash alloc init skip word and arguments lexer add skip word stl default allocator skip word and arguments t lexer add skip word stl mutex initializer lexer add skip word stl null tmpl args antlr lexer add skip word antlr begin namespace skip word and arguments lexer add skip word antlr use namespace skip word and arguments lexer add skip word antlr using namespace skip word and arguments lexer add skip word antlr end namespace lexer add skip word antlr c using skip word and arguments lexer add skip word antlr api gnu lexer add skip word extension skip word and arguments lexer add skip word attribute skip word and arguments lexer add skip word begin decls lexer add skip word end decls lexer add skip word throw lexer add skip word restrict lexer add skip word restrict lexer add skip word attribute pure lexer add skip word attribute malloc lexer add skip word attribute format strfmon lexer add skip word asm skip word and arguments lexer add skip word devinit lexer add skip word devinit lexer add skip word init lexer add skip word init lexer add skip word signed lexer add skip word signed lexer add skip word unsigned lexer add skip word unsigned lexer add skip word asmlinkage lexer add skip word cacheline aligned lexer add skip word glibcpp class requires skip word and arguments lexer add skip word glibcpp class2 requires skip word and arguments lexer add skip word glibcpp class4 requires skip word and arguments lexer add skip word glibcpp function requires skip word and arguments lexer add skip word restrict lexer add skip word begin namespace std lexer add skip word end namespace std lexer add skip word begin namespace c99 lexer add skip word end namespace c99 lexer add skip word using namespace std skip word and arguments kde lexer add skip word k sycocatype skip word and arguments lexer add skip word export dockclass lexer add skip word k export component factory skip word and arguments lexer add skip word k sycocafactory skip word and arguments lexer add skip word kde deprecated qt lexer add skip word q override skip word and arguments lexer add skip word q enums skip word and arguments lexer add skip word q property skip word and arguments lexer add skip word q classinfo skip word and arguments lexer add skip word q sets skip word and arguments lexer add skip word q unused skip word and arguments lexer add skip word q create instance skip word and arguments lexer add skip word q dummy comparison operator skip word and arguments lexer add skip word activate signal with param skip word and arguments lexer add skip word q inline templates lexer add skip word q template extern lexer add skip word q typename lexer add skip word q refcount lexer add skip word q explicit lexer add skip word qmac pascal lexer add skip word qt static const lexer add skip word qt static const impl lexer add skip word qt win painter members lexer add skip word qt nc msgbox lexer add skip word q variant as skip word and arguments lexer add skip word callback call type flex lexer add skip word yyconst lexer add skip word yy rule setup lexer add skip word yy break lexer add skip word yy restore yy more offset gtk lexer add skip word g begin decls lexer add skip word g end decls lexer add skip word g gnuc const lexer add skip word g const return lexer add skip word gtkmain c var lexer add skip word gtkvar lexer add skip word gdkvar lexer add skip word g gnuc printf skip word and arguments windows lexer add skip word winapi lexer add skip word stdcall lexer add skip word cdecl lexer add skip word cdecl lexer add skip word callback gcc extensions add macro macro asm asm add macro macro inline inline add macro macro inline inline add macro macro const const add macro macro const const add macro macro volatile volatile add macro macro complex setuplexer addskipword __stl_begin_namespace addskipword __stl_end_namespace addskipword __stl_begin_relops_namespace addskipword __stl_end_relops_namespace addskipword __stl_template_null addskipword __stl_try addskipword __stl_unwind addskipword __stl_nothrow addskipword __stl_null_tmpl_args addskipword __stl_unwind skipwordandarguments addskipword __gc_const addskipword __hash_alloc_init skipwordandarguments addskipword __stl_default_allocator skipwordandarguments addskipword __stl_mutex_initializer addskipword __stl_null_tmpl_args addskipword antlr_begin_namespace skipwordandarguments addskipword antlr_use_namespace skipwordandarguments addskipword antlr_using_namespace skipwordandarguments addskipword antlr_end_namespace addskipword antlr_c_using skipwordandarguments addskipword antlr_api addskipword __extension__ skipwordandarguments addskipword __attribute__ skipwordandarguments addskipword __begin_decls addskipword __end_decls addskipword __throw addskipword __restrict addskipword __restrict__ addskipword __attribute_pure__ addskipword __attribute_malloc__ addskipword __attribute_format_strfmon__ addskipword __asm__ skipwordandarguments addskipword __devinit addskipword __devinit__ addskipword __init addskipword __init__ addskipword __signed addskipword __signed__ addskipword __unsigned addskipword __unsigned__ addskipword addskipword ____cacheline_aligned addskipword __glibcpp_class_requires skipwordandarguments addskipword __glibcpp_class2_requires skipwordandarguments addskipword __glibcpp_class4_requires skipwordandarguments addskipword __glibcpp_function_requires skipwordandarguments addskipword addskipword __begin_namespace_std addskipword __end_namespace_std addskipword __begin_namespace_c99 addskipword __end_namespace_c99 addskipword __using_namespace_std skipwordandarguments addskipword k_sycocatype skipwordandarguments addskipword export_dockclass addskipword k_export_component_factory skipwordandarguments addskipword k_sycocafactory skipwordandarguments addskipword kde_deprecated addskipword q_override skipwordandarguments addskipword q_enums skipwordandarguments addskipword q_property skipwordandarguments addskipword q_classinfo skipwordandarguments addskipword q_sets skipwordandarguments addskipword q_unused skipwordandarguments addskipword q_create_instance skipwordandarguments addskipword q_dummy_comparison_operator skipwordandarguments addskipword activate_signal_with_param skipwordandarguments addskipword q_inline_templates addskipword q_template_extern addskipword q_typename addskipword q_refcount addskipword q_explicit addskipword qmac_pascal addskipword qt_static_const addskipword qt_static_const_impl addskipword qt_win_painter_members addskipword qt_nc_msgbox addskipword q_variant_as skipwordandarguments addskipword callback_call_type addskipword addskipword yy_rule_setup addskipword yy_break addskipword yy_restore_yy_more_offset addskipword g_begin_decls addskipword g_end_decls addskipword g_gnuc_const addskipword g_const_return addskipword gtkmain_c_var addskipword addskipword addskipword g_gnuc_printf skipwordandarguments addskipword addskipword __stdcall addskipword __cdecl addskipword _cdecl addskipword addmacro __asm__ addmacro __inline addmacro __inline__ addmacro __const addmacro __const__ addmacro __volatile__ addmacro __complex__ void driver setup parser parser parser q unused parser setupparser q_unused void driver setup pre processor setuppreprocessor m length 0 m text 0 m_length m_text m endcolumn source m endcolumn m text source m text m_endcolumn m_endcolumn m_text m_text inline token token operator const token source m type source m type m position source m position m length source m length m startline source m startline m startcolumn source m startcolumn m endline source m endline m endcolumn source m endcolumn m text source m text return this m_type m_type m_position m_position m_length m_length m_startline m_startline m_startcolumn m_startcolumn m_endline m_endline m_endcolumn m_endcolumn m_text m_text inline bool token operator const token token const return m type token m type m position token m position m length token m length m startline token m startline m startcolumn token m startcolumn m endline token m endline m endcolumn token m endcolumn m text token m text m_type m_type m_position m_position m_length m_length m_startline m_startline m_startcolumn m_startcolumn m_endline m_endline m_endcolumn m_endcolumn m_text m_text inline token operator int const return m type m_type inline bool token is null const return m type token eof m length 0 isnull m_type token_eof m_length inline int token type const return m type m_type inline void token set type int type m type type settype m_type inline void token get start position int line int column const if line line m startline if column column m startcolumn getstartposition m_startline m_startcolumn inline void token set start position int line int column m startline line m startcolumn column setstartposition m_startline m_startcolumn inline void token get end position int line int column const if line line m endline if column column m endcolumn getendposition m_endline m_endcolumn inline void token set end position int line int column m endline line m endcolumn column setendposition m_endline m_endcolumn inline unsigned int token length const return m length m_length inline void token set length unsigned int length m length length setlength m_length inline int token position const return m position m_position inline void token set position int position m position position setposition m_position unsigned int lookup hash const char s unsigned int val 0 while s val s return val petal node petal node node type nt m type nt petalnode petalnode nodetype m_type petal node petal node petalnode petalnode petal node node type petal node type const return m type petalnode nodetype petalnode m_type void set widget classifier widget p widget m pwidget p widget setwidget classifierwidget pwidget m_pwidget pwidget id change log id change log const id change log other m logarray other m logarray idchangelog idchangelog idchangelog m_logarray m_logarray id change log id change log operator const id change log other m logarray other m logarray return this idchangelog idchangelog idchangelog m_logarray m_logarray bool id change log operator const id change log other it needs to be implemented return false idchangelog idchangelog void id change log addid change uml id type oldid uml id type newid uint pos if findid change oldid newid pos pos m logarray size m logarray resize pos 1 m logarray set point pos newid oldid else m logarray set point pos newid oldid idchangelog addidchange idtype idtype findidchange m_logarray m_logarray m_logarray setpoint m_logarray setpoint id change log id change log operator const id change log other m logarray putpoints m logarray size other m logarray size other uint count other m logarray size for uint i 0 i count i addid change other m logarray point i y other m logarray point i x return this idchangelog idchangelog idchangelog m_logarray m_logarray m_logarray m_logarray addidchange m_logarray m_logarray uml id type id change log find newid uml id type oldid uint count m logarray size for uint i 0 i count i if m logarray point i y oldid return m logarray point i x return uml id none idtype idchangelog findnewid idtype m_logarray m_logarray m_logarray id_none uml id type id change log find oldid uml id type newid uint count m logarray size for uint i 0 i count i if m logarray point i x newid return m logarray point i y return uml id none idtype idchangelog findoldid idtype m_logarray m_logarray m_logarray id_none void id change log remove change by newid uml id type oldid uint count m logarray size for uint i 0 i count i if m logarray point i y oldid m logarray set point i uml id none oldid idchangelog removechangebynewid idtype m_logarray m_logarray m_logarray setpoint id_none tree parser tree parser treeparser treeparser tree parser tree parser treeparser treeparser void tree parser parse translation unit translation unitast translation unit kd debug 9007 tree parser parse translation unit endl q ptr list declarationast declarations translation unit declaration list q ptr list iterator declarationast it declarations while it current parse declaration it current it treeparser parsetranslationunit translationunitast translationunit kddebug treeparser parsetranslationunit qptrlist translationunit declarationlist qptrlistiterator parsedeclaration void tree parser parse declaration declarationast declaration kd debug 9007 tree parser parse declaration endl if declaration return switch declaration node type case nodetype linkagespecification parse linkage specification static cast linkage specificationast declaration break case nodetype namespace parse namespace static cast namespaceast declaration break case nodetype namespacealias parse namespace alias static cast namespace aliasast declaration break case nodetype using parse using static cast usingast declaration break case nodetype usingdirective parse using directive static cast using directiveast declaration break case nodetype typedef parse typedef static cast typedefast declaration break case nodetype templatedeclaration parse template declaration static cast template declarationast declaration break case nodetype simpledeclaration parse simple declaration static cast simple declarationast declaration break case nodetype functiondefinition parse function definition static cast function definitionast declaration break case nodetype accessdeclaration parse access declaration static cast access declarationast declaration break treeparser parsedeclaration kddebug treeparser parsedeclaration nodetype nodetype_linkagespecification parselinkagespecification static_cast linkagespecificationast nodetype_namespace parsenamespace static_cast nodetype_namespacealias parsenamespacealias static_cast namespacealiasast nodetype_using parseusing static_cast nodetype_usingdirective parseusingdirective static_cast usingdirectiveast nodetype_typedef parsetypedef static_cast nodetype_templatedeclaration parsetemplatedeclaration static_cast templatedeclarationast nodetype_simpledeclaration parsesimpledeclaration static_cast simpledeclarationast nodetype_functiondefinition parsefunctiondefinition static_cast functiondefinitionast nodetype_accessdeclaration parseaccessdeclaration static_cast accessdeclarationast void tree parser parse linkage specification linkage specificationast ast kd debug 9007 tree parser parse linkage specification endl if ast linkage body parse linkage body ast linkage body else if ast declaration parse declaration ast declaration treeparser parselinkagespecification linkagespecificationast kddebug treeparser parselinkagespecification linkagebody parselinkagebody linkagebody parsedeclaration void tree parser parse namespace namespaceast decl kd debug 9007 tree parser parse namespace endl if decl linkage body parse linkage body decl linkage body treeparser parsenamespace kddebug treeparser parsenamespace linkagebody parselinkagebody linkagebody void tree parser parse namespace alias namespace aliasast decl kd debug 9007 tree parser parse namespace alias endl q unused decl treeparser parsenamespacealias namespacealiasast kddebug treeparser parsenamespacealias q_unused void tree parser parse using usingast decl kd debug 9007 tree parser parse using endl q unused decl treeparser parseusing kddebug treeparser parseusing q_unused void tree parser parse using directive using directiveast decl kd debug 9007 tree parser parse using directive endl q unused decl treeparser parseusingdirective usingdirectiveast kddebug treeparser parseusingdirective q_unused void tree parser parse typedef typedefast decl kd debug 9007 tree parser parse typedef endl if decl type spec parse type specifier decl type spec treeparser parsetypedef kddebug treeparser parsetypedef typespec parsetypespecifier typespec void tree parser parse template declaration template declarationast decl kd debug 9007 tree parser parse template declaration endl q unused decl treeparser parsetemplatedeclaration templatedeclarationast kddebug treeparser parsetemplatedeclaration q_unused void tree parser parse simple declaration simple declarationast decl kd debug 9007 tree parser parse simple declaration endl q unused decl treeparser parsesimpledeclaration simpledeclarationast kddebug treeparser parsesimpledeclaration q_unused void tree parser parse function definition function definitionast def kd debug 9007 tree parser parse function definition endl q unused def treeparser parsefunctiondefinition functiondefinitionast kddebug treeparser parsefunctiondefinition q_unused void tree parser parse linkage body linkage bodyast linkage body kd debug 9007 tree parser parse linkage body endl q ptr list declarationast declarations linkage body declaration list for q ptr list iterator declarationast it declarations it current it parse declaration it current treeparser parselinkagebody linkagebodyast linkagebody kddebug treeparser parselinkagebody qptrlist linkagebody declarationlist qptrlistiterator parsedeclaration void tree parser parse access declaration access declarationast access kd debug 9007 tree parser parse access declaration endl q unused access treeparser parseaccessdeclaration accessdeclarationast kddebug treeparser parseaccessdeclaration q_unused void tree parser parse type specifier type specifierast type spec kd debug 9007 tree parser parse type specifier endl switch type spec node type case nodetype classspecifier parse class specifier static cast class specifierast type spec break case nodetype enumspecifier parse enum specifier static cast enum specifierast type spec break case nodetype elaboratedtypespecifier parse elaborated type specifier static cast elaborated type specifierast type spec break treeparser parsetypespecifier typespecifierast typespec kddebug treeparser parsetypespecifier typespec nodetype nodetype_classspecifier parseclassspecifier static_cast classspecifierast typespec nodetype_enumspecifier parseenumspecifier static_cast enumspecifierast typespec nodetype_elaboratedtypespecifier parseelaboratedtypespecifier static_cast elaboratedtypespecifierast typespec void tree parser parse class specifier class specifierast class spec kd debug 9007 tree parser parse class specifier endl q ptr list declarationast declarations class spec declaration list for q ptr list iterator declarationast it declarations it current it parse declaration it current treeparser parseclassspecifier classspecifierast classspec kddebug treeparser parseclassspecifier qptrlist classspec declarationlist qptrlistiterator parsedeclaration void tree parser parse enum specifier enum specifierast enum spec kd debug 9007 tree parser parse enum specifier endl q unused enum spec treeparser parseenumspecifier enumspecifierast enumspec kddebug treeparser parseenumspecifier q_unused enumspec void tree parser parse elaborated type specifier elaborated type specifierast type spec kd debug 9007 tree parser parse elaborated type specifier endl q unused type spec treeparser parseelaboratedtypespecifier elaboratedtypespecifierast typespec kddebug treeparser parseelaboratedtypespecifier q_unused typespec lex lexer d new parser private data m maxproblems 5 objcp false parserprivatedata m_maxproblems parser parser delete d d 0 bool parser report error const error err kd debug 9007 tok lex look ahead 0 text parser report error endl if m problems m maxproblems m problems int line 0 col 0 const token token lex look ahead 0 lex get token position token line col q string s lex look ahead 0 text s s left 30 strip white space if s is empty s i18n eof m driver add problem m driver current file name problem err text arg s line col return true reporterror kddebug lookahead reporterror m_problems m_maxproblems m_problems lookahead gettokenposition qstring lookahead stripwhitespace isempty m_driver addproblem m_driver currentfilename void parser syntax error void report error errors syntax error syntaxerror reporterror syntaxerror bool parser parse translation unit translation unitast node node kd debug 9007 tok lex look ahead 0 text parser parse translation unit endl int start lex index m problems 0 translation unitast node tun create node translation unitast node tun while lex look ahead 0 is null declarationast node def int start decl lex index if parse declaration def error recovery if start decl lex index lex next token skip at least one token skip until declaration node add declaration def update pos node start lex index force 0 0 as start position node set start position 0 0 return m problems 0 parsetranslationunit translationunitast kddebug lookahead parsetranslationunit m_problems translationunitast createnode translationunitast lookahead isnull startdecl parsedeclaration startdecl nexttoken skipuntildeclaration adddeclaration update_pos setstartposition m_problems bool parser parse declaration declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse declaration endl q string comment while lex look ahead 0 token comment comment lex look ahead 0 text lex next token if lex look ahead 0 is null return false int start lex index bool success false switch lex look ahead 0 case lex next token return true case token extern success parse linkage specification node break case token namespace success parse namespace node break case token using success parse using node break case token typedef success parse typedef node break case token asm success parse asm definition node break case token template case token export success parse template declaration node break default lex set index start if objcp parse objc def node return true lex set index start groupast node storage spec parse storage class specifier storage spec groupast node cv parse cv qualify cv type specifierast node spec ast node declarator if parse enum specifier spec parse class specifier spec spec set cv qualify cv groupast node cv2 parse cv qualify cv2 spec set cv2 qualify cv2 init declarator listast node declarators parse init declarator list declarators advance if comment is empty kd debug 9007 parser parse declaration spec comment is comment endl spec set comment comment simple declarationast node ast create node simple declarationast ast set storage specifier storage spec ast set type spec spec ast set init declarator list declarators update pos ast start lex index node ast return true lex set index start success parse declaration internal node comment end switch if success comment is empty kd debug 9007 parser parse declaration comment is comment endl node set comment comment return success parsedeclaration kddebug lookahead parsedeclaration qstring lookahead token_comment lookahead nexttoken lookahead isnull lookahead nexttoken token_extern parselinkagespecification token_namespace parsenamespace token_using parseusing token_typedef parsetypedef token_asm parseasmdefinition token_template token_export parsetemplatedeclaration setindex parseobjcdef setindex storagespec parsestorageclassspecifier storagespec parsecvqualify typespecifierast parseenumspecifier parseclassspecifier setcvqualify parsecvqualify setcv2qualify initdeclaratorlistast parseinitdeclaratorlist isempty kddebug parsedeclaration setcomment simpledeclarationast createnode simpledeclarationast setstoragespecifier storagespec settypespec setinitdeclaratorlist update_pos setindex parsedeclarationinternal isempty kddebug parsedeclaration setcomment bool parser parse block declaration declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse block declaration endl switch lex look ahead 0 case token typedef return parse typedef node case token using return parse using node case token asm return parse asm definition node case token namespace return parse namespace alias definition node int start lex index groupast node storage spec parse storage class specifier storage spec groupast node cv parse cv qualify cv type specifierast node spec if parse type specifier or class spec spec replace with simple type specifier lex set index start return false spec set cv qualify cv groupast node cv2 parse cv qualify cv2 spec set cv2 qualify cv2 init declarator listast node declarators parse init declarator list declarators if lex look ahead 0 lex set index start return false lex next token simple declarationast node ast create node simple declarationast ast set type spec spec ast set init declarator list declarators update pos ast start lex index node ast return true parseblockdeclaration kddebug lookahead parseblockdeclaration lookahead token_typedef parsetypedef token_using parseusing token_asm parseasmdefinition token_namespace parsenamespacealiasdefinition storagespec parsestorageclassspecifier storagespec parsecvqualify typespecifierast parsetypespecifierorclassspec simpletypespecifier setindex setcvqualify parsecvqualify setcv2qualify initdeclaratorlistast parseinitdeclaratorlist lookahead setindex nexttoken simpledeclarationast createnode simpledeclarationast settypespec setinitdeclaratorlist update_pos bool parser parse linkage specification declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse linkage specification endl int start lex index if lex look ahead 0 token extern return false lex next token linkage specificationast node ast create node linkage specificationast int start extern type lex index if lex look ahead 0 token string literal lex next token ast node extern type create node ast update pos extern type start extern type lex index ast set extern type extern type if lex look ahead 0 linkage bodyast node linkage body parse linkage body linkage body ast set linkage body linkage body else declarationast node decl if parse declaration decl report error i18n declaration syntax error ast set declaration decl update pos ast start lex index node ast return true parselinkagespecification kddebug lookahead parselinkagespecification lookahead token_extern nexttoken linkagespecificationast createnode linkagespecificationast startexterntype lookahead token_string_literal nexttoken externtype createnode update_pos externtype startexterntype setexterntype externtype lookahead linkagebodyast linkagebody parselinkagebody linkagebody setlinkagebody linkagebody parsedeclaration reporterror setdeclaration update_pos bool parser parse linkage body linkage bodyast node node kd debug 9007 tok lex look ahead 0 text parser parse linkage body endl int start lex index if lex look ahead 0 return false lex next token linkage bodyast node lba create node linkage bodyast node lba while lex look ahead 0 is null int tk lex look ahead 0 if tk break declarationast node def int start decl lex index if parse declaration def node add declaration def else error recovery if start decl lex index lex next token skip at least one token skip until declaration if lex look ahead 0 report error i18n expected else lex next token update pos node start lex index return true parselinkagebody linkagebodyast kddebug lookahead parselinkagebody lookahead nexttoken linkagebodyast createnode linkagebodyast lookahead isnull lookahead startdecl parsedeclaration adddeclaration startdecl nexttoken skipuntildeclaration lookahead reporterror nexttoken update_pos bool parser parse namespace declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse namespace endl int start lex index if lex look ahead 0 token namespace return false lex next token int start namespace name lex index if lex look ahead 0 token identifier lex next token ast node namespace name create node ast update pos namespace name start namespace name lex index if lex look ahead 0 namespace alias lex next token nameast node name if parse name name advance namespace aliasast node ast create node namespace aliasast ast set namespace name namespace name ast set alias name name update pos ast start lex index node ast return true else report error i18n namespace expected return false else if lex look ahead 0 report error i18n expected return false namespaceast node ast create node namespaceast ast set namespace name namespace name linkage bodyast node linkage body parse linkage body linkage body ast set linkage body linkage body update pos ast start lex index node ast return true parsenamespace kddebug lookahead parsenamespace lookahead token_namespace nexttoken startnamespacename lookahead token_identifier nexttoken namespacename createnode update_pos namespacename startnamespacename lookahead nexttoken parsename namespacealiasast createnode namespacealiasast setnamespacename namespacename setaliasname update_pos reporterror lookahead reporterror createnode setnamespacename namespacename linkagebodyast linkagebody parselinkagebody linkagebody setlinkagebody linkagebody update_pos bool parser parse namespace alias definition declarationast node node if lex look ahead 0 token namespace return false lex next token advance token identifier identifier advance nameast node name if parse name name report error i18n namespace name expected advance return true parsenamespacealiasdefinition lookahead token_namespace nexttoken token_identifier parsename reporterror bool parser parse using declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse using endl int start lex index if lex look ahead 0 token using return false lex next token if lex look ahead 0 token namespace if parse using directive node return false update pos node start lex index return true usingast node ast create node usingast int start type name lex index if lex look ahead 0 token typename lex next token ast node tn create node ast update pos tn start type name lex index ast set type name tn nameast node name if parse name name return false ast set name name advance update pos ast start lex index node ast return true parseusing kddebug lookahead parseusing lookahead token_using nexttoken lookahead token_namespace parseusingdirective update_pos createnode starttypename lookahead token_typename nexttoken createnode update_pos starttypename settypename parsename setname update_pos bool parser parse using directive declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse using directive endl int start lex index if lex look ahead 0 token namespace return false lex next token nameast node name if parse name name report error i18n namespace name expected return false advance using directiveast node ast create node using directiveast ast set name name update pos ast start lex index node ast return true parseusingdirective kddebug lookahead parseusingdirective lookahead token_namespace nexttoken parsename reporterror usingdirectiveast createnode usingdirectiveast setname update_pos bool parser parse typedef declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse typedef endl int start lex index if lex look ahead 0 token typedef return false lex next token type specifierast node spec if parse type specifier or class spec spec report error i18n need a type specifier to declare return false init declarator listast node declarators if parse init declarator list declarators report error i18n need an identifier to declare return false advance typedefast node ast create node typedefast ast set type spec spec ast set init declarator list declarators update pos ast start lex index node ast return true parsetypedef kddebug lookahead parsetypedef lookahead token_typedef nexttoken typespecifierast parsetypespecifierorclassspec reporterror initdeclaratorlistast parseinitdeclaratorlist reporterror createnode settypespec setinitdeclaratorlist update_pos bool parser parse asm definition declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse asm definition endl advance token asm asm groupast node cv parse cv qualify cv skip advance advance return true parseasmdefinition kddebug lookahead parseasmdefinition token_asm parsecvqualify bool parser parse template declaration declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse template declaration endl int start lex index ast node exp int start export lex index if lex look ahead 0 token export lex next token ast node n create node ast update pos n start export lex index exp n if lex look ahead 0 token template return false lex next token template parameter listast node params if lex look ahead 0 lex next token if lex look ahead 0 parse template parameter list params advance declarationast node def if parse declaration def report error i18n expected a declaration template declarationast node ast create node template declarationast ast set exported exp ast set template parameter list params ast set declaration def update pos ast start lex index node ast return true parsetemplatedeclaration kddebug lookahead parsetemplatedeclaration startexport lookahead token_export nexttoken createnode update_pos startexport lookahead token_template nexttoken templateparameterlistast lookahead nexttoken lookahead parsetemplateparameterlist parsedeclaration reporterror templatedeclarationast createnode templatedeclarationast setexported settemplateparameterlist setdeclaration update_pos bool parser parse unqualified name class or namespace nameast node node kd debug 9007 tok lex look ahead 0 text parser parse unqualified name endl int start lex index bool is destructor false class or namespace nameast node ast create node class or namespace nameast if lex look ahead 0 token identifier int start name lex index ast node n create node ast lex next token update pos n start name lex index ast set name n else if lex look ahead 0 lex look ahead 1 token identifier int start name lex index ast node n create node ast lex next token skip lex next token skip classname update pos n start name lex index ast set name n is destructor true else if lex look ahead 0 token operator ast node n if parse operator function id n return false ast set name n else return false if is destructor int index lex index if lex look ahead 0 lex next token optional template arguments template argument listast node args parse template argument list args if lex look ahead 0 lex set index index else lex next token ast set template argument list args update pos ast start lex index node ast return true parseunqualifiedname classornamespacenameast kddebug lookahead parseunqualifiedname isdestructor classornamespacenameast createnode classornamespacenameast lookahead token_identifier startname createnode nexttoken update_pos startname setname lookahead lookahead token_identifier startname createnode nexttoken nexttoken update_pos startname setname isdestructor lookahead token_operator parseoperatorfunctionid setname isdestructor lookahead nexttoken templateargumentlistast parsetemplateargumentlist lookahead setindex nexttoken settemplateargumentlist update_pos bool parser parse string literal ast node node while lex look ahead 0 is null if lex look ahead 0 token identifier lex look ahead 0 text l lex look ahead 1 token string literal lex next token lex next token else if lex look ahead 0 token string literal lex next token else return false return true parsestringliteral lookahead isnull lookahead token_identifier lookahead lookahead token_string_literal nexttoken nexttoken lookahead token_string_literal nexttoken bool parser parse name nameast node node kd debug 9007 tok lex look ahead 0 text parser parse name endl groupast node win decl spec parse win decl spec win decl spec int start lex index nameast node ast create node nameast if lex look ahead 0 token scope ast set global true lex next token int idx lex index while true class or namespace nameast node n if parse unqualified name n return false if lex look ahead 0 token scope lex next token ast add class or namespace name n if lex look ahead 0 token template lex next token skip optional template todo check else ast set unqualified name n break if idx lex index return false update pos ast start lex index node ast return true parsename kddebug lookahead parsename windeclspec parsewindeclspec windeclspec createnode lookahead token_scope setglobal nexttoken classornamespacenameast parseunqualifiedname lookahead token_scope nexttoken addclassornamespacename lookahead token_template nexttoken setunqualifiedname update_pos bool parser parse operator function id ast node node kd debug 9007 tok lex look ahead 0 text parser parse operator function id endl int start lex index if lex look ahead 0 token operator return false lex next token ast node op if parse operator op ast node asn create node ast node asn update pos node start lex index return true else parse cast operator groupast node cv parse cv qualify cv type specifierast node spec if parse simple type specifier spec syntax error return false spec set cv qualify cv groupast node cv2 parse cv qualify cv2 spec set cv2 qualify cv2 ast node ptr op while parse ptr operator ptr op ast node asn create node ast node asn update pos node start lex index return true parseoperatorfunctionid kddebug lookahead parseoperatorfunctionid lookahead token_operator nexttoken parseoperator createnode update_pos parsecvqualify typespecifierast parsesimpletypespecifier syntaxerror setcvqualify parsecvqualify setcv2qualify ptrop parseptroperator ptrop createnode update_pos bool parser parse template argument list template argument listast node node bool report error kd debug 9007 tok lex look ahead 0 text parser parse template argument list endl int start lex index template argument listast node ast create node template argument listast ast node templ arg if parse template argument templ arg return false ast add argument templ arg q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if parse template argument templ arg if report error syntax error break else return false if comment is empty templ arg set comment comment ast add argument templ arg update pos ast start lex index node ast return true parsetemplateargumentlist templateargumentlistast reporterror kddebug lookahead parsetemplateargumentlist templateargumentlistast createnode templateargumentlistast templarg parsetemplateargument templarg addargument templarg qstring lookahead qstring advanceandchecktrailingcomment parsetemplateargument templarg reporterror syntaxerror isempty templarg setcomment addargument templarg update_pos bool parser parse operator ast node node kd debug 9007 tok lex look ahead 0 text parser parse operator endl q string text lex look ahead 0 text switch lex look ahead 0 case token new case token delete lex next token if lex look ahead 0 lex look ahead 1 lex next token lex next token text return true case case case case case case case case case case case case case case case token assign case token shift case token eq case token not eq case token leq case token geq case token and case token or case token incr case token decr case token ptrmem case token arrow lex next token return true default if lex look ahead 0 lex look ahead 1 lex next token lex next token return true else if lex look ahead 0 lex look ahead 1 lex next token lex next token return true return false parseoperator kddebug lookahead parseoperator qstring lookahead lookahead token_new token_delete nexttoken lookahead lookahead nexttoken nexttoken token_assign token_shift token_eq token_not_eq token_leq token_geq token_and token_or token_incr token_decr token_ptrmem token_arrow nexttoken lookahead lookahead nexttoken nexttoken lookahead lookahead nexttoken nexttoken bool parser parse cv qualify groupast node node kd debug 9007 tok lex look ahead 0 text parser parse cv qualify endl int start lex index groupast node ast create node groupast int n 0 while lex look ahead 0 is null int tk lex look ahead 0 if tk token const tk token volatile n int start word lex index lex next token ast node word create node ast update pos word start word lex index ast add node word else break if n 0 return false kd debug 9007 token lex look ahead 0 text endl update pos ast start lex index node ast return true parsecvqualify kddebug lookahead parsecvqualify createnode lookahead isnull lookahead token_const token_volatile startword nexttoken createnode update_pos startword addnode kddebug lookahead update_pos bool parser parse simple type specifier type specifierast node node int start lex index bool is integral false bool done false while done switch lex look ahead 0 case token char case token wchar t case token bool case token short case token int case token long case token signed case token unsigned case token float case token double case token void is integral true lex next token break default done true type specifierast node ast create node type specifierast if is integral class or namespace nameast node cl create node class or namespace nameast ast node n create node ast update pos n start lex index cl set name n update pos cl start lex index nameast node name create node nameast name set unqualified name cl update pos name start lex index ast set name name else nameast node name if parse name name lex set index start return false ast set name name update pos ast start lex index node ast return true parsesimpletypespecifier typespecifierast isintegral lookahead token_char token_wchar_t token_bool token_short token_int token_long token_signed token_unsigned token_float token_double token_void isintegral nexttoken typespecifierast createnode typespecifierast isintegral classornamespacenameast createnode classornamespacenameast createnode update_pos setname update_pos createnode setunqualifiedname update_pos setname parsename setindex setname update_pos bool parser parse ptr operator ast node node kd debug 9007 tok lex look ahead 0 text parser parse ptr operator endl int start lex index if lex look ahead 0 lex next token else if lex look ahead 0 lex next token else int index lex index ast node mem ptr if parse ptr to member mem ptr lex set index index return false groupast node cv parse cv qualify cv ast node ast create node ast update pos ast start lex index node ast return true parseptroperator kddebug lookahead parseptroperator lookahead nexttoken lookahead nexttoken memptr parseptrtomember memptr setindex parsecvqualify createnode update_pos bool parser parse template argument ast node node kd debug 9007 tok lex look ahead 0 text parser parse template argument endl int start lex index if parse type id node if lex look ahead 0 lex look ahead 0 return true lex set index start if parse logical or expression node true return false return true parsetemplateargument kddebug lookahead parsetemplateargument parsetypeid lookahead lookahead setindex parselogicalorexpression bool parser parse type specifier type specifierast node spec kd debug 9007 tok lex look ahead 0 text parser parse type specifier endl groupast node cv parse cv qualify cv if parse elaborated type specifier spec parse simple type specifier spec spec set cv qualify cv groupast node cv2 parse cv qualify cv2 spec set cv2 qualify cv2 return true return false parsetypespecifier typespecifierast kddebug lookahead parsetypespecifier parsecvqualify parseelaboratedtypespecifier parsesimpletypespecifier setcvqualify parsecvqualify setcv2qualify bool parser parse type specifier or class spec type specifierast node node if parse class specifier node return true else if parse enum specifier node return true else if parse type specifier node return true return false parsetypespecifierorclassspec typespecifierast parseclassspecifier parseenumspecifier parsetypespecifier bool parser parse declarator declaratorast node node kd debug 9007 tok lex look ahead 0 text parser parse declarator endl int start lex index declaratorast node ast create node declaratorast declaratorast node decl nameast node decl id ast node ptr op while parse ptr operator ptr op ast add ptr op ptr op if lex look ahead 0 lex next token if parse declarator decl return false ast set sub declarator decl if lex look ahead 0 return false lex next token else if lex look ahead 0 unnamed bitfield else if parse declarator id decl id ast set declarator id decl id else lex set index start return false if lex look ahead 0 lex next token ast node expr if parse constant expression expr report error i18n constant expression expected goto update pos bool is vector true while lex look ahead 0 int start array lex index lex next token ast node expr parse comma expression expr advance ast node array create node ast update pos array start array lex index ast add array dimension array is vector true bool skip paren false if lex look ahead 0 token identifier lex look ahead 1 lex look ahead 2 lex next token lex next token skip paren true if ast sub declarator is vector lex look ahead 0 lex set index start return false int index lex index if lex look ahead 0 lex next token parameter declaration clauseast node params if parse parameter declaration clause params kd debug 9007 not a parameter declaration maybe an initializer endl lex set index index goto update pos ast set parameter declaration clause params if lex look ahead 0 lex set index index goto update pos lex next token skip int start constant lex index if lex look ahead 0 token const lex next token ast node constant create node ast update pos constant start constant lex index ast set constant constant groupast node except if parse exception specification except ast set exception specification except if skip paren if lex look ahead 0 report error i18n expected else lex next token update pos update pos ast start lex index node ast return true parsedeclarator kddebug lookahead parsedeclarator createnode declid ptrop parseptroperator ptrop addptrop ptrop lookahead nexttoken parsedeclarator setsubdeclarator lookahead nexttoken lookahead parsedeclaratorid declid setdeclaratorid declid setindex lookahead nexttoken parseconstantexpression reporterror update_pos isvector lookahead startarray nexttoken parsecommaexpression createnode update_pos startarray addarraydimension isvector skipparen lookahead token_identifier lookahead lookahead nexttoken nexttoken skipparen subdeclarator isvector lookahead setindex lookahead nexttoken parameterdeclarationclauseast parseparameterdeclarationclause kddebug setindex update_pos setparameterdeclarationclause lookahead setindex update_pos nexttoken startconstant lookahead token_const nexttoken createnode update_pos startconstant setconstant parseexceptionspecification setexceptionspecification skipparen lookahead reporterror nexttoken update_pos update_pos bool parser parse template parameter list template parameter listast node node kd debug 9007 tok lex look ahead 0 text parser parse template parameter list endl int start lex index template parameter listast node ast create node template parameter listast template parameterast node param if parse template parameter param return false ast add template parameter param q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if parse template parameter param syntax error break else if comment is empty param set comment comment ast add template parameter param update pos ast start lex index node ast return true parsetemplateparameterlist templateparameterlistast kddebug lookahead parsetemplateparameterlist templateparameterlistast createnode templateparameterlistast templateparameterast parsetemplateparameter addtemplateparameter qstring lookahead qstring advanceandchecktrailingcomment parsetemplateparameter syntaxerror isempty setcomment addtemplateparameter update_pos bool parser parse template parameter template parameterast node node kd debug 9007 tok lex look ahead 0 text parser parse template parameter endl int start lex index template parameterast node ast create node template parameterast type parameterast node type parameter parameter declarationast node param int tk lex look ahead 0 if tk token class tk token typename tk token template parse type parameter type parameter ast set type parameter type parameter goto ok if parse parameter declaration param return false ast set type value parameter param ok update pos ast start lex index node ast return true parsetemplateparameter templateparameterast kddebug lookahead parsetemplateparameter templateparameterast createnode templateparameterast typeparameterast typeparameter parameterdeclarationast lookahead token_class token_typename token_template parsetypeparameter typeparameter settypeparameter typeparameter parseparameterdeclaration settypevalueparameter update_pos bool parser parse storage class specifier groupast node node kd debug 9007 tok lex look ahead 0 text parser parse storage class specifier endl int start lex index groupast node ast create node groupast while lex look ahead 0 is null int tk lex look ahead 0 if tk token friend tk token auto tk token register tk token static tk token extern tk token mutable int start node lex index lex next token ast node n create node ast update pos n start node lex index ast add node n else break if ast node list count 0 return false update pos ast start lex index node ast return true parsestorageclassspecifier kddebug lookahead parsestorageclassspecifier createnode lookahead isnull lookahead token_friend token_auto token_register token_static token_extern token_mutable startnode nexttoken createnode update_pos startnode addnode nodelist update_pos bool parser parse function specifier groupast node node kd debug 9007 tok lex look ahead 0 text parser parse function specifier endl int start lex index groupast node ast create node groupast while lex look ahead 0 is null int tk lex look ahead 0 if tk token inline tk token virtual tk token explicit int start node lex index lex next token ast node n create node ast update pos n start node lex index ast add node n else break if ast node list count 0 return false update pos ast start lex index node ast return true parsefunctionspecifier kddebug lookahead parsefunctionspecifier createnode lookahead isnull lookahead token_inline token_virtual token_explicit startnode nexttoken createnode update_pos startnode addnode nodelist update_pos bool parser parse init declarator list init declarator listast node node kd debug 9007 tok lex look ahead 0 text parser parse init declarator list endl int start lex index init declarator listast node ast create node init declarator listast init declaratorast node decl if parse init declarator decl return false ast add init declarator decl q string comment while lex look ahead 0 comment advance and check trailing comment comment if parse init declarator decl syntax error break if comment is empty decl set comment comment ast add init declarator decl kd debug 9007 tok lex look ahead 0 text parser parse init declarator list end endl update pos ast start lex index node ast return true parseinitdeclaratorlist initdeclaratorlistast kddebug lookahead parseinitdeclaratorlist initdeclaratorlistast createnode initdeclaratorlistast initdeclaratorast parseinitdeclarator addinitdeclarator qstring lookahead advanceandchecktrailingcomment parseinitdeclarator syntaxerror isempty setcomment addinitdeclarator kddebug lookahead parseinitdeclaratorlist update_pos bool parser parse init declarator init declaratorast node node kd debug 9007 tok lex look ahead 0 text parser parse init declarator endl int start lex index declaratorast node decl ast node init if parse declarator decl return false parse initializer init init declaratorast node ast create node init declaratorast ast set declarator decl ast set initializer init update pos ast start lex index node ast return true parseinitdeclarator initdeclaratorast kddebug lookahead parseinitdeclarator parsedeclarator parseinitializer initdeclaratorast createnode initdeclaratorast setdeclarator setinitializer update_pos bool parser parse parameter declaration clause parameter declaration clauseast node node kd debug 9007 tok lex look ahead 0 text parser parse parameter declaration clause endl int start lex index parameter declaration clauseast node ast create node parameter declaration clauseast parameter declaration listast node params if parse parameter declaration list params if lex look ahead 0 goto good if lex look ahead 0 token ellipsis lex look ahead 1 ast from token ellipsis lex index ast set ellipsis ellipsis lex next token goto good return false if lex look ahead 0 token ellipsis ast from token ellipsis lex index ast set ellipsis ellipsis lex next token good ast set parameter declaration list params todo add ellipsis update pos ast start lex index node ast return true parseparameterdeclarationclause parameterdeclarationclauseast kddebug lookahead parseparameterdeclarationclause parameterdeclarationclauseast createnode parameterdeclarationclauseast parameterdeclarationlistast parseparameterdeclarationlist lookahead lookahead token_ellipsis lookahead ast_from_token setellipsis nexttoken lookahead token_ellipsis ast_from_token setellipsis nexttoken setparameterdeclarationlist update_pos bool parser parse ctor initializer ast node node kd debug 9007 tok lex look ahead 0 text parser parse ctor initializer endl if lex look ahead 0 return false lex next token ast node inits if parse mem initializer list inits report error i18n member initializers expected return true parsectorinitializer kddebug lookahead parsectorinitializer lookahead nexttoken parsememinitializerlist reporterror bool parser parse ptr to member ast node node kd debug 9007 tok lex look ahead 0 text parser parse ptr to member endl if lex look ahead 0 token scope lex next token while lex look ahead 0 token identifier lex next token if lex look ahead 0 token scope lex look ahead 1 lex next token skip lex next token skip return true else break return false parseptrtomember kddebug lookahead parseptrtomember lookahead token_scope nexttoken lookahead token_identifier nexttoken lookahead token_scope lookahead nexttoken nexttoken bool parser parse enum specifier type specifierast node node kd debug 9007 tok lex look ahead 0 text parser parse enum specifier endl q string comment while lex look ahead 0 token comment comment lex look ahead 0 text lex next token if lex look ahead 0 is null return false int start lex index if lex look ahead 0 token enum return false lex next token nameast node name parse name name if lex look ahead 0 lex set index start return false lex next token enum specifierast node ast create node enum specifierast ast set name name enumeratorast node enumerator if parse enumerator enumerator ast add enumerator enumerator q string comment while lex look ahead 0 comment advance and check trailing comment comment if comment is empty enumeratorast last lit ast enumerator list last if last lit last lit set comment comment if parse enumerator enumerator report error i18n enumerator expected break ast add enumerator enumerator if lex look ahead 0 token comment lex next token if lex look ahead 0 report error i18n missing else lex next token update pos ast start lex index node ast return true parseenumspecifier typespecifierast kddebug lookahead parseenumspecifier qstring lookahead token_comment lookahead nexttoken lookahead isnull lookahead token_enum nexttoken parsename lookahead setindex nexttoken enumspecifierast createnode enumspecifierast setname parseenumerator addenumerator qstring lookahead advanceandchecktrailingcomment isempty lastlit enumeratorlist lastlit lastlit setcomment parseenumerator reporterror addenumerator lookahead token_comment nexttoken lookahead reporterror nexttoken update_pos bool parser parse class specifier type specifierast node node kd debug 9007 tok lex look ahead 0 text parser parse class specifier endl int start lex index ast node class key int class key start lex index int kind lex look ahead 0 if kind token class kind token struct kind token union ast node asn create node ast class key asn lex next token update pos class key class key start lex index else return false groupast node win decl spec parse win decl spec win decl spec while lex look ahead 0 token identifier lex look ahead 1 token identifier lex next token nameast node name parse name name base clauseast node bases if lex look ahead 0 if parse base clause bases skip until q string comment while lex look ahead 0 token comment comment lex look ahead 0 text lex next token if lex look ahead 0 lex set index start return false advance class specifierast node ast create node class specifierast ast set win decl spec win decl spec ast set class key class key ast set name name ast set base clause bases while lex look ahead 0 is null if lex look ahead 0 break declarationast node mem spec create node declarationast int start decl lex index if parse member specification mem spec if start decl lex index lex next token skip at least one token skip until declaration else ast add declaration mem spec if lex look ahead 0 report error i18n missing else lex next token update pos ast start lex index node ast return true parseclassspecifier typespecifierast kddebug lookahead parseclassspecifier classkey classkeystart lookahead token_class token_struct token_union createnode classkey nexttoken update_pos classkey classkeystart windeclspec parsewindeclspec windeclspec lookahead token_identifier lookahead token_identifier nexttoken parsename baseclauseast lookahead parsebaseclause skipuntil qstring lookahead token_comment lookahead nexttoken lookahead setindex classspecifierast createnode classspecifierast setwindeclspec windeclspec setclasskey classkey setname setbaseclause lookahead isnull lookahead memspec createnode startdecl parsememberspecification memspec startdecl nexttoken skipuntildeclaration adddeclaration memspec lookahead reporterror nexttoken update_pos bool parser parse win decl spec groupast node node if lex look ahead 0 token identifier lex look ahead 0 text declspec lex look ahead 1 int start lex index lex next token lex next token skip parse identifier list node advance update pos node start lex index return true return false parsewindeclspec lookahead token_identifier lookahead __declspec lookahead nexttoken nexttoken parseidentifierlist update_pos bool parser parse elaborated type specifier type specifierast node node kd debug 9007 tok lex look ahead 0 text parser parse elaborated type specifier endl int start lex index int tk lex look ahead 0 if tk token class tk token struct tk token union tk token enum tk token typename ast node kind create node ast lex next token update pos kind start lex index nameast node name if parse name name elaborated type specifierast node ast create node elaborated type specifierast ast set kind kind ast set name name update pos ast start lex index node ast return true lex set index start return false parseelaboratedtypespecifier typespecifierast kddebug lookahead parseelaboratedtypespecifier lookahead token_class token_struct token_union token_enum token_typename createnode nexttoken update_pos parsename elaboratedtypespecifierast createnode elaboratedtypespecifierast setkind setname update_pos setindex bool parser parse declarator id nameast node node kd debug 9007 tok lex look ahead 0 text parser parse declarator id endl return parse name node parsedeclaratorid kddebug lookahead parsedeclaratorid parsename bool parser parse exception specification groupast node node kd debug 9007 tok lex look ahead 0 text parser parse exception specification endl if lex look ahead 0 token throw return false lex next token advance if lex look ahead 0 token ellipsis extension found in msvc 7 x headers int start lex index groupast node ast create node groupast ast from token ellipsis lex index ast add node ellipsis lex next token update pos ast start lex index node ast else parse type id list node advance return true parseexceptionspecification kddebug lookahead parseexceptionspecification lookahead token_throw nexttoken lookahead token_ellipsis createnode ast_from_token addnode nexttoken update_pos parsetypeidlist bool parser parse enumerator enumeratorast node node kd debug 9007 tok lex look ahead 0 text parser parse enumerator endl q string comment while lex look ahead 0 token comment comment lex look ahead 0 text lex next token if lex look ahead 0 is null return false int start lex index if lex look ahead 0 token identifier return false lex next token enumeratorast node ena create node enumeratorast node ena ast node id create node ast update pos id start lex index node set id id if lex look ahead 0 lex next token ast node expr if parse constant expression expr report error i18n constant expression expected node set expr expr update pos node start lex index return true parseenumerator kddebug lookahead parseenumerator qstring lookahead token_comment lookahead nexttoken lookahead isnull lookahead token_identifier nexttoken createnode createnode update_pos setid lookahead nexttoken parseconstantexpression reporterror setexpr update_pos bool parser parse type parameter type parameterast node node kd debug 9007 tok lex look ahead 0 text parser parse type parameter endl int start lex index type parameterast node ast create node type parameterast ast from token kind lex index ast set kind kind switch lex look ahead 0 case token class case token typename lex next token skip class parse optional name nameast node name if parse name name ast set name name if lex look ahead 0 lex next token ast node type id if parse type id type id syntax error return false ast set type id type id break case token template lex next token skip template advance template parameter listast node params if parse template parameter list params return false ast set template parameter list params advance if lex look ahead 0 token class lex next token parse optional name nameast node name if parse name name ast set name name if lex look ahead 0 lex next token ast node type id if parse type id type id syntax error return false ast set type id type id if lex look ahead 0 lex next token nameast node templ name parse name templ name break default return false end switch update pos ast start lex index node ast return true parsetypeparameter typeparameterast kddebug lookahead parsetypeparameter typeparameterast createnode typeparameterast ast_from_token setkind lookahead token_class token_typename nexttoken parsename setname lookahead nexttoken typeid parsetypeid typeid syntaxerror settypeid typeid token_template nexttoken templateparameterlistast parsetemplateparameterlist settemplateparameterlist lookahead token_class nexttoken parsename setname lookahead nexttoken typeid parsetypeid typeid syntaxerror settypeid typeid lookahead nexttoken templ_name parsename templ_name update_pos bool parser parse parameter declaration parameter declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse parameter declaration endl int start lex index parse decl spec type specifierast node spec if parse type specifier spec lex set index start return false int index lex index declaratorast node decl if parse declarator decl lex set index index try with abstract declarator if parse abstract declarator decl return false ast node expr if lex look ahead 0 lex next token if parse logical or expression expr true report error i18n expression expected parameter declarationast node ast create node parameter declarationast ast set type spec spec ast set declarator decl ast set expression expr update pos ast start lex index node ast return true parseparameterdeclaration parameterdeclarationast kddebug lookahead parseparameterdeclaration typespecifierast parsetypespecifier setindex parsedeclarator setindex parseabstractdeclarator lookahead nexttoken parselogicalorexpression reporterror parameterdeclarationast createnode parameterdeclarationast settypespec setdeclarator setexpression update_pos bool parser parse type id ast node node kd debug 9007 tok lex look ahead 0 text parser parse type id endl todo implement the ast for type id int start lex index ast node ast create node ast type specifierast node spec if parse type specifier spec return false declaratorast node decl parse abstract declarator decl update pos ast start lex index node ast return true parsetypeid kddebug lookahead parsetypeid typeid createnode typespecifierast parsetypespecifier parseabstractdeclarator update_pos bool parser parse abstract declarator declaratorast node node kd debug 9007 tok lex look ahead 0 text parser parse declarator endl int start lex index declaratorast node ast create node declaratorast declaratorast node decl nameast node decl id ast node ptr op while parse ptr operator ptr op ast add ptr op ptr op if lex look ahead 0 lex next token if parse abstract declarator decl return false ast set sub declarator decl if lex look ahead 0 return false lex next token while lex look ahead 0 int start array lex index lex next token ast node expr skip comma expression expr advance ast node array create node ast update pos array start array lex index ast add array dimension array bool skip paren false if lex look ahead 0 token identifier lex look ahead 1 lex look ahead 2 lex next token lex next token skip paren true int index lex index if lex look ahead 0 lex next token parameter declaration clauseast node params if parse parameter declaration clause params lex set index index goto update pos ast set parameter declaration clause params if lex look ahead 0 lex set index index goto update pos else lex next token int start constant lex index if lex look ahead 0 token const lex next token ast node constant create node ast update pos constant start constant lex index ast set constant constant groupast node except if parse exception specification except ast set exception specification except if skip paren if lex look ahead 0 report error i18n expected else lex next token update pos update pos ast start lex index node ast return true parseabstractdeclarator kddebug lookahead parsedeclarator createnode declid ptrop parseptroperator ptrop addptrop ptrop lookahead nexttoken parseabstractdeclarator setsubdeclarator lookahead nexttoken lookahead startarray nexttoken skipcommaexpression createnode update_pos startarray addarraydimension skipparen lookahead token_identifier lookahead lookahead nexttoken nexttoken skipparen lookahead nexttoken parameterdeclarationclauseast parseparameterdeclarationclause setindex update_pos setparameterdeclarationclause lookahead setindex update_pos nexttoken startconstant lookahead token_const nexttoken createnode update_pos startconstant setconstant parseexceptionspecification setexceptionspecification skipparen lookahead reporterror nexttoken update_pos update_pos bool parser parse parameter declaration list parameter declaration listast node node kd debug 9007 tok lex look ahead 0 text parser parse parameter declaration list endl int start lex index parameter declaration listast node ast create node parameter declaration listast parameter declarationast node param if parse parameter declaration param lex set index start return false ast add parameter param q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if lex look ahead 0 token ellipsis break if parse parameter declaration param lex set index start return false if comment is empty param set comment comment ast add parameter param update pos ast start lex index node ast return true parseparameterdeclarationlist parameterdeclarationlistast kddebug lookahead parseparameterdeclarationlist parameterdeclarationlistast createnode parameterdeclarationlistast parameterdeclarationast parseparameterdeclaration setindex addparameter qstring lookahead qstring advanceandchecktrailingcomment lookahead token_ellipsis parseparameterdeclaration setindex isempty setcomment addparameter update_pos bool parser parse member specification declarationast node node kd debug 9007 tok lex look ahead 0 text parser parse member specification endl q string comment while lex look ahead 0 token comment comment lex look ahead 0 text lex next token if lex look ahead 0 is null return false int start lex index ast node access if lex look ahead 0 advance and check trailing comment comment if comment is empty node set comment comment return true else if lex look ahead 0 token q object lex look ahead 0 token k dcop lex next token return true else if lex look ahead 0 token signals lex look ahead 0 token k dcop lex look ahead 0 token k dcop signals access declarationast node ast create node access declarationast lex next token ast node n create node ast update pos n start lex index ast add access n advance update pos ast start lex index node ast return true else if parse typedef node return true else if parse using node return true else if parse template declaration node return true else if parse access specifier access access declarationast node ast create node access declarationast ast add access access int start slot lex index if lex look ahead 0 token slots lex next token ast node sl create node ast update pos sl start slot lex index ast add access sl advance update pos ast start lex index node ast return true lex set index start groupast node storage spec parse storage class specifier storage spec groupast node cv parse cv qualify cv type specifierast node spec if parse enum specifier spec parse class specifier spec spec set cv qualify cv groupast node cv2 parse cv qualify cv2 spec set cv2 qualify cv2 init declarator listast node declarators parse init declarator list declarators advance if comment is empty kd debug 9007 parser parse member specification spec comment is comment endl spec set comment comment simple declarationast node ast create node simple declarationast ast set type spec spec ast set init declarator list declarators update pos ast start lex index node ast return true lex set index start bool success parse declaration internal node comment if success comment is empty node set comment comment kd debug 9007 parser parse member specification comment is comment endl return success parsememberspecification kddebug lookahead parsememberspecification qstring lookahead token_comment lookahead nexttoken lookahead isnull lookahead advanceandchecktrailingcomment isempty setcomment lookahead token_q_object lookahead token_k_dcop nexttoken lookahead token_signals lookahead token_k_dcop lookahead token_k_dcop_signals accessdeclarationast createnode accessdeclarationast nexttoken createnode update_pos addaccess update_pos parsetypedef parseusing parsetemplatedeclaration parseaccessspecifier accessdeclarationast createnode accessdeclarationast addaccess startslot lookahead token_slots nexttoken createnode update_pos startslot addaccess update_pos setindex storagespec parsestorageclassspecifier storagespec parsecvqualify typespecifierast parseenumspecifier parseclassspecifier setcvqualify parsecvqualify setcv2qualify initdeclaratorlistast parseinitdeclaratorlist isempty kddebug parsememberspecification setcomment simpledeclarationast createnode simpledeclarationast settypespec setinitdeclaratorlist update_pos setindex parsedeclarationinternal isempty setcomment kddebug parsememberspecification bool parser parse access specifier ast node node kd debug 9007 tok lex look ahead 0 text parser parse access specifier endl int start lex index switch lex look ahead 0 case token public case token protected case token private ast node asn create node ast node asn lex next token update pos node start lex index return true return false parseaccessspecifier kddebug lookahead parseaccessspecifier lookahead token_public token_protected token_private createnode nexttoken update_pos bool parser parse type id list groupast node node kd debug 9007 tok lex look ahead 0 text parser parse type id list endl int start lex index ast node type id if parse type id type id return false groupast node ast create node groupast ast add node type id q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if parse type id type id if comment is empty type id set comment comment ast add node type id else report error i18n type id expected break update pos ast start lex index node ast return true parsetypeidlist kddebug lookahead parsetypeidlist typeid parsetypeid typeid createnode addnode typeid qstring lookahead qstring advanceandchecktrailingcomment parsetypeid typeid isempty typeid setcomment addnode typeid reporterror update_pos bool parser parse mem initializer list ast node node kd debug 9007 tok lex look ahead 0 text parser parse mem initializer list endl ast node init if parse mem initializer init return false q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if parse mem initializer init else break return true parsememinitializerlist kddebug lookahead parsememinitializerlist parsememinitializer qstring lookahead qstring advanceandchecktrailingcomment parsememinitializer bool parser parse mem initializer ast node node kd debug 9007 tok lex look ahead 0 text parser parse mem initializer endl nameast node init id if parse mem initializer id init id report error i18n identifier expected return false advance ast node expr skip comma expression expr advance return true parsememinitializer kddebug lookahead parsememinitializer initid parsememinitializerid initid reporterror skipcommaexpression bool parser parse initializer ast node node kd debug 9007 tok lex look ahead 0 text parser parse initializer endl if lex look ahead 0 lex next token ast node init if parse initializer clause node report error i18n initializer clause expected return false else if lex look ahead 0 lex next token ast node expr skip comma expression expr advance return false parseinitializer kddebug lookahead parseinitializer lookahead nexttoken parseinitializerclause reporterror lookahead nexttoken skipcommaexpression bool parser parse base clause base clauseast node node kd debug 9007 tok lex look ahead 0 text parser parse base clause endl int start lex index if lex look ahead 0 return false lex next token base clauseast node bca create node base clauseast base specifierast node base spec if parse base specifier base spec bca add base specifier base spec q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if parse base specifier base spec report error i18n base class specifier expected return false if comment is empty base spec set comment comment bca add base specifier base spec else return false update pos bca start lex index node bca return true parsebaseclause baseclauseast kddebug lookahead parsebaseclause lookahead nexttoken baseclauseast createnode baseclauseast basespecifierast basespec parsebasespecifier basespec addbasespecifier basespec qstring lookahead qstring advanceandchecktrailingcomment parsebasespecifier basespec reporterror isempty basespec setcomment addbasespecifier basespec update_pos bool parser parse base specifier base specifierast node node kd debug 9007 tok lex look ahead 0 text parser parse base specifier endl int start lex index base specifierast node ast create node base specifierast ast node access if lex look ahead 0 token virtual ast from token virt lex index ast set is virtual virt lex next token parse access specifier access else parse access specifier access if lex look ahead 0 token virtual ast from token virt lex index ast set is virtual virt lex next token nameast node name if parse name name report error i18n class name expected ast set access access ast set name name update pos ast start lex index node ast return true parsebasespecifier basespecifierast kddebug lookahead parsebasespecifier basespecifierast createnode basespecifierast lookahead token_virtual ast_from_token setisvirtual nexttoken parseaccessspecifier parseaccessspecifier lookahead token_virtual ast_from_token setisvirtual nexttoken parsename reporterror setaccess setname update_pos bool parser parse initializer clause ast node node kd debug 9007 tok lex look ahead 0 text parser parse initializer clause endl if lex look ahead 0 if skip report error i18n missing else lex next token else if parse assignment expression node report error i18n expression expected return true parseinitializerclause kddebug lookahead parseinitializerclause lookahead reporterror nexttoken parseassignmentexpression reporterror bool parser parse mem initializer id nameast node node kd debug 9007 tok lex look ahead 0 text parser parse mem initializer id endl return parse name node parsememinitializerid kddebug lookahead parsememinitializerid parsename bool parser parse function body statement listast node node kd debug 9007 tok lex look ahead 0 text parser parse function body endl int start lex index if lex look ahead 0 return false lex next token statement listast node ast create node statement listast while lex look ahead 0 is null if lex look ahead 0 break statementast node stmt int start stmt lex index if parse statement stmt if start stmt lex index lex next token skip until statement else ast add statement stmt if lex look ahead 0 report error i18n expected else lex next token update pos ast start lex index node ast return true parsefunctionbody statementlistast kddebug lookahead parsefunctionbody lookahead nexttoken statementlistast createnode statementlistast lookahead isnull lookahead startstmt parsestatement startstmt nexttoken skipuntilstatement addstatement lookahead reporterror nexttoken update_pos bool parser skip expression ast node node kd debug 9007 tok lex look ahead 0 text parser skip expression endl int start lex index while lex look ahead 0 is null int tk lex look ahead 0 switch tk case skip lex next token break case skip lex next token break if 0 case token identifier lex next token if lex look ahead 0 token identifier return true break endif case case case case case case case token case case token default case token if case token while case token do case token for case token break case token continue case token return case token goto ast node ast create node ast update pos ast start lex index node ast return true default lex next token return false skipexpression kddebug lookahead skipexpression lookahead isnull lookahead nexttoken nexttoken token_identifier nexttoken lookahead token_identifier token_case token_default token_if token_while token_do token_for token_break token_continue token_return token_goto createnode update_pos nexttoken bool parser skip comma expression ast node node kd debug 9007 tok lex look ahead 0 text parser skip comma expression endl int start lex index ast node expr if skip expression expr return false q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if skip expression expr report error i18n expression expected return false ast node ast create node ast update pos ast start lex index node ast return true skipcommaexpression kddebug lookahead skipcommaexpression skipexpression qstring lookahead qstring advanceandchecktrailingcomment skipexpression reporterror createnode update_pos bool parser skip expression statement statementast node node kd debug 9007 tok lex look ahead 0 text parser skip expression statement endl int start lex index ast node expr skip comma expression expr advance expression statementast node ast create node expression statementast ast set expression expr update pos ast start lex index node ast return true skipexpressionstatement kddebug lookahead skipexpressionstatement skipcommaexpression expressionstatementast createnode expressionstatementast setexpression update_pos bool parser parse expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse expression endl int start lex index if parse comma expression node return false ast node ast create node ast update pos ast start lex index node ast return true parseexpression kddebug lookahead parseexpression parsecommaexpression createnode update_pos bool parser parse primary expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse primar expression endl switch lex look ahead 0 case token string literal ast node lit parse string literal lit return true case token number literal case token char literal case token true case token false lex next token return true case token this lex next token return true case token dynamic cast case token static cast case token reinterpret cast case token const cast lex next token check ast node type id parse type id type id check check ast node expr parse comma expression expr check return true case token typeid lex next token check ast node expr parse comma expression expr check return true case lex next token kd debug 9007 tok lex look ahead 0 text token lex look ahead 0 text endl ast node expr if parse expression expr return false check return true default int start lex index type specifierast node type spec if parse simple type specifier type spec lex look ahead 0 lex next token ast node expr parse comma expression expr check return true lex set index start nameast node name if parse name name return true return false parseprimaryexpression kddebug lookahead parseprimarexpression lookahead token_string_literal parsestringliteral token_number_literal token_char_literal token_true token_false nexttoken token_this nexttoken token_dynamic_cast token_static_cast token_reinterpret_cast token_const_cast nexttoken typeid parsetypeid typeid parsecommaexpression token_typeid nexttoken parsecommaexpression nexttoken kddebug lookahead lookahead parseexpression typespecifierast typespec parsesimpletypespecifier typespec lookahead nexttoken parsecommaexpression setindex parsename bool parser parse postfix expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse postfix expression endl ast node expr if parse primary expression expr return false while true switch lex look ahead 0 case lex next token ast node e parse comma expression e check break case lex next token ast node fun args parse comma expression fun args check break case token incr case token decr lex next token break case case token arrow lex next token if lex look ahead 0 token template lex next token nameast node name if parse name name return false break case token typename lex next token nameast node name if parse name name return false check ast node expr parse comma expression expr check return true default return true end switch end while return true parsepostfixexpression kddebug lookahead parsepostfixexpression parseprimaryexpression lookahead nexttoken parsecommaexpression nexttoken funargs parsecommaexpression funargs token_incr token_decr nexttoken token_arrow nexttoken lookahead token_template nexttoken parsename token_typename nexttoken parsename parsecommaexpression bool parser parse unary expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse unary expression endl switch lex look ahead 0 case token incr case token decr case case case case case case lex next token ast node expr return parse cast expression expr case token sizeof lex next token int index lex index if lex look ahead 0 lex next token ast node type id if parse type id type id lex look ahead 0 lex next token return true lex set index index ast node expr return parse unary expression expr case token new return parse new expression node case token delete return parse delete expression node return parse postfix expression node parseunaryexpression kddebug lookahead parseunaryexpression lookahead token_incr token_decr nexttoken parsecastexpression token_sizeof nexttoken lookahead nexttoken typeid parsetypeid typeid lookahead nexttoken setindex parseunaryexpression token_new parsenewexpression token_delete parsedeleteexpression parsepostfixexpression bool parser parse new expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse new expression endl if lex look ahead 0 token scope lex look ahead 1 token new lex next token check token new new if lex look ahead 0 lex next token ast node expr parse comma expression expr check if lex look ahead 0 lex next token ast node type id parse type id type id check else ast node type id parse new type id type id ast node init parse new initializer init return true parsenewexpression kddebug lookahead parsenewexpression lookahead token_scope lookahead token_new nexttoken token_new lookahead nexttoken parsecommaexpression lookahead nexttoken typeid parsetypeid typeid typeid parsenewtypeid typeid parsenewinitializer bool parser parse new type id ast node node kd debug 9007 tok lex look ahead 0 text parser parse new type id endl type specifierast node type spec if parse type specifier type spec ast node declarator parse new declarator declarator return true return false parsenewtypeid kddebug lookahead parsenewtypeid typespecifierast typespec parsetypespecifier typespec parsenewdeclarator bool parser parse new declarator ast node node kd debug 9007 tok lex look ahead 0 text parser parse new declarator endl ast node ptr op if parse ptr operator ptr op ast node declarator parse new declarator declarator return true if lex look ahead 0 while lex look ahead 0 lex next token ast node expr parse expression expr advance return true return false parsenewdeclarator kddebug lookahead parsenewdeclarator ptrop parseptroperator ptrop parsenewdeclarator lookahead lookahead nexttoken parseexpression bool parser parse new initializer ast node node kd debug 9007 tok lex look ahead 0 text parser parse new initializer endl if lex look ahead 0 return false lex next token ast node expr parse comma expression expr check return true parsenewinitializer kddebug lookahead parsenewinitializer lookahead nexttoken parsecommaexpression bool parser parse delete expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse delete expression endl if lex look ahead 0 token scope lex look ahead 1 token delete lex next token check token delete delete if lex look ahead 0 lex next token check ast node expr return parse cast expression expr parsedeleteexpression kddebug lookahead parsedeleteexpression lookahead token_scope lookahead token_delete nexttoken token_delete lookahead nexttoken parsecastexpression bool parser parse cast expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse cast expression endl int index lex index if lex look ahead 0 lex next token ast node type id if parse type id type id if lex look ahead 0 lex next token ast node expr if parse cast expression expr return true lex set index index ast node expr return parse unary expression expr parsecastexpression kddebug lookahead parsecastexpression lookahead nexttoken typeid parsetypeid typeid lookahead nexttoken parsecastexpression setindex parseunaryexpression bool parser parse pm expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse pm expression endl ast node expr if parse cast expression expr return false while lex look ahead 0 token ptrmem lex next token if parse cast expression expr return false return true parsepmexpression kddebug lookahead parsepmexpression parsecastexpression lookahead token_ptrmem nexttoken parsecastexpression bool parser parse multiplicative expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse multiplicative expression endl ast node expr if parse pm expression expr return false while lex look ahead 0 lex look ahead 0 lex look ahead 0 lex next token if parse pm expression expr return false return true parsemultiplicativeexpression kddebug lookahead parsemultiplicativeexpression parsepmexpression lookahead lookahead lookahead nexttoken parsepmexpression bool parser parse additive expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse additive expression endl ast node expr if parse multiplicative expression expr return false while lex look ahead 0 lex look ahead 0 lex next token if parse multiplicative expression expr return false return true parseadditiveexpression kddebug lookahead parseadditiveexpression parsemultiplicativeexpression lookahead lookahead nexttoken parsemultiplicativeexpression bool parser parse shift expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse shift expression endl ast node expr if parse additive expression expr return false while lex look ahead 0 token shift lex next token if parse additive expression expr return false return true parseshiftexpression kddebug lookahead parseshiftexpression parseadditiveexpression lookahead token_shift nexttoken parseadditiveexpression bool parser parse relational expression ast node node bool templ args kd debug 9007 tok lex look ahead 0 text parser parse relational expression endl ast node expr if parse shift expression expr return false while lex look ahead 0 lex look ahead 0 templ args lex look ahead 0 token leq lex look ahead 0 token geq lex next token if parse shift expression expr return false return true parserelationalexpression templargs kddebug lookahead parserelationalexpression parseshiftexpression lookahead lookahead templargs lookahead token_leq lookahead token_geq nexttoken parseshiftexpression bool parser parse equality expression ast node node bool templ args kd debug 9007 tok lex look ahead 0 text parser parse equality expression endl ast node expr if parse relational expression expr templ args return false while lex look ahead 0 token eq lex look ahead 0 token not eq lex next token if parse relational expression expr templ args return false return true parseequalityexpression templargs kddebug lookahead parseequalityexpression parserelationalexpression templargs lookahead token_eq lookahead token_not_eq nexttoken parserelationalexpression templargs bool parser parse and expression ast node node bool templ args kd debug 9007 tok lex look ahead 0 text parser parse and expression endl ast node expr if parse equality expression expr templ args return false while lex look ahead 0 lex next token if parse equality expression expr templ args return false return true parseandexpression templargs kddebug lookahead parseandexpression parseequalityexpression templargs lookahead nexttoken parseequalityexpression templargs bool parser parse exclusive or expression ast node node bool templ args kd debug 9007 tok lex look ahead 0 text parser parse exclusive or expression endl ast node expr if parse and expression expr templ args return false while lex look ahead 0 lex next token if parse and expression expr templ args return false return true parseexclusiveorexpression templargs kddebug lookahead parseexclusiveorexpression parseandexpression templargs lookahead nexttoken parseandexpression templargs bool parser parse inclusive or expression ast node node bool templ args kd debug 9007 tok lex look ahead 0 text parser parse inclusive or expression endl ast node expr if parse exclusive or expression expr templ args return false while lex look ahead 0 lex next token if parse exclusive or expression expr templ args return false return true parseinclusiveorexpression templargs kddebug lookahead parseinclusiveorexpression parseexclusiveorexpression templargs lookahead nexttoken parseexclusiveorexpression templargs bool parser parse logical and expression ast node node bool templ args kd debug 9007 tok lex look ahead 0 text parser parse logical and expression endl ast node expr if parse inclusive or expression expr templ args return false while lex look ahead 0 token and lex next token if parse inclusive or expression expr templ args return false return true parselogicalandexpression templargs kddebug lookahead parselogicalandexpression parseinclusiveorexpression templargs lookahead token_and nexttoken parseinclusiveorexpression templargs bool parser parse logical or expression ast node node bool templ args kd debug 9007 tok lex look ahead 0 text parser parse logical or expression endl int start lex index ast node expr if parse logical and expression expr templ args return false while lex look ahead 0 token or lex next token if parse logical and expression expr templ args return false ast node ast create node ast update pos ast start lex index node ast return true parselogicalorexpression templargs kddebug lookahead parselogicalorexpression parselogicalandexpression templargs lookahead token_or nexttoken parselogicalandexpression templargs createnode update_pos bool parser parse conditional expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse conditional expression endl ast node expr if parse logical or expression expr return false if lex look ahead 0 lex next token if parse expression expr return false check if parse assignment expression expr return false return true parseconditionalexpression kddebug lookahead parseconditionalexpression parselogicalorexpression lookahead nexttoken parseexpression parseassignmentexpression bool parser parse assignment expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse assignment expression endl int start lex index ast node expr if lex look ahead 0 token throw parse throw expression expr return false else if parse conditional expression expr return false while lex look ahead 0 token assign lex look ahead 0 lex next token if parse conditional expression expr return false ast node ast create node ast update pos ast start lex index node ast return true parseassignmentexpression kddebug lookahead parseassignmentexpression lookahead token_throw parsethrowexpression parseconditionalexpression lookahead token_assign lookahead nexttoken parseconditionalexpression createnode update_pos bool parser parse constant expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse constant expression endl int start lex index if parse conditional expression node ast node ast create node ast update pos ast start lex index node ast return true return false parseconstantexpression kddebug lookahead parseconstantexpression parseconditionalexpression createnode update_pos bool parser parse comma expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse comma expression endl int start lex index ast node expr if parse assignment expression expr return false q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if parse assignment expression expr return false if comment is empty expr set comment comment ast node ast create node ast update pos ast start lex index node ast return true parsecommaexpression kddebug lookahead parsecommaexpression parseassignmentexpression qstring lookahead qstring advanceandchecktrailingcomment parseassignmentexpression isempty setcomment createnode update_pos bool parser parse throw expression ast node node kd debug 9007 tok lex look ahead 0 text parser parse throw expression endl if lex look ahead 0 token throw return false check token throw throw ast node expr if parse assignment expression expr return false return true parsethrowexpression kddebug lookahead parsethrowexpression lookahead token_throw token_throw parseassignmentexpression bool parser parse condition conditionast node node kd debug 9007 tok lex look ahead 0 text parser parse condition endl int start lex index conditionast node ast create node conditionast type specifierast node spec if parse type specifier spec declaratorast node decl if parse declarator decl lex look ahead 0 lex next token ast node expr if skip expression expr ast set type spec spec ast set declarator decl ast set expression expr update pos ast start lex index node ast return true lex set index start ast node expr if skip comma expression expr return false ast set expression expr update pos ast start lex index node ast return true parsecondition kddebug lookahead parsecondition createnode typespecifierast parsetypespecifier parsedeclarator lookahead nexttoken skipexpression settypespec setdeclarator setexpression update_pos setindex skipcommaexpression setexpression update_pos bool parser parse statement statementast node node thanks to fiore 8080 it kd debug 9007 tok lex look ahead 0 text parser parse statement endl switch lex look ahead 0 case token while return parse while statement node case token do return parse do statement node case token for return parse for statement node case token if return parse if statement node case token switch return parse switch statement node case token try return parse try block statement node case token case case token default return parse labeled statement node case token break case token continue lex next token advance return true case token goto lex next token advance token identifier identifier advance return true case token return lex next token ast node expr skip comma expression expr advance return true case return parse compound statement node case token identifier if parse labeled statement node return true break kd debug 9007 try with declaration statement endl if parse declaration statement node return true return skip expression statement node parsestatement kddebug lookahead parsestatement lookahead token_while parsewhilestatement token_do parsedostatement token_for parseforstatement token_if parseifstatement token_switch parseswitchstatement token_try parsetryblockstatement token_case token_default parselabeledstatement token_break token_continue nexttoken token_goto nexttoken token_identifier token_return nexttoken skipcommaexpression parsecompoundstatement token_identifier parselabeledstatement kddebug parsedeclarationstatement skipexpressionstatement bool parser parse while statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse while statement endl int start lex index advance token while while advance conditionast node cond if parse condition cond report error i18n condition expected return false advance statementast node body if parse statement body report error i18n statement expected return false while statementast node ast create node while statementast ast set condition cond ast set statement body update pos ast start lex index node ast return true parsewhilestatement kddebug lookahead parsewhilestatement token_while parsecondition reporterror parsestatement reporterror whilestatementast createnode whilestatementast setcondition setstatement update_pos bool parser parse do statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse do statement endl int start lex index advance token do do statementast node body if parse statement body report error i18n statement expected return false advance nr token while while advance nr ast node expr if skip comma expression expr report error i18n expression expected return false advance nr advance nr do statementast node ast create node do statementast ast set statement body ast set condition condition update pos ast start lex index node ast return true parsedostatement kddebug lookahead parsedostatement token_do parsestatement reporterror advance_nr token_while advance_nr skipcommaexpression reporterror advance_nr advance_nr dostatementast createnode dostatementast setstatement setcondition update_pos bool parser parse for statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse for statement endl int start lex index advance token for for advance statementast node init if parse for init statement init report error i18n for initialization expected return false conditionast node cond parse condition cond advance ast node expr skip comma expression expr advance statementast node body if parse statement body return false for statementast node ast create node for statementast ast set init statement init ast set condition cond ast set expression expression ast set statement body update pos ast start lex index node ast return true parseforstatement kddebug lookahead parseforstatement token_for parseforinitstatement reporterror parsecondition skipcommaexpression parsestatement forstatementast createnode forstatementast setinitstatement setcondition setexpression setstatement update_pos bool parser parse compound statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse compound statement endl int start lex index if lex look ahead 0 return false lex next token statement listast node ast create node statement listast while lex look ahead 0 is null if lex look ahead 0 break statementast node stmt int start stmt lex index if parse statement stmt if start stmt lex index lex next token skip until statement else ast add statement stmt if lex look ahead 0 report error i18n expected else lex next token update pos ast start lex index node ast return true parsecompoundstatement kddebug lookahead parsecompoundstatement lookahead nexttoken statementlistast createnode statementlistast lookahead isnull lookahead startstmt parsestatement startstmt nexttoken skipuntilstatement addstatement lookahead reporterror nexttoken update_pos bool parser parse for init statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse for init statement endl if parse declaration statement node return true return skip expression statement node parseforinitstatement kddebug lookahead parseforinitstatement parsedeclarationstatement skipexpressionstatement bool parser parse if statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse if statement endl int start lex index advance token if if advance if statementast node ast create node if statementast conditionast node cond if parse condition cond report error i18n condition expected return false advance statementast node stmt if parse statement stmt report error i18n statement expected return false ast set condition cond ast set statement stmt if lex look ahead 0 token else lex next token statementast node else stmt if parse statement else stmt report error i18n statement expected return false ast set else statement else stmt update pos ast start lex index node ast return true parseifstatement kddebug lookahead parseifstatement token_if ifstatementast createnode ifstatementast parsecondition reporterror parsestatement reporterror setcondition setstatement lookahead token_else nexttoken elsestmt parsestatement elsestmt reporterror setelsestatement elsestmt update_pos bool parser parse switch statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse switch statement endl int start lex index advance token switch switch advance conditionast node cond if parse condition cond report error i18n condition expected return false advance statementast node stmt if parse compound statement stmt syntax error return false switch statementast node ast create node switch statementast ast set condition cond ast set statement stmt update pos ast start lex index node ast return true parseswitchstatement kddebug lookahead parseswitchstatement token_switch parsecondition reporterror parsecompoundstatement syntaxerror switchstatementast createnode switchstatementast setcondition setstatement update_pos bool parser parse labeled statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse labeled statement endl switch lex look ahead 0 case token identifier case token default if lex look ahead 1 lex next token lex next token statementast node stmt if parse statement stmt node stmt return true break case token case lex next token ast node expr if parse constant expression expr report error i18n expression expected else if lex look ahead 0 token ellipsis lex next token ast node expr2 if parse constant expression expr2 report error i18n expression expected advance statementast node stmt if parse statement stmt node stmt return true break return false parselabeledstatement kddebug lookahead parselabeledstatement lookahead token_identifier token_default lookahead nexttoken nexttoken parsestatement token_case nexttoken parseconstantexpression reporterror lookahead token_ellipsis nexttoken parseconstantexpression reporterror parsestatement bool parser parse declaration statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse declaration statement endl int start lex index declarationast node decl if parse block declaration decl return false declaration statementast node ast create node declaration statementast ast set declaration decl update pos ast start lex index node ast kd debug 9007 found a block declaration endl return true parsedeclarationstatement kddebug lookahead parsedeclarationstatement parseblockdeclaration declarationstatementast createnode declarationstatementast setdeclaration update_pos kddebug bool parser parse try block statement statementast node node kd debug 9007 tok lex look ahead 0 text parser parse try block statement endl if lex look ahead 0 token try return false lex next token statementast node stmt if parse compound statement stmt syntax error return false if lex look ahead 0 token catch report error i18n catch expected return false while lex look ahead 0 token catch lex next token advance conditionast node cond if parse condition cond report error i18n condition expected return false advance statementast node body if parse compound statement body syntax error return false node stmt return true parsetryblockstatement kddebug lookahead parsetryblockstatement lookahead token_try nexttoken parsecompoundstatement syntaxerror lookahead token_catch reporterror lookahead token_catch nexttoken parsecondition reporterror parsecompoundstatement syntaxerror bool parser parse objc def declarationast node node q unused node return false parseobjcdef q_unused bool parser parse objc class def declarationast node node q unused node return false parseobjcclassdef q_unused bool parser parse objc class decl declarationast node node q unused node advance objc class class groupast node id list parse identifier list id list advance return true parseobjcclassdecl q_unused objc_class idlist parseidentifierlist idlist bool parser parse objc protocol decl declarationast node node q unused node advance objc protocol protocol groupast node id list parse identifier list id list advance return true parseobjcprotocoldecl q_unused objc_protocol idlist parseidentifierlist idlist bool parser parse objc alias decl declarationast node node q unused node advance objc alias alias groupast node id list parse identifier list id list advance return true parseobjcaliasdecl q_unused objc_alias idlist parseidentifierlist idlist bool parser parse objc protocol def declarationast node node q unused node return false parseobjcprotocoldef q_unused bool parser parse objc method def declarationast node node q unused node return false parseobjcmethoddef q_unused bool parser parse ivar decl list ast node node q unused node return false parseivardecllist q_unused bool parser parse ivar decls ast node node q unused node return false parseivardecls q_unused bool parser parse ivar decl ast node node q unused node return false parseivardecl q_unused bool parser parse ivars ast node node q unused node return false parseivars q_unused bool parser parse ivar declarator ast node node q unused node return false parseivardeclarator q_unused bool parser parse method decl ast node node q unused node return false parsemethoddecl q_unused bool parser parse unary selector ast node node q unused node return false parseunaryselector q_unused bool parser parse keyword selector ast node node q unused node return false parsekeywordselector q_unused bool parser parse selector ast node node q unused node return false parseselector q_unused bool parser parse keyword decl ast node node q unused node return false parsekeyworddecl q_unused bool parser parse receiver ast node node q unused node return false parsereceiver q_unused bool parser parse objc message expr ast node node q unused node return false parseobjcmessageexpr q_unused bool parser parse message args ast node node q unused node return false parsemessageargs q_unused bool parser parse keyword expr ast node node q unused node return false parsekeywordexpr q_unused bool parser parse keyword arg list ast node node q unused node return false parsekeywordarglist q_unused bool parser parse keyword arg ast node node q unused node return false parsekeywordarg q_unused bool parser parse reserved word ast node node q unused node return false parsereservedword q_unused bool parser parse my parms ast node node q unused node return false parsemyparms q_unused bool parser parse my parm ast node node q unused node return false parsemyparm q_unused bool parser parse opt parm list ast node node q unused node return false parseoptparmlist q_unused bool parser parse objc selector expr ast node node q unused node return false parseobjcselectorexpr q_unused bool parser parse selector arg ast node node q unused node return false parseselectorarg q_unused bool parser parse keyword name list ast node node q unused node return false parsekeywordnamelist q_unused bool parser parse keyword name ast node node q unused node return false parsekeywordname q_unused bool parser parse objc encode expr ast node node q unused node return false parseobjcencodeexpr q_unused bool parser parse objc string ast node node q unused node return false parseobjcstring q_unused bool parser parse protocol refs ast node node q unused node return false parseprotocolrefs q_unused bool parser parse identifier list groupast node node int start lex index if lex look ahead 0 token identifier return false groupast node ast create node groupast ast from token tk lex index ast add node tk lex next token q string comment while lex look ahead 0 comment q string null advance and check trailing comment comment if lex look ahead 0 token identifier ast from token tk lex index ast add node tk lex next token advance token identifier identifier node ast update pos node start lex index return true parseidentifierlist lookahead token_identifier createnode ast_from_token addnode nexttoken qstring lookahead qstring advanceandchecktrailingcomment lookahead token_identifier ast_from_token addnode nexttoken token_identifier update_pos bool parser parse identifier colon ast node node q unused node if lex look ahead 0 token identifier lex look ahead 1 lex next token lex next token return true else if ptypename return true return false parseidentifiercolon q_unused lookahead token_identifier lookahead nexttoken nexttoken bool parser parse objc protocol expr ast node node q unused node return false parseobjcprotocolexpr q_unused bool parser parse objc open bracket expr ast node node q unused node return false parseobjcopenbracketexpr q_unused bool parser parse objc close bracket ast node node q unused node return false parseobjcclosebracket q_unused bool parser skip until int token kd debug 9007 tok lex look ahead 0 text parser skip until endl while lex look ahead 0 is null if lex look ahead 0 token return true lex next token return false skipuntil kddebug lookahead skipuntil lookahead isnull lookahead nexttoken bool parser skip until declaration kd debug 9007 tok lex look ahead 0 text parser skip until declaration endl while lex look ahead 0 is null switch lex look ahead 0 case case case token scope case token identifier case token operator case token char case token wchar t case token bool case token short case token int case token long case token signed case token unsigned case token float case token double case token void case token extern case token namespace case token using case token typedef case token asm case token template case token export case token const cv case token volatile cv case token public case token protected case token private case token signals qt case token slots qt return true case return false default lex next token return false skipuntildeclaration kddebug lookahead skipuntildeclaration lookahead isnull lookahead token_scope token_identifier token_operator token_char token_wchar_t token_bool token_short token_int token_long token_signed token_unsigned token_float token_double token_void token_extern token_namespace token_using token_typedef token_asm token_template token_export token_const token_volatile token_public token_protected token_private token_signals token_slots nexttoken bool parser skip until statement kd debug 9007 tok lex look ahead 0 text parser skip until statement token lex look ahead 0 text endl while lex look ahead 0 is null switch lex look ahead 0 case case case case token const case token volatile case token identifier case token case case token default case token if case token switch case token while case token do case token for case token break case token continue case token return case token goto case token try case token catch case token throw case token char case token wchar t case token bool case token short case token int case token long case token signed case token unsigned case token float case token double case token void case token class case token struct case token union case token enum case token scope case token template case token using return true default lex next token return false skipuntilstatement kddebug lookahead skipuntilstatement lookahead lookahead isnull lookahead token_const token_volatile token_identifier token_case token_default token_if token_switch token_while token_do token_for token_break token_continue token_return token_goto token_try token_catch token_throw token_char token_wchar_t token_bool token_short token_int token_long token_signed token_unsigned token_float token_double token_void token_class token_struct token_union token_enum token_scope token_template token_using nexttoken bool parser skip int l int r int count 0 while lex look ahead 0 is null int tk lex look ahead 0 if tk l count else if tk r count else if l tk tk tk return false if count 0 return true lex next token return false lookahead isnull lookahead nexttoken autolayout graphviz node graphviz node agnode t node n node graphviznode graphviznode agnode_t graphviz node graphviz node graphviznode graphviznode