| 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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 } | 1132 } |
| 1133 return prefix; | 1133 return prefix; |
| 1134 } | 1134 } |
| 1135 } | 1135 } |
| 1136 | 1136 |
| 1137 /** | 1137 /** |
| 1138 * Parse a bitwise and expression. | 1138 * Parse a bitwise and expression. |
| 1139 * | 1139 * |
| 1140 * <pre> | 1140 * <pre> |
| 1141 * bitwiseAndExpression ::= | 1141 * bitwiseAndExpression ::= |
| 1142 * shiftExpression ('&' shiftExpression)* | 1142 * equalityExpression ('&' equalityExpression)* |
| 1143 * | 'super' ('&' shiftExpression)+ | 1143 * | 'super' ('&' equalityExpression)+ |
| 1144 * </pre> | 1144 * </pre> |
| 1145 * | 1145 * |
| 1146 * @return the bitwise and expression that was parsed | 1146 * @return the bitwise and expression that was parsed |
| 1147 */ | 1147 */ |
| 1148 Expression parseBitwiseAndExpression() { | 1148 Expression parseBitwiseAndExpression() { |
| 1149 Expression expression; | 1149 Expression expression; |
| 1150 if (matches(Keyword.SUPER) && matches4(peek(), TokenType.AMPERSAND)) { | 1150 if (matches(Keyword.SUPER) && matches4(peek(), TokenType.AMPERSAND)) { |
| 1151 expression = new SuperExpression.full(andAdvance); | 1151 expression = new SuperExpression.full(andAdvance); |
| 1152 } else { | 1152 } else { |
| 1153 expression = parseShiftExpression(); | 1153 expression = parseEqualityExpression(); |
| 1154 } | 1154 } |
| 1155 while (matches5(TokenType.AMPERSAND)) { | 1155 while (matches5(TokenType.AMPERSAND)) { |
| 1156 Token operator = andAdvance; | 1156 Token operator = andAdvance; |
| 1157 expression = new BinaryExpression.full(expression, operator, parseShiftExp
ression()); | 1157 expression = new BinaryExpression.full(expression, operator, parseEquality
Expression()); |
| 1158 } | 1158 } |
| 1159 return expression; | 1159 return expression; |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 /** | 1162 /** |
| 1163 * Parse a bitwise or expression. | 1163 * Parse a bitwise or expression. |
| 1164 * | 1164 * |
| 1165 * <pre> | 1165 * <pre> |
| 1166 * bitwiseOrExpression ::= | 1166 * bitwiseOrExpression ::= |
| 1167 * bitwiseXorExpression ('|' bitwiseXorExpression)* | 1167 * bitwiseXorExpression ('|' bitwiseXorExpression)* |
| (...skipping 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3188 } | 3188 } |
| 3189 reportError8(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []); | 3189 reportError8(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []); |
| 3190 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(T
okenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUAR
E_BRACKET)); | 3190 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(T
okenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUAR
E_BRACKET)); |
| 3191 } | 3191 } |
| 3192 | 3192 |
| 3193 /** | 3193 /** |
| 3194 * Parse a logical and expression. | 3194 * Parse a logical and expression. |
| 3195 * | 3195 * |
| 3196 * <pre> | 3196 * <pre> |
| 3197 * logicalAndExpression ::= | 3197 * logicalAndExpression ::= |
| 3198 * equalityExpression ('&&' equalityExpression)* | 3198 * bitwiseOrExpression ('&&' bitwiseOrExpression)* |
| 3199 * </pre> | 3199 * </pre> |
| 3200 * | 3200 * |
| 3201 * @return the logical and expression that was parsed | 3201 * @return the logical and expression that was parsed |
| 3202 */ | 3202 */ |
| 3203 Expression parseLogicalAndExpression() { | 3203 Expression parseLogicalAndExpression() { |
| 3204 Expression expression = parseEqualityExpression(); | 3204 Expression expression = parseBitwiseOrExpression(); |
| 3205 while (matches5(TokenType.AMPERSAND_AMPERSAND)) { | 3205 while (matches5(TokenType.AMPERSAND_AMPERSAND)) { |
| 3206 Token operator = andAdvance; | 3206 Token operator = andAdvance; |
| 3207 expression = new BinaryExpression.full(expression, operator, parseEquality
Expression()); | 3207 expression = new BinaryExpression.full(expression, operator, parseBitwiseO
rExpression()); |
| 3208 } | 3208 } |
| 3209 return expression; | 3209 return expression; |
| 3210 } | 3210 } |
| 3211 | 3211 |
| 3212 /** | 3212 /** |
| 3213 * Parse a logical or expression. | 3213 * Parse a logical or expression. |
| 3214 * | 3214 * |
| 3215 * <pre> | 3215 * <pre> |
| 3216 * logicalOrExpression ::= | 3216 * logicalOrExpression ::= |
| 3217 * logicalAndExpression ('||' logicalAndExpression)* | 3217 * logicalAndExpression ('||' logicalAndExpression)* |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3906 } | 3906 } |
| 3907 ArgumentList argumentList = parseArgumentList(); | 3907 ArgumentList argumentList = parseArgumentList(); |
| 3908 return new RedirectingConstructorInvocation.full(keyword, period, constructo
rName, argumentList); | 3908 return new RedirectingConstructorInvocation.full(keyword, period, constructo
rName, argumentList); |
| 3909 } | 3909 } |
| 3910 | 3910 |
| 3911 /** | 3911 /** |
| 3912 * Parse a relational expression. | 3912 * Parse a relational expression. |
| 3913 * | 3913 * |
| 3914 * <pre> | 3914 * <pre> |
| 3915 * relationalExpression ::= | 3915 * relationalExpression ::= |
| 3916 * bitwiseOrExpression ('is' '!'? type | 'as' type | relationalOperator bi
twiseOrExpression)? | 3916 * shiftExpression ('is' '!'? type | 'as' type | relationalOperator shiftE
xpression)? |
| 3917 * | 'super' relationalOperator shiftExpression | 3917 * | 'super' relationalOperator shiftExpression |
| 3918 * </pre> | 3918 * </pre> |
| 3919 * | 3919 * |
| 3920 * @return the relational expression that was parsed | 3920 * @return the relational expression that was parsed |
| 3921 */ | 3921 */ |
| 3922 Expression parseRelationalExpression() { | 3922 Expression parseRelationalExpression() { |
| 3923 if (matches(Keyword.SUPER) && _currentToken.next.type.isRelationalOperator)
{ | 3923 if (matches(Keyword.SUPER) && _currentToken.next.type.isRelationalOperator)
{ |
| 3924 Expression expression = new SuperExpression.full(andAdvance); | 3924 Expression expression = new SuperExpression.full(andAdvance); |
| 3925 Token operator = andAdvance; | 3925 Token operator = andAdvance; |
| 3926 expression = new BinaryExpression.full(expression, operator, parseBitwiseO
rExpression()); | 3926 expression = new BinaryExpression.full(expression, operator, parseShiftExp
ression()); |
| 3927 return expression; | 3927 return expression; |
| 3928 } | 3928 } |
| 3929 Expression expression = parseBitwiseOrExpression(); | 3929 Expression expression = parseShiftExpression(); |
| 3930 if (matches(Keyword.AS)) { | 3930 if (matches(Keyword.AS)) { |
| 3931 Token asOperator = andAdvance; | 3931 Token asOperator = andAdvance; |
| 3932 expression = new AsExpression.full(expression, asOperator, parseTypeName()
); | 3932 expression = new AsExpression.full(expression, asOperator, parseTypeName()
); |
| 3933 } else if (matches(Keyword.IS)) { | 3933 } else if (matches(Keyword.IS)) { |
| 3934 Token isOperator = andAdvance; | 3934 Token isOperator = andAdvance; |
| 3935 Token notOperator = null; | 3935 Token notOperator = null; |
| 3936 if (matches5(TokenType.BANG)) { | 3936 if (matches5(TokenType.BANG)) { |
| 3937 notOperator = andAdvance; | 3937 notOperator = andAdvance; |
| 3938 } | 3938 } |
| 3939 expression = new IsExpression.full(expression, isOperator, notOperator, pa
rseTypeName()); | 3939 expression = new IsExpression.full(expression, isOperator, notOperator, pa
rseTypeName()); |
| 3940 } else if (_currentToken.type.isRelationalOperator) { | 3940 } else if (_currentToken.type.isRelationalOperator) { |
| 3941 Token operator = andAdvance; | 3941 Token operator = andAdvance; |
| 3942 expression = new BinaryExpression.full(expression, operator, parseBitwiseO
rExpression()); | 3942 expression = new BinaryExpression.full(expression, operator, parseShiftExp
ression()); |
| 3943 } | 3943 } |
| 3944 return expression; | 3944 return expression; |
| 3945 } | 3945 } |
| 3946 | 3946 |
| 3947 /** | 3947 /** |
| 3948 * Parse a rethrow expression. | 3948 * Parse a rethrow expression. |
| 3949 * | 3949 * |
| 3950 * <pre> | 3950 * <pre> |
| 3951 * rethrowExpression ::= | 3951 * rethrowExpression ::= |
| 3952 * 'rethrow' | 3952 * 'rethrow' |
| (...skipping 2892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6845 if ("\n" == separator) { | 6845 if ("\n" == separator) { |
| 6846 _writer.print("\n"); | 6846 _writer.print("\n"); |
| 6847 indent(); | 6847 indent(); |
| 6848 } else if (i > 0) { | 6848 } else if (i > 0) { |
| 6849 _writer.print(separator); | 6849 _writer.print(separator); |
| 6850 } | 6850 } |
| 6851 _writer.print(tokens[i].lexeme); | 6851 _writer.print(tokens[i].lexeme); |
| 6852 } | 6852 } |
| 6853 } | 6853 } |
| 6854 } | 6854 } |
| OLD | NEW |