| 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.ast; | 3 library engine.ast; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
| 7 import 'error.dart'; | 7 import 'error.dart'; |
| 8 import 'source.dart' show LineInfo; | 8 import 'source.dart' show LineInfo; |
| 9 import 'scanner.dart'; | 9 import 'scanner.dart'; |
| 10 import 'engine.dart' show AnalysisEngine; | 10 import 'engine.dart' show AnalysisEngine; |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 * Return an array containing the comment and annotations associated with this
node, sorted in | 494 * Return an array containing the comment and annotations associated with this
node, sorted in |
| 495 * lexical order. | 495 * lexical order. |
| 496 * @return the comment and annotations associated with this node in the order
in which they | 496 * @return the comment and annotations associated with this node in the order
in which they |
| 497 * appeared in the original source | 497 * appeared in the original source |
| 498 */ | 498 */ |
| 499 List<ASTNode> get sortedCommentAndAnnotations { | 499 List<ASTNode> get sortedCommentAndAnnotations { |
| 500 List<ASTNode> childList = new List<ASTNode>(); | 500 List<ASTNode> childList = new List<ASTNode>(); |
| 501 childList.add(_comment); | 501 childList.add(_comment); |
| 502 childList.addAll(_metadata); | 502 childList.addAll(_metadata); |
| 503 List<ASTNode> children = new List.from(childList); | 503 List<ASTNode> children = new List.from(childList); |
| 504 children.sort(); | 504 children.sort(ASTNode.LEXICAL_ORDER); |
| 505 return children; | 505 return children; |
| 506 } | 506 } |
| 507 } | 507 } |
| 508 /** | 508 /** |
| 509 * Instances of the class {@code Annotation} represent an annotation that can be
associated with an | 509 * Instances of the class {@code Annotation} represent an annotation that can be
associated with an |
| 510 * AST node. | 510 * AST node. |
| 511 * <pre> | 511 * <pre> |
| 512 * metadata ::= | 512 * metadata ::= |
| 513 * annotation | 513 * annotation |
| 514 * annotation ::= | 514 * annotation ::= |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 NodeList<Expression> _arguments; | 779 NodeList<Expression> _arguments; |
| 780 | 780 |
| 781 /** | 781 /** |
| 782 * The right parenthesis. | 782 * The right parenthesis. |
| 783 */ | 783 */ |
| 784 Token _rightParenthesis; | 784 Token _rightParenthesis; |
| 785 | 785 |
| 786 /** | 786 /** |
| 787 * An array containing the elements representing the parameters corresponding
to each of the | 787 * An array containing the elements representing the parameters corresponding
to each of the |
| 788 * arguments in this list, or {@code null} if the AST has not been resolved or
if the function or | 788 * arguments in this list, or {@code null} if the AST has not been resolved or
if the function or |
| 789 * method being invoked could not be determined. The array must be the same le
ngth as the number | 789 * method being invoked could not be determined based on static type informati
on. The array must |
| 790 * of arguments, but can contain {@code null} entries if a given argument does
not correspond to a | 790 * be the same length as the number of arguments, but can contain {@code null}
entries if a given |
| 791 * formal parameter. | 791 * argument does not correspond to a formal parameter. |
| 792 */ | 792 */ |
| 793 List<ParameterElement> _correspondingParameters; | 793 List<ParameterElement> _correspondingStaticParameters; |
| 794 |
| 795 /** |
| 796 * An array containing the elements representing the parameters corresponding
to each of the |
| 797 * arguments in this list, or {@code null} if the AST has not been resolved or
if the function or |
| 798 * method being invoked could not be determined based on propagated type infor
mation. The array |
| 799 * must be the same length as the number of arguments, but can contain {@code
null} entries if a |
| 800 * given argument does not correspond to a formal parameter. |
| 801 */ |
| 802 List<ParameterElement> _correspondingPropagatedParameters; |
| 794 | 803 |
| 795 /** | 804 /** |
| 796 * Initialize a newly created list of arguments. | 805 * Initialize a newly created list of arguments. |
| 797 * @param leftParenthesis the left parenthesis | 806 * @param leftParenthesis the left parenthesis |
| 798 * @param arguments the expressions producing the values of the arguments | 807 * @param arguments the expressions producing the values of the arguments |
| 799 * @param rightParenthesis the right parenthesis | 808 * @param rightParenthesis the right parenthesis |
| 800 */ | 809 */ |
| 801 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig
htParenthesis) { | 810 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig
htParenthesis) { |
| 802 this._arguments = new NodeList<Expression>(this); | 811 this._arguments = new NodeList<Expression>(this); |
| 803 this._leftParenthesis = leftParenthesis; | 812 this._leftParenthesis = leftParenthesis; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given | 849 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given |
| 841 * array of parameters. The array of parameters must be the same length as the
number of | 850 * array of parameters. The array of parameters must be the same length as the
number of |
| 842 * arguments, but can contain {@code null} entries if a given argument does no
t correspond to a | 851 * arguments, but can contain {@code null} entries if a given argument does no
t correspond to a |
| 843 * formal parameter. | 852 * formal parameter. |
| 844 * @param parameters the parameter elements corresponding to the arguments | 853 * @param parameters the parameter elements corresponding to the arguments |
| 845 */ | 854 */ |
| 846 void set correspondingParameters(List<ParameterElement> parameters) { | 855 void set correspondingParameters(List<ParameterElement> parameters) { |
| 847 if (parameters.length != _arguments.length) { | 856 if (parameters.length != _arguments.length) { |
| 848 throw new IllegalArgumentException("Expected ${_arguments.length} paramete
rs, not ${parameters.length}"); | 857 throw new IllegalArgumentException("Expected ${_arguments.length} paramete
rs, not ${parameters.length}"); |
| 849 } | 858 } |
| 850 _correspondingParameters = parameters; | 859 _correspondingPropagatedParameters = parameters; |
| 851 } | 860 } |
| 852 | 861 |
| 853 /** | 862 /** |
| 863 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given |
| 864 * array of parameters. The array of parameters must be the same length as the
number of |
| 865 * arguments, but can contain {@code null} entries if a given argument does no
t correspond to a |
| 866 * formal parameter. |
| 867 * @param parameters the parameter elements corresponding to the arguments |
| 868 */ |
| 869 void set correspondingStaticParameters(List<ParameterElement> parameters) { |
| 870 if (parameters.length != _arguments.length) { |
| 871 throw new IllegalArgumentException("Expected ${_arguments.length} paramete
rs, not ${parameters.length}"); |
| 872 } |
| 873 _correspondingStaticParameters = parameters; |
| 874 } |
| 875 |
| 876 /** |
| 854 * Set the left parenthesis to the given token. | 877 * Set the left parenthesis to the given token. |
| 855 * @param parenthesis the left parenthesis | 878 * @param parenthesis the left parenthesis |
| 856 */ | 879 */ |
| 857 void set leftParenthesis(Token parenthesis) { | 880 void set leftParenthesis(Token parenthesis) { |
| 858 _leftParenthesis = parenthesis; | 881 _leftParenthesis = parenthesis; |
| 859 } | 882 } |
| 860 | 883 |
| 861 /** | 884 /** |
| 862 * Set the right parenthesis to the given token. | 885 * Set the right parenthesis to the given token. |
| 863 * @param parenthesis the right parenthesis | 886 * @param parenthesis the right parenthesis |
| 864 */ | 887 */ |
| 865 void set rightParenthesis(Token parenthesis) { | 888 void set rightParenthesis(Token parenthesis) { |
| 866 _rightParenthesis = parenthesis; | 889 _rightParenthesis = parenthesis; |
| 867 } | 890 } |
| 868 void visitChildren(ASTVisitor<Object> visitor) { | 891 void visitChildren(ASTVisitor<Object> visitor) { |
| 869 _arguments.accept(visitor); | 892 _arguments.accept(visitor); |
| 870 } | 893 } |
| 871 | 894 |
| 872 /** | 895 /** |
| 873 * If the given expression is a child of this list, and the AST structure has
been resolved, and | 896 * If the given expression is a child of this list, and the AST structure has
been resolved, and |
| 874 * the function being invoked is known, and the expression corresponds to one
of the parameters of | 897 * the function being invoked is known based on propagated type information, a
nd the expression |
| 875 * the function being invoked, then return the parameter element representing
the parameter to | 898 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
| 876 * which the value of the given expression will be bound. Otherwise, return {@
code null}. | 899 * element representing the parameter to which the value of the given expressi
on will be bound. |
| 900 * Otherwise, return {@code null}. |
| 877 * <p> | 901 * <p> |
| 878 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. | 902 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. |
| 879 * @param expression the expression corresponding to the parameter to be retur
ned | 903 * @param expression the expression corresponding to the parameter to be retur
ned |
| 880 * @return the parameter element representing the parameter to which the value
of the expression | 904 * @return the parameter element representing the parameter to which the value
of the expression |
| 881 * will be bound | 905 * will be bound |
| 882 */ | 906 */ |
| 883 ParameterElement getParameterElementFor(Expression expression) { | 907 ParameterElement getPropagatedParameterElementFor(Expression expression) { |
| 884 if (_correspondingParameters == null) { | 908 if (_correspondingPropagatedParameters == null) { |
| 885 return null; | 909 return null; |
| 886 } | 910 } |
| 887 int index = _arguments.indexOf(expression); | 911 int index = _arguments.indexOf(expression); |
| 888 if (index < 0) { | 912 if (index < 0) { |
| 889 return null; | 913 return null; |
| 890 } | 914 } |
| 891 return _correspondingParameters[index]; | 915 return _correspondingPropagatedParameters[index]; |
| 916 } |
| 917 |
| 918 /** |
| 919 * If the given expression is a child of this list, and the AST structure has
been resolved, and |
| 920 * the function being invoked is known based on static type information, and t
he expression |
| 921 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
| 922 * element representing the parameter to which the value of the given expressi
on will be bound. |
| 923 * Otherwise, return {@code null}. |
| 924 * <p> |
| 925 * This method is only intended to be used by {@link Expression#getStaticParam
eterElement()}. |
| 926 * @param expression the expression corresponding to the parameter to be retur
ned |
| 927 * @return the parameter element representing the parameter to which the value
of the expression |
| 928 * will be bound |
| 929 */ |
| 930 ParameterElement getStaticParameterElementFor(Expression expression) { |
| 931 if (_correspondingStaticParameters == null) { |
| 932 return null; |
| 933 } |
| 934 int index = _arguments.indexOf(expression); |
| 935 if (index < 0) { |
| 936 return null; |
| 937 } |
| 938 return _correspondingStaticParameters[index]; |
| 892 } | 939 } |
| 893 } | 940 } |
| 894 /** | 941 /** |
| 895 * Instances of the class {@code AsExpression} represent an 'as' expression. | 942 * Instances of the class {@code AsExpression} represent an 'as' expression. |
| 896 * <pre> | 943 * <pre> |
| 897 * asExpression ::={@link Expression expression} 'as' {@link TypeName type}</pre
> | 944 * asExpression ::={@link Expression expression} 'as' {@link TypeName type}</pre
> |
| 898 * @coverage dart.engine.ast | 945 * @coverage dart.engine.ast |
| 899 */ | 946 */ |
| 900 class AsExpression extends Expression { | 947 class AsExpression extends Expression { |
| 901 | 948 |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 */ | 1441 */ |
| 1395 void set staticElement(MethodElement element) { | 1442 void set staticElement(MethodElement element) { |
| 1396 _staticElement = element; | 1443 _staticElement = element; |
| 1397 } | 1444 } |
| 1398 void visitChildren(ASTVisitor<Object> visitor) { | 1445 void visitChildren(ASTVisitor<Object> visitor) { |
| 1399 safelyVisitChild(_leftOperand, visitor); | 1446 safelyVisitChild(_leftOperand, visitor); |
| 1400 safelyVisitChild(_rightOperand, visitor); | 1447 safelyVisitChild(_rightOperand, visitor); |
| 1401 } | 1448 } |
| 1402 | 1449 |
| 1403 /** | 1450 /** |
| 1404 * Return the parameter element representing the parameter to which the value
of the right operand | 1451 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 1405 * will be bound. May be {@code null}. | 1452 * propagated type information, then return the parameter element representing
the parameter to |
| 1453 * which the value of the right operand will be bound. Otherwise, return {@cod
e null}. |
| 1406 * <p> | 1454 * <p> |
| 1407 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. | 1455 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. |
| 1408 * @return the parameter element representing the parameter to which the value
of the right | 1456 * @return the parameter element representing the parameter to which the value
of the right |
| 1409 * operand will be bound | 1457 * operand will be bound |
| 1410 */ | 1458 */ |
| 1411 ParameterElement get parameterElementForRightOperand { | 1459 ParameterElement get propagatedParameterElementForRightOperand { |
| 1412 if (_propagatedElement == null) { | 1460 if (_propagatedElement == null) { |
| 1413 return null; | 1461 return null; |
| 1414 } | 1462 } |
| 1415 List<ParameterElement> parameters2 = _propagatedElement.parameters; | 1463 List<ParameterElement> parameters2 = _propagatedElement.parameters; |
| 1416 if (parameters2.length < 1) { | 1464 if (parameters2.length < 1) { |
| 1417 return null; | 1465 return null; |
| 1418 } | 1466 } |
| 1419 return parameters2[0]; | 1467 return parameters2[0]; |
| 1420 } | 1468 } |
| 1469 |
| 1470 /** |
| 1471 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 1472 * type information, then return the parameter element representing the parame
ter to which the |
| 1473 * value of the right operand will be bound. Otherwise, return {@code null}. |
| 1474 * <p> |
| 1475 * This method is only intended to be used by {@link Expression#getStaticParam
eterElement()}. |
| 1476 * @return the parameter element representing the parameter to which the value
of the right |
| 1477 * operand will be bound |
| 1478 */ |
| 1479 ParameterElement get staticParameterElementForRightOperand { |
| 1480 if (_staticElement == null) { |
| 1481 return null; |
| 1482 } |
| 1483 List<ParameterElement> parameters2 = _staticElement.parameters; |
| 1484 if (parameters2.length < 1) { |
| 1485 return null; |
| 1486 } |
| 1487 return parameters2[0]; |
| 1488 } |
| 1421 } | 1489 } |
| 1422 /** | 1490 /** |
| 1423 * Instances of the class {@code Block} represent a sequence of statements. | 1491 * Instances of the class {@code Block} represent a sequence of statements. |
| 1424 * <pre> | 1492 * <pre> |
| 1425 * block ::= | 1493 * block ::= |
| 1426 * '{' statement* '}' | 1494 * '{' statement* '}' |
| 1427 * </pre> | 1495 * </pre> |
| 1428 * @coverage dart.engine.ast | 1496 * @coverage dart.engine.ast |
| 1429 */ | 1497 */ |
| 1430 class Block extends Statement { | 1498 class Block extends Statement { |
| (...skipping 3267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4698 Type2 _staticType; | 4766 Type2 _staticType; |
| 4699 | 4767 |
| 4700 /** | 4768 /** |
| 4701 * The propagated type of this expression, or {@code null} if type propagation
has not been | 4769 * The propagated type of this expression, or {@code null} if type propagation
has not been |
| 4702 * performed on the AST structure. | 4770 * performed on the AST structure. |
| 4703 */ | 4771 */ |
| 4704 Type2 _propagatedType; | 4772 Type2 _propagatedType; |
| 4705 | 4773 |
| 4706 /** | 4774 /** |
| 4707 * If this expression is an argument to an invocation, and the AST structure h
as been resolved, | 4775 * If this expression is an argument to an invocation, and the AST structure h
as been resolved, |
| 4708 * and the function being invoked is known, and this expression corresponds to
one of the | 4776 * and the function being invoked is known based on propagated type informatio
n, and this |
| 4709 * parameters of the function being invoked, then return the parameter element
representing the | 4777 * expression corresponds to one of the parameters of the function being invok
ed, then return the |
| 4710 * parameter to which the value of this expression will be bound. Otherwise, r
eturn {@code null}. | 4778 * parameter element representing the parameter to which the value of this exp
ression will be |
| 4779 * bound. Otherwise, return {@code null}. |
| 4711 * @return the parameter element representing the parameter to which the value
of this expression | 4780 * @return the parameter element representing the parameter to which the value
of this expression |
| 4712 * will be bound | 4781 * will be bound |
| 4713 */ | 4782 */ |
| 4714 ParameterElement get parameterElement { | 4783 ParameterElement get parameterElement { |
| 4715 ASTNode parent2 = parent; | 4784 ASTNode parent2 = parent; |
| 4716 if (parent2 is ArgumentList) { | 4785 if (parent2 is ArgumentList) { |
| 4717 return ((parent2 as ArgumentList)).getParameterElementFor(this); | 4786 return ((parent2 as ArgumentList)).getPropagatedParameterElementFor(this); |
| 4718 } | 4787 } else if (parent2 is IndexExpression) { |
| 4719 if (parent2 is IndexExpression) { | |
| 4720 IndexExpression indexExpression = parent2 as IndexExpression; | 4788 IndexExpression indexExpression = parent2 as IndexExpression; |
| 4721 if (identical(indexExpression.index, this)) { | 4789 if (identical(indexExpression.index, this)) { |
| 4722 return indexExpression.parameterElementForIndex; | 4790 return indexExpression.propagatedParameterElementForIndex; |
| 4723 } | 4791 } |
| 4724 } | 4792 } else if (parent2 is BinaryExpression) { |
| 4725 if (parent2 is BinaryExpression) { | |
| 4726 BinaryExpression binaryExpression = parent2 as BinaryExpression; | 4793 BinaryExpression binaryExpression = parent2 as BinaryExpression; |
| 4727 if (identical(binaryExpression.rightOperand, this)) { | 4794 if (identical(binaryExpression.rightOperand, this)) { |
| 4728 return binaryExpression.parameterElementForRightOperand; | 4795 return binaryExpression.propagatedParameterElementForRightOperand; |
| 4729 } | 4796 } |
| 4797 } else if (parent2 is PrefixExpression) { |
| 4798 return ((parent2 as PrefixExpression)).propagatedParameterElementForOperan
d; |
| 4799 } else if (parent2 is PostfixExpression) { |
| 4800 return ((parent2 as PostfixExpression)).propagatedParameterElementForOpera
nd; |
| 4730 } | 4801 } |
| 4731 return null; | 4802 return null; |
| 4732 } | 4803 } |
| 4733 | 4804 |
| 4734 /** | 4805 /** |
| 4735 * Return the propagated type of this expression, or {@code null} if type prop
agation has not been | 4806 * Return the propagated type of this expression, or {@code null} if type prop
agation has not been |
| 4736 * performed on the AST structure. | 4807 * performed on the AST structure. |
| 4737 * @return the propagated type of this expression | 4808 * @return the propagated type of this expression |
| 4738 */ | 4809 */ |
| 4739 Type2 get propagatedType => _propagatedType; | 4810 Type2 get propagatedType => _propagatedType; |
| 4740 | 4811 |
| 4741 /** | 4812 /** |
| 4813 * If this expression is an argument to an invocation, and the AST structure h
as been resolved, |
| 4814 * and the function being invoked is known based on static type information, a
nd this expression |
| 4815 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
| 4816 * element representing the parameter to which the value of this expression wi
ll be bound. |
| 4817 * Otherwise, return {@code null}. |
| 4818 * @return the parameter element representing the parameter to which the value
of this expression |
| 4819 * will be bound |
| 4820 */ |
| 4821 ParameterElement get staticParameterElement { |
| 4822 ASTNode parent2 = parent; |
| 4823 if (parent2 is ArgumentList) { |
| 4824 return ((parent2 as ArgumentList)).getStaticParameterElementFor(this); |
| 4825 } else if (parent2 is IndexExpression) { |
| 4826 IndexExpression indexExpression = parent2 as IndexExpression; |
| 4827 if (identical(indexExpression.index, this)) { |
| 4828 return indexExpression.staticParameterElementForIndex; |
| 4829 } |
| 4830 } else if (parent2 is BinaryExpression) { |
| 4831 BinaryExpression binaryExpression = parent2 as BinaryExpression; |
| 4832 if (identical(binaryExpression.rightOperand, this)) { |
| 4833 return binaryExpression.staticParameterElementForRightOperand; |
| 4834 } |
| 4835 } else if (parent2 is PrefixExpression) { |
| 4836 return ((parent2 as PrefixExpression)).staticParameterElementForOperand; |
| 4837 } else if (parent2 is PostfixExpression) { |
| 4838 return ((parent2 as PostfixExpression)).staticParameterElementForOperand; |
| 4839 } |
| 4840 return null; |
| 4841 } |
| 4842 |
| 4843 /** |
| 4742 * Return the static type of this expression, or {@code null} if the AST struc
ture has not been | 4844 * Return the static type of this expression, or {@code null} if the AST struc
ture has not been |
| 4743 * resolved. | 4845 * resolved. |
| 4744 * @return the static type of this expression | 4846 * @return the static type of this expression |
| 4745 */ | 4847 */ |
| 4746 Type2 get staticType => _staticType; | 4848 Type2 get staticType => _staticType; |
| 4747 | 4849 |
| 4748 /** | 4850 /** |
| 4749 * Return {@code true} if this expression is syntactically valid for the LHS o
f an{@link AssignmentExpression assignment expression}. | 4851 * Return {@code true} if this expression is syntactically valid for the LHS o
f an{@link AssignmentExpression assignment expression}. |
| 4750 * @return {@code true} if this expression matches the {@code assignableExpres
sion} production | 4852 * @return {@code true} if this expression matches the {@code assignableExpres
sion} production |
| 4751 */ | 4853 */ |
| (...skipping 2526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7278 */ | 7380 */ |
| 7279 void set staticElement(MethodElement element) { | 7381 void set staticElement(MethodElement element) { |
| 7280 _staticElement = element; | 7382 _staticElement = element; |
| 7281 } | 7383 } |
| 7282 void visitChildren(ASTVisitor<Object> visitor) { | 7384 void visitChildren(ASTVisitor<Object> visitor) { |
| 7283 safelyVisitChild(_target, visitor); | 7385 safelyVisitChild(_target, visitor); |
| 7284 safelyVisitChild(_index, visitor); | 7386 safelyVisitChild(_index, visitor); |
| 7285 } | 7387 } |
| 7286 | 7388 |
| 7287 /** | 7389 /** |
| 7288 * Return the parameter element representing the parameter to which the value
of the index | 7390 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 7289 * expression will be bound. May be {@code null}. | 7391 * propagated type information, then return the parameter element representing
the parameter to |
| 7392 * which the value of the index expression will be bound. Otherwise, return {@
code null}. |
| 7290 * <p> | 7393 * <p> |
| 7291 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. | 7394 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. |
| 7292 * @return the parameter element representing the parameter to which the value
of the index | 7395 * @return the parameter element representing the parameter to which the value
of the index |
| 7293 * expression will be bound | 7396 * expression will be bound |
| 7294 */ | 7397 */ |
| 7295 ParameterElement get parameterElementForIndex { | 7398 ParameterElement get propagatedParameterElementForIndex { |
| 7296 if (_propagatedElement == null) { | 7399 if (_propagatedElement == null) { |
| 7297 return null; | 7400 return null; |
| 7298 } | 7401 } |
| 7299 List<ParameterElement> parameters2 = _propagatedElement.parameters; | 7402 List<ParameterElement> parameters2 = _propagatedElement.parameters; |
| 7300 if (parameters2.length < 1) { | 7403 if (parameters2.length < 1) { |
| 7301 return null; | 7404 return null; |
| 7302 } | 7405 } |
| 7303 return parameters2[0]; | 7406 return parameters2[0]; |
| 7304 } | 7407 } |
| 7408 |
| 7409 /** |
| 7410 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 7411 * type information, then return the parameter element representing the parame
ter to which the |
| 7412 * value of the index expression will be bound. Otherwise, return {@code null}
. |
| 7413 * <p> |
| 7414 * This method is only intended to be used by {@link Expression#getStaticParam
eterElement()}. |
| 7415 * @return the parameter element representing the parameter to which the value
of the index |
| 7416 * expression will be bound |
| 7417 */ |
| 7418 ParameterElement get staticParameterElementForIndex { |
| 7419 if (_staticElement == null) { |
| 7420 return null; |
| 7421 } |
| 7422 List<ParameterElement> parameters2 = _staticElement.parameters; |
| 7423 if (parameters2.length < 1) { |
| 7424 return null; |
| 7425 } |
| 7426 return parameters2[0]; |
| 7427 } |
| 7305 } | 7428 } |
| 7306 /** | 7429 /** |
| 7307 * Instances of the class {@code InstanceCreationExpression} represent an instan
ce creation | 7430 * Instances of the class {@code InstanceCreationExpression} represent an instan
ce creation |
| 7308 * expression. | 7431 * expression. |
| 7309 * <pre> | 7432 * <pre> |
| 7310 * newExpression ::= | 7433 * newExpression ::= |
| 7311 * ('new' | 'const') {@link TypeName type} ('.' {@link SimpleIdentifier identifi
er})? {@link ArgumentList argumentList}</pre> | 7434 * ('new' | 'const') {@link TypeName type} ('.' {@link SimpleIdentifier identifi
er})? {@link ArgumentList argumentList}</pre> |
| 7312 * @coverage dart.engine.ast | 7435 * @coverage dart.engine.ast |
| 7313 */ | 7436 */ |
| 7314 class InstanceCreationExpression extends Expression { | 7437 class InstanceCreationExpression extends Expression { |
| (...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9213 * Return an array containing the comment and annotations associated with this
parameter, sorted | 9336 * Return an array containing the comment and annotations associated with this
parameter, sorted |
| 9214 * in lexical order. | 9337 * in lexical order. |
| 9215 * @return the comment and annotations associated with this parameter in the o
rder in which they | 9338 * @return the comment and annotations associated with this parameter in the o
rder in which they |
| 9216 * appeared in the original source | 9339 * appeared in the original source |
| 9217 */ | 9340 */ |
| 9218 List<ASTNode> get sortedCommentAndAnnotations { | 9341 List<ASTNode> get sortedCommentAndAnnotations { |
| 9219 List<ASTNode> childList = new List<ASTNode>(); | 9342 List<ASTNode> childList = new List<ASTNode>(); |
| 9220 childList.add(_comment); | 9343 childList.add(_comment); |
| 9221 childList.addAll(_metadata); | 9344 childList.addAll(_metadata); |
| 9222 List<ASTNode> children = new List.from(childList); | 9345 List<ASTNode> children = new List.from(childList); |
| 9223 children.sort(); | 9346 children.sort(ASTNode.LEXICAL_ORDER); |
| 9224 return children; | 9347 return children; |
| 9225 } | 9348 } |
| 9226 } | 9349 } |
| 9227 /** | 9350 /** |
| 9228 * Instances of the class {@code NullLiteral} represent a null literal expressio
n. | 9351 * Instances of the class {@code NullLiteral} represent a null literal expressio
n. |
| 9229 * <pre> | 9352 * <pre> |
| 9230 * nullLiteral ::= | 9353 * nullLiteral ::= |
| 9231 * 'null' | 9354 * 'null' |
| 9232 * </pre> | 9355 * </pre> |
| 9233 * @coverage dart.engine.ast | 9356 * @coverage dart.engine.ast |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9667 * Set the element associated with the operator based on the static type of th
e operand to the | 9790 * Set the element associated with the operator based on the static type of th
e operand to the |
| 9668 * given element. | 9791 * given element. |
| 9669 * @param element the element to be associated with the operator | 9792 * @param element the element to be associated with the operator |
| 9670 */ | 9793 */ |
| 9671 void set staticElement(MethodElement element) { | 9794 void set staticElement(MethodElement element) { |
| 9672 _staticElement = element; | 9795 _staticElement = element; |
| 9673 } | 9796 } |
| 9674 void visitChildren(ASTVisitor<Object> visitor) { | 9797 void visitChildren(ASTVisitor<Object> visitor) { |
| 9675 safelyVisitChild(_operand, visitor); | 9798 safelyVisitChild(_operand, visitor); |
| 9676 } | 9799 } |
| 9800 |
| 9801 /** |
| 9802 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 9803 * propagated type information, then return the parameter element representing
the parameter to |
| 9804 * which the value of the operand will be bound. Otherwise, return {@code null
}. |
| 9805 * <p> |
| 9806 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. |
| 9807 * @return the parameter element representing the parameter to which the value
of the right |
| 9808 * operand will be bound |
| 9809 */ |
| 9810 ParameterElement get propagatedParameterElementForOperand { |
| 9811 if (_propagatedElement == null) { |
| 9812 return null; |
| 9813 } |
| 9814 List<ParameterElement> parameters2 = _propagatedElement.parameters; |
| 9815 if (parameters2.length < 1) { |
| 9816 return null; |
| 9817 } |
| 9818 return parameters2[0]; |
| 9819 } |
| 9820 |
| 9821 /** |
| 9822 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 9823 * type information, then return the parameter element representing the parame
ter to which the |
| 9824 * value of the operand will be bound. Otherwise, return {@code null}. |
| 9825 * <p> |
| 9826 * This method is only intended to be used by {@link Expression#getStaticParam
eterElement()}. |
| 9827 * @return the parameter element representing the parameter to which the value
of the right |
| 9828 * operand will be bound |
| 9829 */ |
| 9830 ParameterElement get staticParameterElementForOperand { |
| 9831 if (_staticElement == null) { |
| 9832 return null; |
| 9833 } |
| 9834 List<ParameterElement> parameters2 = _staticElement.parameters; |
| 9835 if (parameters2.length < 1) { |
| 9836 return null; |
| 9837 } |
| 9838 return parameters2[0]; |
| 9839 } |
| 9677 } | 9840 } |
| 9678 /** | 9841 /** |
| 9679 * Instances of the class {@code PrefixExpression} represent a prefix unary expr
ession. | 9842 * Instances of the class {@code PrefixExpression} represent a prefix unary expr
ession. |
| 9680 * <pre> | 9843 * <pre> |
| 9681 * prefixExpression ::={@link Token operator} {@link Expression operand}</pre> | 9844 * prefixExpression ::={@link Token operator} {@link Expression operand}</pre> |
| 9682 * @coverage dart.engine.ast | 9845 * @coverage dart.engine.ast |
| 9683 */ | 9846 */ |
| 9684 class PrefixExpression extends Expression { | 9847 class PrefixExpression extends Expression { |
| 9685 | 9848 |
| 9686 /** | 9849 /** |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9782 * Set the element associated with the operator based on the static type of th
e operand to the | 9945 * Set the element associated with the operator based on the static type of th
e operand to the |
| 9783 * given element. | 9946 * given element. |
| 9784 * @param element the static element to be associated with the operator | 9947 * @param element the static element to be associated with the operator |
| 9785 */ | 9948 */ |
| 9786 void set staticElement(MethodElement element) { | 9949 void set staticElement(MethodElement element) { |
| 9787 _staticElement = element; | 9950 _staticElement = element; |
| 9788 } | 9951 } |
| 9789 void visitChildren(ASTVisitor<Object> visitor) { | 9952 void visitChildren(ASTVisitor<Object> visitor) { |
| 9790 safelyVisitChild(_operand, visitor); | 9953 safelyVisitChild(_operand, visitor); |
| 9791 } | 9954 } |
| 9955 |
| 9956 /** |
| 9957 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 9958 * propagated type information, then return the parameter element representing
the parameter to |
| 9959 * which the value of the operand will be bound. Otherwise, return {@code null
}. |
| 9960 * <p> |
| 9961 * This method is only intended to be used by {@link Expression#getParameterEl
ement()}. |
| 9962 * @return the parameter element representing the parameter to which the value
of the right |
| 9963 * operand will be bound |
| 9964 */ |
| 9965 ParameterElement get propagatedParameterElementForOperand { |
| 9966 if (_propagatedElement == null) { |
| 9967 return null; |
| 9968 } |
| 9969 List<ParameterElement> parameters2 = _propagatedElement.parameters; |
| 9970 if (parameters2.length < 1) { |
| 9971 return null; |
| 9972 } |
| 9973 return parameters2[0]; |
| 9974 } |
| 9975 |
| 9976 /** |
| 9977 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 9978 * type information, then return the parameter element representing the parame
ter to which the |
| 9979 * value of the operand will be bound. Otherwise, return {@code null}. |
| 9980 * <p> |
| 9981 * This method is only intended to be used by {@link Expression#getStaticParam
eterElement()}. |
| 9982 * @return the parameter element representing the parameter to which the value
of the right |
| 9983 * operand will be bound |
| 9984 */ |
| 9985 ParameterElement get staticParameterElementForOperand { |
| 9986 if (_staticElement == null) { |
| 9987 return null; |
| 9988 } |
| 9989 List<ParameterElement> parameters2 = _staticElement.parameters; |
| 9990 if (parameters2.length < 1) { |
| 9991 return null; |
| 9992 } |
| 9993 return parameters2[0]; |
| 9994 } |
| 9792 } | 9995 } |
| 9793 /** | 9996 /** |
| 9794 * Instances of the class {@code PrefixedIdentifier} represent either an identif
ier that is prefixed | 9997 * Instances of the class {@code PrefixedIdentifier} represent either an identif
ier that is prefixed |
| 9795 * or an access to an object property where the target of the property access is
a simple | 9998 * or an access to an object property where the target of the property access is
a simple |
| 9796 * identifier. | 9999 * identifier. |
| 9797 * <pre> | 10000 * <pre> |
| 9798 * prefixedIdentifier ::={@link SimpleIdentifier prefix} '.' {@link SimpleIdenti
fier identifier}</pre> | 10001 * prefixedIdentifier ::={@link SimpleIdentifier prefix} '.' {@link SimpleIdenti
fier identifier}</pre> |
| 9799 * @coverage dart.engine.ast | 10002 * @coverage dart.engine.ast |
| 9800 */ | 10003 */ |
| 9801 class PrefixedIdentifier extends Identifier { | 10004 class PrefixedIdentifier extends Identifier { |
| (...skipping 5449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15251 return elements[elements.length - 1].endToken; | 15454 return elements[elements.length - 1].endToken; |
| 15252 } | 15455 } |
| 15253 /** | 15456 /** |
| 15254 * Return the node that is the parent of each of the elements in the list. | 15457 * Return the node that is the parent of each of the elements in the list. |
| 15255 * @return the node that is the parent of each of the elements in the list | 15458 * @return the node that is the parent of each of the elements in the list |
| 15256 */ | 15459 */ |
| 15257 ASTNode getOwner() { | 15460 ASTNode getOwner() { |
| 15258 return owner; | 15461 return owner; |
| 15259 } | 15462 } |
| 15260 } | 15463 } |
| OLD | NEW |