| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.parser; | 3 library engine.parser; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'instrumentation.dart'; | 6 import 'instrumentation.dart'; |
| 7 import 'error.dart'; | 7 import 'error.dart'; |
| 8 import 'source.dart'; | 8 import 'source.dart'; |
| 9 import 'scanner.dart'; | 9 import 'scanner.dart'; |
| 10 import 'ast.dart'; | 10 import 'ast.dart'; |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 } | 1165 } |
| 1166 return prefix; | 1166 return prefix; |
| 1167 } | 1167 } |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 /** | 1170 /** |
| 1171 * Parse a bitwise and expression. | 1171 * Parse a bitwise and expression. |
| 1172 * | 1172 * |
| 1173 * <pre> | 1173 * <pre> |
| 1174 * bitwiseAndExpression ::= | 1174 * bitwiseAndExpression ::= |
| 1175 * equalityExpression ('&' equalityExpression)* | 1175 * shiftExpression ('&' shiftExpression)* |
| 1176 * | 'super' ('&' equalityExpression)+ | 1176 * | 'super' ('&' shiftExpression)+ |
| 1177 * </pre> | 1177 * </pre> |
| 1178 * | 1178 * |
| 1179 * @return the bitwise and expression that was parsed | 1179 * @return the bitwise and expression that was parsed |
| 1180 */ | 1180 */ |
| 1181 Expression parseBitwiseAndExpression() { | 1181 Expression parseBitwiseAndExpression() { |
| 1182 Expression expression; | 1182 Expression expression; |
| 1183 if (matches(Keyword.SUPER) && matches4(peek(), TokenType.AMPERSAND)) { | 1183 if (matches(Keyword.SUPER) && matches4(peek(), TokenType.AMPERSAND)) { |
| 1184 expression = new SuperExpression.full(andAdvance); | 1184 expression = new SuperExpression.full(andAdvance); |
| 1185 } else { | 1185 } else { |
| 1186 expression = parseEqualityExpression(); | 1186 expression = parseShiftExpression(); |
| 1187 } | 1187 } |
| 1188 while (matches5(TokenType.AMPERSAND)) { | 1188 while (matches5(TokenType.AMPERSAND)) { |
| 1189 Token operator = andAdvance; | 1189 Token operator = andAdvance; |
| 1190 expression = new BinaryExpression.full(expression, operator, parseEquality
Expression()); | 1190 expression = new BinaryExpression.full(expression, operator, parseShiftExp
ression()); |
| 1191 } | 1191 } |
| 1192 return expression; | 1192 return expression; |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 /** | 1195 /** |
| 1196 * Parse a bitwise or expression. | 1196 * Parse a bitwise or expression. |
| 1197 * | 1197 * |
| 1198 * <pre> | 1198 * <pre> |
| 1199 * bitwiseOrExpression ::= | 1199 * bitwiseOrExpression ::= |
| 1200 * bitwiseXorExpression ('|' bitwiseXorExpression)* | 1200 * bitwiseXorExpression ('|' bitwiseXorExpression)* |
| (...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3244 } | 3244 } |
| 3245 reportError8(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []); | 3245 reportError8(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []); |
| 3246 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(T
okenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUAR
E_BRACKET)); | 3246 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(T
okenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUAR
E_BRACKET)); |
| 3247 } | 3247 } |
| 3248 | 3248 |
| 3249 /** | 3249 /** |
| 3250 * Parse a logical and expression. | 3250 * Parse a logical and expression. |
| 3251 * | 3251 * |
| 3252 * <pre> | 3252 * <pre> |
| 3253 * logicalAndExpression ::= | 3253 * logicalAndExpression ::= |
| 3254 * bitwiseOrExpression ('&&' bitwiseOrExpression)* | 3254 * equalityExpression ('&&' equalityExpression)* |
| 3255 * </pre> | 3255 * </pre> |
| 3256 * | 3256 * |
| 3257 * @return the logical and expression that was parsed | 3257 * @return the logical and expression that was parsed |
| 3258 */ | 3258 */ |
| 3259 Expression parseLogicalAndExpression() { | 3259 Expression parseLogicalAndExpression() { |
| 3260 Expression expression = parseBitwiseOrExpression(); | 3260 Expression expression = parseEqualityExpression(); |
| 3261 while (matches5(TokenType.AMPERSAND_AMPERSAND)) { | 3261 while (matches5(TokenType.AMPERSAND_AMPERSAND)) { |
| 3262 Token operator = andAdvance; | 3262 Token operator = andAdvance; |
| 3263 expression = new BinaryExpression.full(expression, operator, parseBitwiseO
rExpression()); | 3263 expression = new BinaryExpression.full(expression, operator, parseEquality
Expression()); |
| 3264 } | 3264 } |
| 3265 return expression; | 3265 return expression; |
| 3266 } | 3266 } |
| 3267 | 3267 |
| 3268 /** | 3268 /** |
| 3269 * Parse a logical or expression. | 3269 * Parse a logical or expression. |
| 3270 * | 3270 * |
| 3271 * <pre> | 3271 * <pre> |
| 3272 * logicalOrExpression ::= | 3272 * logicalOrExpression ::= |
| 3273 * logicalAndExpression ('||' logicalAndExpression)* | 3273 * logicalAndExpression ('||' logicalAndExpression)* |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3962 } | 3962 } |
| 3963 ArgumentList argumentList = parseArgumentList(); | 3963 ArgumentList argumentList = parseArgumentList(); |
| 3964 return new RedirectingConstructorInvocation.full(keyword, period, constructo
rName, argumentList); | 3964 return new RedirectingConstructorInvocation.full(keyword, period, constructo
rName, argumentList); |
| 3965 } | 3965 } |
| 3966 | 3966 |
| 3967 /** | 3967 /** |
| 3968 * Parse a relational expression. | 3968 * Parse a relational expression. |
| 3969 * | 3969 * |
| 3970 * <pre> | 3970 * <pre> |
| 3971 * relationalExpression ::= | 3971 * relationalExpression ::= |
| 3972 * shiftExpression ('is' '!'? type | 'as' type | relationalOperator shiftE
xpression)? | 3972 * bitwiseOrExpression ('is' '!'? type | 'as' type | relationalOperator bi
twiseOrExpression)? |
| 3973 * | 'super' relationalOperator shiftExpression | 3973 * | 'super' relationalOperator bitwiseOrExpression |
| 3974 * </pre> | 3974 * </pre> |
| 3975 * | 3975 * |
| 3976 * @return the relational expression that was parsed | 3976 * @return the relational expression that was parsed |
| 3977 */ | 3977 */ |
| 3978 Expression parseRelationalExpression() { | 3978 Expression parseRelationalExpression() { |
| 3979 if (matches(Keyword.SUPER) && _currentToken.next.type.isRelationalOperator)
{ | 3979 if (matches(Keyword.SUPER) && _currentToken.next.type.isRelationalOperator)
{ |
| 3980 Expression expression = new SuperExpression.full(andAdvance); | 3980 Expression expression = new SuperExpression.full(andAdvance); |
| 3981 Token operator = andAdvance; | 3981 Token operator = andAdvance; |
| 3982 expression = new BinaryExpression.full(expression, operator, parseShiftExp
ression()); | 3982 expression = new BinaryExpression.full(expression, operator, parseBitwiseO
rExpression()); |
| 3983 return expression; | 3983 return expression; |
| 3984 } | 3984 } |
| 3985 Expression expression = parseShiftExpression(); | 3985 Expression expression = parseBitwiseOrExpression(); |
| 3986 if (matches(Keyword.AS)) { | 3986 if (matches(Keyword.AS)) { |
| 3987 Token asOperator = andAdvance; | 3987 Token asOperator = andAdvance; |
| 3988 expression = new AsExpression.full(expression, asOperator, parseTypeName()
); | 3988 expression = new AsExpression.full(expression, asOperator, parseTypeName()
); |
| 3989 } else if (matches(Keyword.IS)) { | 3989 } else if (matches(Keyword.IS)) { |
| 3990 Token isOperator = andAdvance; | 3990 Token isOperator = andAdvance; |
| 3991 Token notOperator = null; | 3991 Token notOperator = null; |
| 3992 if (matches5(TokenType.BANG)) { | 3992 if (matches5(TokenType.BANG)) { |
| 3993 notOperator = andAdvance; | 3993 notOperator = andAdvance; |
| 3994 } | 3994 } |
| 3995 expression = new IsExpression.full(expression, isOperator, notOperator, pa
rseTypeName()); | 3995 expression = new IsExpression.full(expression, isOperator, notOperator, pa
rseTypeName()); |
| 3996 } else if (_currentToken.type.isRelationalOperator) { | 3996 } else if (_currentToken.type.isRelationalOperator) { |
| 3997 Token operator = andAdvance; | 3997 Token operator = andAdvance; |
| 3998 expression = new BinaryExpression.full(expression, operator, parseShiftExp
ression()); | 3998 expression = new BinaryExpression.full(expression, operator, parseBitwiseO
rExpression()); |
| 3999 } | 3999 } |
| 4000 return expression; | 4000 return expression; |
| 4001 } | 4001 } |
| 4002 | 4002 |
| 4003 /** | 4003 /** |
| 4004 * Parse a rethrow expression. | 4004 * Parse a rethrow expression. |
| 4005 * | 4005 * |
| 4006 * <pre> | 4006 * <pre> |
| 4007 * rethrowExpression ::= | 4007 * rethrowExpression ::= |
| 4008 * 'rethrow' | 4008 * 'rethrow' |
| (...skipping 2923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6932 if ("\n" == separator) { | 6932 if ("\n" == separator) { |
| 6933 _writer.print("\n"); | 6933 _writer.print("\n"); |
| 6934 indent(); | 6934 indent(); |
| 6935 } else if (i > 0) { | 6935 } else if (i > 0) { |
| 6936 _writer.print(separator); | 6936 _writer.print(separator); |
| 6937 } | 6937 } |
| 6938 _writer.print(tokens[i].lexeme); | 6938 _writer.print(tokens[i].lexeme); |
| 6939 } | 6939 } |
| 6940 } | 6940 } |
| 6941 } | 6941 } |
| OLD | NEW |