SyntaxofTheCProgrammingLanguage.doc

上传人:博****1 文档编号:559843750 上传时间:2023-01-21 格式:DOC 页数:10 大小:245.51KB
返回 下载 相关 举报
SyntaxofTheCProgrammingLanguage.doc_第1页
第1页 / 共10页
SyntaxofTheCProgrammingLanguage.doc_第2页
第2页 / 共10页
SyntaxofTheCProgrammingLanguage.doc_第3页
第3页 / 共10页
SyntaxofTheCProgrammingLanguage.doc_第4页
第4页 / 共10页
SyntaxofTheCProgrammingLanguage.doc_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《SyntaxofTheCProgrammingLanguage.doc》由会员分享,可在线阅读,更多相关《SyntaxofTheCProgrammingLanguage.doc(10页珍藏版)》请在金锄头文库上搜索。

1、Syntax of The C Programming LanguageCross-Refferences1. ASCII:= See http:/www.csci.csusb.edu/dick/samples/comp.text.ASCII.html Used_in The definition of C+ c+.syntax.html Used_in The definition of Java java.syntax.html NotationThis uses my XBNF Extended BNF Notation where | indicates or, (.) indicat

2、es priority. For more information see intro_ebnf.html The following abbreviations are also used: 1. O(_):= 0 or 1 occurrences, 2. N(_):= 1 or more occurrence 3. L(_):= a comma separated list 4. #(_):= 0 or more occurrences. 5. S(E,Op):=serial_operator_expression(E, Op) 6. serial_operator_expression(

3、E,Op):= E #(Op E). S(E,Op) = E Op E Op E Op . EIt also uses the following shorthand Lexemes7. identifier:=nondigit #(nondigit | digit), 8. nondigit:=_ | a | A | b | B | c | C | d | D | e | E | f | F | g | G | h | H | i | I | j | J | k | K | l | L | m | M | n | N | o | O | p | P | q | Q | r | R | s |

4、 S | t | T | u | U | v | V | w | W | x | X | y | Y | z | Z, 9. digit:=0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9, 10. punctuator:= | | ( | ) | | | * | , | : | = | ; | . | #, 11. operator:= | | ( | ) | . | - | + | - | & | * | + | - | | ! | sizeof | / | % | | | = | = | != | | | | & | | | ? | : | = | *= | /

5、= | %= | += | -= | = | &= | = | |= | , | # | #, 12. infix:= - | & | * | + | - | / | % | | | = | = | != | | | | & | | | = | *= | /= | %= | += | -= | = | &= | = | |= | , , 13. prefix:= + | - | & | * | + | - | | ! | sizeof , 14. postfix:= + | -, 15. integer_suffix:=#(unsigned_suffix) | #(long_suffix),

6、16. unsigned_suffix:=u | U, 17. long_suffix:=l | L, 18. sign:=+ | -, 19. octal_constant:=0 #(octal_digit), 20. octal_digit:=0 | 1 | 2 | 3 | 4 | 5 | 6 | 7, 21. hex_constant:=(0x | 0X) (hex_digit), 22. hex_digit:=0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f | A | B | C | D | E | F, 23

7、. decimal_constant:=non_zero_digit #(digit), 24. non_zero_digit:=1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9, 25. integer_constant:=(decimal_constant | octal_constant | hex_constant) | integer_suffix, 26. float_suffix:=f | l | F | L, 27. fraction:=#digit . digit #digit, 28. exponent_part:=(e | E) sign #(digit

8、), 29. float_constant:=fraction (exponent_part|) (float_suffix|)|(decimal_constant (exponent_part|) float_suffix, 30. enumeration_constant:=identifier, 31. char_constant:=char(double_quote|eoln|backslash)| escape_sequence, 32. escape_sequence:=backslash (char | 0 #octal_digit |0x#hexadecimal_digit),

9、 33. character_constant:= char_constant , constant :=:=float_constant | integer_constant | enumeration_constant | character_constant, 34. string_char:=char(double_quote|eoln|backslash)| escape_sequence, 35. string_literal:=double_quote #(string_char) double_quote, . . . . . . . . . ( end of section

10、Lexemes) ExpressionsExpressions are made up by applying operators to primary_expressions. 36. primary_expression:= variable | constant | string_literal | ( expression ), 37. variable:= identifier & declared and in scope of declaration. 38. argument_list:=List(assignment_expression), OperatorsSymbol

11、See (. ) primary_expression cast_expression function_call . part of a structure - additive_expression unary_expression - part of a pointed at structure - unary_expression postfix_expression -= assignment_expression & AND_expression bitwise Boolean &= assignment_expression & address_of unary_expressi

12、on & logical_AND_expression * multiplicative_expression contents of pointer unary_expression *= assignment_expression + additive_expression unary_expression + unary_expression postfix_expression += assignment_expression bitwise negation prefix ! logical negation prefix != equality_expression sizeof

13、unary_expression / multiplicative_expression divide /= assignment_expression % multiplicative_expression mod %= assignment_expression relational_expression shift_expression left = assignment_expression relational_expression shift_expression right = relational_expression = assignment_expression = equality_expression = assignment_expression XOR_expression exclusive-or bitwise = assignme

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号