]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Grammar/Grammar
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Grammar / Grammar
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Grammar/Grammar b/AppPkg/Applications/Python/Python-2.7.2/Grammar/Grammar
deleted file mode 100644 (file)
index a321787..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-# Grammar for Python\r
-\r
-# Note:  Changing the grammar specified in this file will most likely\r
-#        require corresponding changes in the parser module\r
-#        (../Modules/parsermodule.c).  If you can't make the changes to\r
-#        that module yourself, please co-ordinate the required changes\r
-#        with someone who can; ask around on python-dev for help.  Fred\r
-#        Drake <fdrake@acm.org> will probably be listening there.\r
-\r
-# NOTE WELL: You should also follow all the steps listed in PEP 306,\r
-# "How to Change Python's Grammar"\r
-\r
-# Start symbols for the grammar:\r
-#       single_input is a single interactive statement;\r
-#       file_input is a module or sequence of commands read from an input file;\r
-#       eval_input is the input for the eval() and input() functions.\r
-# NB: compound_stmt in single_input is followed by extra NEWLINE!\r
-single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE\r
-file_input: (NEWLINE | stmt)* ENDMARKER\r
-eval_input: testlist NEWLINE* ENDMARKER\r
-\r
-decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE\r
-decorators: decorator+\r
-decorated: decorators (classdef | funcdef)\r
-funcdef: 'def' NAME parameters ':' suite\r
-parameters: '(' [varargslist] ')'\r
-varargslist: ((fpdef ['=' test] ',')*\r
-              ('*' NAME [',' '**' NAME] | '**' NAME) |\r
-              fpdef ['=' test] (',' fpdef ['=' test])* [','])\r
-fpdef: NAME | '(' fplist ')'\r
-fplist: fpdef (',' fpdef)* [',']\r
-\r
-stmt: simple_stmt | compound_stmt\r
-simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE\r
-small_stmt: (expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt |\r
-             import_stmt | global_stmt | exec_stmt | assert_stmt)\r
-expr_stmt: testlist (augassign (yield_expr|testlist) |\r
-                     ('=' (yield_expr|testlist))*)\r
-augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' |\r
-            '<<=' | '>>=' | '**=' | '//=')\r
-# For normal assignments, additional restrictions enforced by the interpreter\r
-print_stmt: 'print' ( [ test (',' test)* [','] ] |\r
-                      '>>' test [ (',' test)+ [','] ] )\r
-del_stmt: 'del' exprlist\r
-pass_stmt: 'pass'\r
-flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt\r
-break_stmt: 'break'\r
-continue_stmt: 'continue'\r
-return_stmt: 'return' [testlist]\r
-yield_stmt: yield_expr\r
-raise_stmt: 'raise' [test [',' test [',' test]]]\r
-import_stmt: import_name | import_from\r
-import_name: 'import' dotted_as_names\r
-import_from: ('from' ('.'* dotted_name | '.'+)\r
-              'import' ('*' | '(' import_as_names ')' | import_as_names))\r
-import_as_name: NAME ['as' NAME]\r
-dotted_as_name: dotted_name ['as' NAME]\r
-import_as_names: import_as_name (',' import_as_name)* [',']\r
-dotted_as_names: dotted_as_name (',' dotted_as_name)*\r
-dotted_name: NAME ('.' NAME)*\r
-global_stmt: 'global' NAME (',' NAME)*\r
-exec_stmt: 'exec' expr ['in' test [',' test]]\r
-assert_stmt: 'assert' test [',' test]\r
-\r
-compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated\r
-if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]\r
-while_stmt: 'while' test ':' suite ['else' ':' suite]\r
-for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]\r
-try_stmt: ('try' ':' suite\r
-           ((except_clause ':' suite)+\r
-            ['else' ':' suite]\r
-            ['finally' ':' suite] |\r
-           'finally' ':' suite))\r
-with_stmt: 'with' with_item (',' with_item)*  ':' suite\r
-with_item: test ['as' expr]\r
-# NB compile.c makes sure that the default except clause is last\r
-except_clause: 'except' [test [('as' | ',') test]]\r
-suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT\r
-\r
-# Backward compatibility cruft to support:\r
-# [ x for x in lambda: True, lambda: False if x() ]\r
-# even while also allowing:\r
-# lambda x: 5 if x else 2\r
-# (But not a mix of the two)\r
-testlist_safe: old_test [(',' old_test)+ [',']]\r
-old_test: or_test | old_lambdef\r
-old_lambdef: 'lambda' [varargslist] ':' old_test\r
-\r
-test: or_test ['if' or_test 'else' test] | lambdef\r
-or_test: and_test ('or' and_test)*\r
-and_test: not_test ('and' not_test)*\r
-not_test: 'not' not_test | comparison\r
-comparison: expr (comp_op expr)*\r
-comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'\r
-expr: xor_expr ('|' xor_expr)*\r
-xor_expr: and_expr ('^' and_expr)*\r
-and_expr: shift_expr ('&' shift_expr)*\r
-shift_expr: arith_expr (('<<'|'>>') arith_expr)*\r
-arith_expr: term (('+'|'-') term)*\r
-term: factor (('*'|'/'|'%'|'//') factor)*\r
-factor: ('+'|'-'|'~') factor | power\r
-power: atom trailer* ['**' factor]\r
-atom: ('(' [yield_expr|testlist_comp] ')' |\r
-       '[' [listmaker] ']' |\r
-       '{' [dictorsetmaker] '}' |\r
-       '`' testlist1 '`' |\r
-       NAME | NUMBER | STRING+)\r
-listmaker: test ( list_for | (',' test)* [','] )\r
-testlist_comp: test ( comp_for | (',' test)* [','] )\r
-lambdef: 'lambda' [varargslist] ':' test\r
-trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME\r
-subscriptlist: subscript (',' subscript)* [',']\r
-subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop]\r
-sliceop: ':' [test]\r
-exprlist: expr (',' expr)* [',']\r
-testlist: test (',' test)* [',']\r
-dictorsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) |\r
-                  (test (comp_for | (',' test)* [','])) )\r
-\r
-classdef: 'class' NAME ['(' [testlist] ')'] ':' suite\r
-\r
-arglist: (argument ',')* (argument [',']\r
-                         |'*' test (',' argument)* [',' '**' test] \r
-                         |'**' test)\r
-# The reason that keywords are test nodes instead of NAME is that using NAME\r
-# results in an ambiguity. ast.c makes sure it's a NAME.\r
-argument: test [comp_for] | test '=' test\r
-\r
-list_iter: list_for | list_if\r
-list_for: 'for' exprlist 'in' testlist_safe [list_iter]\r
-list_if: 'if' old_test [list_iter]\r
-\r
-comp_iter: comp_for | comp_if\r
-comp_for: 'for' exprlist 'in' or_test [comp_iter]\r
-comp_if: 'if' old_test [comp_iter]\r
-\r
-testlist1: test (',' test)*\r
-\r
-# not used in grammar, but may appear in "node" passed from Parser to Compiler\r
-encoding_decl: NAME\r
-\r
-yield_expr: 'yield' [testlist]\r