OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 * Go language grammar. | 6 * Go language grammar. |
7 * | 7 * |
8 * The Go semicolon rules are: | 8 * The Go semicolon rules are: |
9 * | 9 * |
10 * 1. all statements and declarations are terminated by semicolons. | 10 * 1. all statements and declarations are terminated by semicolons. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 %type <list> hidden_funres | 86 %type <list> hidden_funres |
87 %type <list> ohidden_funres | 87 %type <list> ohidden_funres |
88 %type <list> hidden_funarg_list ohidden_funarg_list | 88 %type <list> hidden_funarg_list ohidden_funarg_list |
89 %type <list> hidden_interfacedcl_list ohidden_interfacedcl_list | 89 %type <list> hidden_interfacedcl_list ohidden_interfacedcl_list |
90 %type <list> hidden_structdcl_list ohidden_structdcl_list | 90 %type <list> hidden_structdcl_list ohidden_structdcl_list |
91 | 91 |
92 %type <type> hidden_type hidden_type_misc hidden_pkgtype | 92 %type <type> hidden_type hidden_type_misc hidden_pkgtype |
93 %type <type> hidden_type_func | 93 %type <type> hidden_type_func |
94 %type <type> hidden_type_recv_chan hidden_type_non_recv_chan | 94 %type <type> hidden_type_recv_chan hidden_type_non_recv_chan |
95 | 95 |
| 96 %left LCOMM /* outside the usual hierarchy; here for good error mess
ages */ |
| 97 |
96 %left LOROR | 98 %left LOROR |
97 %left LANDAND | 99 %left LANDAND |
98 %left LCOMM | |
99 %left LEQ LNE LLE LGE LLT LGT | 100 %left LEQ LNE LLE LGE LLT LGT |
100 %left '+' '-' '|' '^' | 101 %left '+' '-' '|' '^' |
101 %left '*' '/' '%' '&' LLSH LRSH LANDNOT | 102 %left '*' '/' '%' '&' LLSH LRSH LANDNOT |
102 | 103 |
103 /* | 104 /* |
104 * manual override of shift/reduce conflicts. | 105 * manual override of shift/reduce conflicts. |
105 * the general form is that we assign a precedence | 106 * the general form is that we assign a precedence |
106 * to the token being shifted and then introduce | 107 * to the token being shifted and then introduce |
107 * NotToken with lower precedence or PreferToToken with higher | 108 * NotToken with lower precedence or PreferToToken with higher |
108 * and annotate the reducing rule accordingly. | 109 * and annotate the reducing rule accordingly. |
(...skipping 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 static void | 1946 static void |
1946 fixlbrace(int lbr) | 1947 fixlbrace(int lbr) |
1947 { | 1948 { |
1948 // If the opening brace was an LBODY, | 1949 // If the opening brace was an LBODY, |
1949 // set up for another one now that we're done. | 1950 // set up for another one now that we're done. |
1950 // See comment in lex.c about loophack. | 1951 // See comment in lex.c about loophack. |
1951 if(lbr == LBODY) | 1952 if(lbr == LBODY) |
1952 loophack = 1; | 1953 loophack = 1; |
1953 } | 1954 } |
1954 | 1955 |
OLD | NEW |