aslcstyle.y (f8146b882bc156c1d8ddf14bbea67253ebc064bb) aslcstyle.y (493deb390baef09f40125589cbdb714cb274ab04)
1NoEcho('
2/******************************************************************************
3 *
4 * Module Name: aslcstyle.y - Production rules for symbolic operators
5 *
6 *****************************************************************************/
7
8/*

--- 68 unchanged lines hidden (view full) ---

77 * 10) |
78 * 11) &&
79 * 12) ||
80 *
81 * (right-to-left):
82 * 13) = += -= *= /= %= <<= >>= &= ^= |=
83 */
84
1NoEcho('
2/******************************************************************************
3 *
4 * Module Name: aslcstyle.y - Production rules for symbolic operators
5 *
6 *****************************************************************************/
7
8/*

--- 68 unchanged lines hidden (view full) ---

77 * 10) |
78 * 11) &&
79 * 12) ||
80 *
81 * (right-to-left):
82 * 13) = += -= *= /= %= <<= >>= &= ^= |=
83 */
84
85
86/*******************************************************************************
87 *
88 * Basic operations for math and logical expressions.
89 *
90 ******************************************************************************/
91
85Expression
86
87 /* Unary operators */
88
89 : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
90 TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
91 | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
92 TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());}

--- 42 unchanged lines hidden (view full) ---

135 | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
136 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
137
138 | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
139 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
140 | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
141 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
142
92Expression
93
94 /* Unary operators */
95
96 : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
97 TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
98 | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
99 TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());}

--- 42 unchanged lines hidden (view full) ---

142 | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
143 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
144
145 | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
146 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
147 | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
148 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
149
143 /* Parentheses */
150 /* Parentheses */
144
145 | '(' TermArg ')' { $$ = $2;}
146
151
152 | '(' TermArg ')' { $$ = $2;}
153
147 /* Index term -- "= BUF1[5]" on right-hand side of an equals (source) */
154 /* Index term -- "= BUF1[5]" on right-hand side of an equals (source) */
148
155
149 | SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT
150 {$$ = TrCreateLeafNode (PARSEOP_INDEX);
156 | SuperName PARSEOP_EXP_INDEX_LEFT
157 TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX);
151 TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());}
152 ;
153
158 TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());}
159 ;
160
154 /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */
161 /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */
155
156IndexExpTerm
157
162
163IndexExpTerm
164
158 : SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT
159 {$$ = TrCreateLeafNode (PARSEOP_INDEX);
165 : SuperName PARSEOP_EXP_INDEX_LEFT
166 TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX);
160 TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());}
161 ;
162
167 TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());}
168 ;
169
170
171/*******************************************************************************
172 *
173 * All assignment-type operations -- math and logical. Includes simple
174 * assignment and compound assignments.
175 *
176 ******************************************************************************/
177
163EqualsTerm
164
178EqualsTerm
179
165 /* All assignment-type operations */
180 /* Simple Store() operation */
166
167 : SuperName PARSEOP_EXP_EQUALS
168 TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
169
181
182 : SuperName PARSEOP_EXP_EQUALS
183 TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
184
185 /* Compound assignments -- Add (operand, operand, target) */
186
170 | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
171 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
172 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
173
174 | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
175 TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
176 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
177

--- 32 unchanged lines hidden ---
187 | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
188 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
189 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
190
191 | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
192 TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
193 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
194

--- 32 unchanged lines hidden ---