Simple grammar (for example in C Language)

Source: Internet
Author: User

<program>:

External_declaration

| Program External_declaration

<external_declaration>://external statement

Function_definition

| Declaration

<function_definition>://functions

Type_specifier Declarator//specifier

Compound_statement//mixed statement

<declaration>://declaration

Symbol//symbols identifier ' < ' identifier ' > ' declaration

|type_specifier variate '; ' Declaration

|identifier ' {' body '} '

<body>://function body

Type_specifier variate '; '

|initializer//initialization

<initializer>://initialization

Variate Initializer

| Symbol Initializer

<type_specifier>://type

Void

|char

|int

|float

|double

<identifier>://identifier Header File

Include

| Define

|stdio.h

|math.h

|stdlib.h

|time.h

|string.h

|main ' (') '

<statement>://statements, statements

Udge_statement

|jump_statement

|iteration_statement

|selection_statement

<Judge_statement>://judgment

Selection_statement

: If ' (' expression ') ' statement

|if ' (' expression ') ' statement ELSE statement

<iteration_statement>://cycle

While ' (' expression ') ' statement

| For ' (' expression_statement expression_statement ') ' statement

| For ' (' expression_statement expression_statement expression ') ' statement

<jump_statement>://jump characters

Continue '; '

|break '; ’

|return '; '

|return ' (') '; '

<symbol >://symbols

#

|+

|=

|-

|

|

<bracket>://brackets

(

|)

| {

|}

<pointer >://hands

‘*‘

| ' * ' variate//variable

<variate;://variables

A variate

|b variate

|c variate

|.....

|z variate

Simple grammar (for example in C Language)

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.