in c, logical false is reresented by any zero value and true by any nonzero value. here is

Upload: bonadefkijio

Post on 30-May-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    1/15

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    2/15

    8. initializer::=assignment_expression | initializer_list,

    9. initializer_list::=List(initializer),

    10. declarator_initialized::=declarator ("=" initializer),

    Structs and Unions

    11. structure_declarator::=declarator | declarator ":" constant_expression,

    12. structure_declarator_list::=List(structure_declarator),

    13. structure_declaration::=(type_specifier | type_qualifier) structure_declarator_list ";" ,

    14. struct_union_specifier::=struct_union identifier | struct_union identifier

    "{"structure_declarator_list "}",

    15. struct_union::=( "struct" | "union" ),

    Enums16. enumeration_value::=enumeration_constant ("=" constant_expression|)

    17. enumeration_list::=List(enumeration_value ),

    18. enumeration_specifier::=enumeration_identifier | "enum" identifier

    "{"enumeration_list"}",

    Functions

    19. function_definition::=declaration_specifier declarator | declaration_list |

    compound_statement,

    20. parameter_declaration::=#declaration_specifier declarator | abstract_declarator,

    21. parameter_list::=List(parameter_declaration) (",..."|),

    Main Function

    A complete C program has to have a function with name 'main'. This is the function

    called by the operating system. It must return an int value indicating whether the prograam executed

    correctly or if there was an error. In UNIX, the main program returns 0 to indicate no errors. Their

    are several valid forms:

    22. int main()

    23. int main(argc, argv)24. int main(argc, argv, envp) The parameters are set up by the operating system when the

    program starts. The traditional arg stands for argument.

    Pointers

    25. pointer::=#( "*" | #type_qualifier),

    26. declarator::=pointer | direct_declarator,

    Functions and Arrays

    27. post_declarator::="["constant_expression"]" | "("parameter_list")" | "("identifier_list")"

    28. direct_declarator::=identifier | "("declarator")" | direct_declarator post_declarator,

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    3/15

    29. abstract_declarator::=pointer | pointer direct_abstract_declarator,

    30. direct_abstract_declarator::= "(" abstract_declarator ")" | O( direct_abstract_declarator)

    O("[" O(constant_expression) "]" | "(" O(parameter_list) ")" ),

    . . . . . . . . . ( end of section Declarations)

    Statements1. statement::=labeled_statement | compound_statement | expression_statement |

    selection_statement | iteration_statement | jump_statement

    Branch

    2. jump_statement::="goto" identifier";" | "continue" ";" | "break;" | "return" expression

    ";",

    Structured

    3. loop::=iteration_statement.

    4. iteration_statement::="while" "("expression")" statement | "do" statement "while"

    "("expression")" ";" | for_statement.

    5. for_statement::="for" "("expression ";" expression ";" expression")" statement,

    6. selection_statement::=if_statement | "switch" "("expression")" statement,

    7. if_statement::="if ("expression")" statement | "if" "("expression")" statement "else"

    statement.

    8. expression_statement::= expression ";",

    9. labeled_statement::=identifier ":" statement | "case" constant_expression ":" statement |

    "default" ":" statement,

    Compound

    10. compound_statement::=block | "{" #statement "}",

    11. block::="{" declaration #declaration #statement "}",

    . . . . . . . . . ( end of section Statements)

    Pre-Processor Commands

    1. preprocess_token::=identifier | constant | string_literal | operator | punctuator | each

    Non-white space not one of the previous,

    2. header_char::=any character except new_line | and | >,

    3. header_name::=#(header_char),

    4. new_line::=new_line character,

    5. Left_paren::=left parenthesis with no white space before it,

    6. control_line::="#include" (#(preprocess_token | header_name) new_line | "#define"

    identifier #(preprocess_token) new_line | "#define" identifier left_paren identifier_list

    #(preprocess_token) new_line, | "#undef" identifier new_line | "#line" preprocess_token new_line |

    "#error" preprocess_token new_line | "#pragma" preprocess_token new_line | "#"new_line,

    7. endif_line::="#endif" new_line,

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    4/15

    8. elif_group::="#elif" constant_expression new_line pp_group,

    9. else_group::="#else" new_line pp_group,

    10. if_group::=("#if" constant_expression | "#ifdef" identifier | "#ifndef" identifier)

    new_line pp_group,

    11. if_part::=if_group #(elif_group) else_group endif_line,

    12. pp_part::=#preprocess_token new_line | if_part | control_line,

    13. pp_group::=#(pp_part),

    . . . . . . . . . ( end of section Pre-Processor Commands)

    . . . . . . . . . ( end of section Syntax of The C Programming Language)

    End

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    5/15

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    6/15

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    7/15

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    8/15

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    9/15

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    10/15

    Parman

    go to

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    11/15

    budi

    luhur

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    12/15

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    13/15

    Parman

    go to

    budi

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    14/15

    luhur

  • 8/9/2019 In C, Logical False is Reresented by Any Zero Value and True by Any Nonzero Value. Here Is

    15/15