C Language Grammar definition

Source: Internet
Author: User

< parameter declaration >→< declaration specifier >< designator >
< compound statement >→<{}>|<{statement List}>|<{Declaration list Statement list}>
< declaration list >→< declaration >|< claim List declaration >
< declaration >→< initial specifier >|< initial descriptor, initial specifier >
< initial specifier >→< specifier >|< specifier = Initial set-up >
< initial set-up >→< assignment expression >|<{Initial set table}>|< Initial set table,>
< initial set-up table >→< Initial set >|< initial set-up table, initial set-up >
< statement tables >→< statements >|< statement tables >< statements >
< statements >→< Compound statements >|< expression Statements >|< SELECT statements >|< iteration statements >|< jump statements >
< expression statements >→;|< expressions;>
< SELECT statement >→<if (expression) statement >|<if (expression) statement-Else Statement >
< iteration statement >→<while (expression) >|<for (expression Statement expression statement) >|<for (expression statement expression statement expression) >
< jump statement >→continue;|break;|return;|return expression;
< expressions >→< Assignment Expressions >|< Expressions >< Assignment Expressions >
< Assignment expressions >→< conditional expressions >|< unary Expressions >< Assignment Expressions >< Assignment Expressions >
< conditional expression >→< logical OR expression >|< logical or expression >?< expression >:< conditional expression >
< logic or expressions >→< logic and expressions >|< logic or expressions >< logic and Expressions >
< logic and Expressions >→< containment or expression >|< logic and expressions >< containment or expression >
< containment or expression >→< XOR expression >|< containment or expression > ' | ' < XOR expressions >
< XOR expressions >→< and Expressions >|< xor expressions > ' ^ ' < and expressions >
< and expressions >→< equality expressions >|< and Expressions > ' & ' < equality expressions >
< equality expressions >→< relational Expressions >|< equality expressions >EQ_OP< relational Expressions >|< equality expressions >NE_OP< Relational Expressions >
< relationship Expressions >→< transformation Expressions >|< Relationship Expressions > ' < ' < transition expressions >|< relational expressions > ' > ' < transition expressions >|< relationship Expressions >le_ op< transformation Expression >|< Relationship expression >GE_OP< Transformation expression >
< transformation Expressions >→< addition Expressions >|< Transformation Representations >LEFT_OP< addition expressions >|< Transformation Expressions >RIGHT_OP< Addition expressions >
< addition expressions >→< multiplication Expressions >|< addition expressions > ' + ' < multiplicative expressions >|< addition expressions > '-' < multiplicative expressions >
< multiplication Expressions >→< transformation Expressions >|< Multiplication Expressions > ' * ' < transformation expressions >|< multiplicative expressions > '/' < transformation expressions >|< multiplicative expressions > '% ' < Transformational Expressions >
< transformation expressions >→< unary expressions >| (type name) < unary expression >
< unary expression >→< suffix expression >| inc_op< One-dollar expression >| dec_op< unary expressions >|< unary Expressions >< transformation Expressions >| sizeof< One-dollar expression >| SIZEOF (type name)
< Postfix expression >→< primary expression >|< postfix expression >[expression]|< suffix expression > () |< suffix expression > (argument expression list) |< suffix expression;. identifier |< Suffix expression >ptr_op identifier |< suffix expression >INC_OP|< suffix expression >dec_op
< main expression >→< identifier >| constant|< string literal >| (expression)
< parameter expression list >→< assignment expression >|< parameter expression list >< assignment expression >
< unary operator >→&|*|+|-|~|!
< Assignment operators >→< multiple allocations >|< dividend distribution >|< modulo allocation >|< Add allocation >|< sub-allocation >|< leave allocation >|< correct allocation >|< and allocation >
< storage class Descriptor >→< TYPEDEF >|< EXTERN >|< STATIC >|< AUTO >|< REGISTER >
< struct or union specifier >→< struct or union specifier >< struct declaration list >|< struct or union >< struct declaration list >|< struct or union >< identifier >
< structure or union >→< struct >|< Union >
< struct declaration list >→< struct declaration >|< struct declaration >< struct Declaration list >
< struct declaration >→< specifier qualifier list >< struct specifier >
< descriptor qualifier List >→< type specifier >< specifier qualifier list >|< type specifier >|< specifier qualifier list >|< type qualifier >
< structure description list characters >→< structure specifier >|< structure Description list characters >< struct specifier >
< structure specifier >→< specifier >|< constant expression >|< constant expression >< Descriptor >
< enumeration specifier >→< Enumerator list >|< enum identifier >< enumerator list >|< enum identifier >
< enumeration identifiers >→< enumerations >|< enumeration identifiers >< Enumerations >
< enumerations >→< identifiers >|< constant expressions >< identifiers >
< type qualifiers >→< constants >|< Volatility >
< type qualifier list >→< type qualifier >|< type qualifier list >< type qualifier >
< parameter type list >→< parameter list >|< parameter list >< ellipsis >
< parameter list >→< parameter declaration >|< parameter list >< parameter declaration >
< type name >→< descriptor qualifier List >|< specifier qualifier List >< digest specifier >
< digest specifier >→< pointer >|< Direct abstract specifier >|< pointer >< direct abstract specifier >
< direct abstract specifier >→< abstract specifier >|< constant expression >|< ' ['] ' >|< direct abstract specifier >< ' ['] ' >|< direct abstract specifier >< ' [ ' constant-expression '] ' | ' (') ' | ' (' parameter Type list ') ' |< direct abstract specifier > ' (') ' |< direct abstract specifier > ' (' parameter Type list ') '
< tag statements >→< identifiers >< declarations >|< constant Expressions >< statements >|< default >< declarations >

C Language Grammar definition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.