本文主要是介绍GCC主要数据结构之c_parser,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
/* The actual parser and external interface. ??? Does this need to begarbage-collected? */
static GTY (()) c_parser *the_parser;
/* A parser structure recording information about the state andcontext of parsing. Includes lexer information with up to twotokens of look-ahead; more are not needed for C. */ struct GTY(()) c_parser {/* The look-ahead tokens. */c_token * GTY((skip)) tokens;/* Buffer for look-ahead tokens. */c_token tokens_buf[4];/* How many look-ahead tokens are available (0 - 4, ormore if parsing from pre-lexed tokens). */unsigned int tokens_avail;/* True if a syntax error is being recovered from; false otherwise.c_parser_error sets this flag. It should clear this flag whenenough tokens have been consumed to recover from the error. */BOOL_BITFIELD error : 1;/* True if we're processing a pragma, and shouldn't automaticallyconsume CPP_PRAGMA_EOL. */BOOL_BITFIELD in_pragma : 1;/* True if we're parsing the outermost block of an if statement. */BOOL_BITFIELD in_if_block : 1;/* True if we want to lex an untranslated string. */BOOL_BITFIELD lex_untranslated_string : 1;
/* Objective-C specific parser/lexer information. */
/* True if we are in a context where the Objective-C "PQ" keywordsare considered keywords. */BOOL_BITFIELD objc_pq_context : 1;/* True if we are parsing a (potential) Objective-C foreachstatement. This is set to true after we parsed 'for (' and whilewe wait for 'in' or ';' to decide if it's a standard C for loop or anObjective-C foreach loop. */BOOL_BITFIELD objc_could_be_foreach_context : 1;/* The following flag is needed to contextualize Objective-C lexicalanalysis. In some cases (e.g., 'int NSObject;'), it isundesirable to bind an identifier to an Objective-C class, evenif a class with that name exists. */BOOL_BITFIELD objc_need_raw_identifier : 1;/* Nonzero if we're processing a __transaction statement. The valueis 1 | TM_STMT_ATTR_*. */unsigned int in_transaction : 4;/* True if we are in a context where the Objective-C "Property attribute"keywords are valid. */BOOL_BITFIELD objc_property_attr_context : 1;
/* Cilk Plus specific parser/lexer information. */
/* Buffer to hold all the tokens from parsing the vector attribute for theSIMD-enabled functions (formerly known as elemental functions). */vec <c_token, va_gc> *cilk_simd_fn_tokens; };
这篇关于GCC主要数据结构之c_parser的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!