@@ -1251,6 +1251,14 @@ class ClassInstanceExpr extends Expr, ConstructorCall, @classinstancexpr {
1251
1251
override string getAPrimaryQlClass ( ) { result = "ClassInstanceExpr" }
1252
1252
}
1253
1253
1254
+ /**
1255
+ * An explicit `new ClassName(...)` expression.
1256
+ *
1257
+ * Note this does not include implicit instance creation such as lambda expressions
1258
+ * or `instanceVar::methodName` references. To include those too, use `ClassInstanceExpr`.
1259
+ */
1260
+ class NewClassExpr extends @newexpr, ClassInstanceExpr { }
1261
+
1254
1262
/** A functional expression is either a lambda expression or a member reference expression. */
1255
1263
abstract class FunctionalExpr extends ClassInstanceExpr {
1256
1264
/** Gets the implicit method corresponding to this functional expression. */
@@ -1768,24 +1776,29 @@ class VarAccess extends Expr, @varaccess {
1768
1776
Variable getVariable ( ) { variableBinding ( this , result ) }
1769
1777
1770
1778
/**
1771
- * Holds if this variable access is an l-value .
1779
+ * Holds if this variable access is a write access .
1772
1780
*
1773
- * An l-value is a write access to a variable, which occurs as the destination of an assignment.
1781
+ * That means the access is the destination of an assignment.
1774
1782
*/
1775
- predicate isLValue ( ) {
1783
+ predicate isVarWrite ( ) {
1776
1784
exists ( Assignment a | a .getDest ( ) = this ) or
1777
1785
exists ( UnaryAssignExpr e | e .getExpr ( ) = this )
1778
1786
}
1779
1787
1788
+ /** DEPRECATED: Alias for `isVarWrite`. */
1789
+ deprecated predicate isLValue ( ) { this .isVarWrite ( ) }
1790
+
1780
1791
/**
1781
- * Holds if this variable access is an r-value .
1792
+ * Holds if this variable access is a read access .
1782
1793
*
1783
- * An r-value is a read access to a variable.
1784
1794
* In other words, it is a variable access that does _not_ occur as the destination of
1785
1795
* a simple assignment, but it may occur as the destination of a compound assignment
1786
1796
* or a unary assignment.
1787
1797
*/
1788
- predicate isRValue ( ) { not exists ( AssignExpr a | a .getDest ( ) = this ) }
1798
+ predicate isVarRead ( ) { not exists ( AssignExpr a | a .getDest ( ) = this ) }
1799
+
1800
+ /** DEPRECATED: Alias for `isVarRead`. */
1801
+ deprecated predicate isRValue ( ) { this .isVarRead ( ) }
1789
1802
1790
1803
/** Gets a printable representation of this expression. */
1791
1804
override string toString ( ) {
@@ -1831,37 +1844,43 @@ class ExtensionReceiverAccess extends VarAccess {
1831
1844
}
1832
1845
1833
1846
/**
1834
- * An l-value is a write access to a variable, which occurs as the destination of an assignment.
1847
+ * A write access to a variable, which occurs as the destination of an assignment.
1835
1848
*/
1836
- class LValue extends VarAccess {
1837
- LValue ( ) { this .isLValue ( ) }
1849
+ class VarWrite extends VarAccess {
1850
+ VarWrite ( ) { this .isVarWrite ( ) }
1838
1851
1839
1852
/**
1840
- * Gets a source expression used in an assignment to this l-value .
1853
+ * Gets the right-hand side of the assignment that executes this variable write .
1841
1854
*
1842
1855
* For assignments using the `=` operator, the source expression
1843
1856
* is simply the RHS of the assignment.
1844
1857
*
1845
- * Note that for l-values occurring on the LHS of compound assignment operators
1858
+ * Note that for writes occurring on the LHS of compound assignment operators
1846
1859
* (such as (`+=`), both the RHS and the LHS of the compound assignment
1847
1860
* are source expressions of the assignment.
1848
1861
*/
1849
1862
Expr getRhs ( ) { exists ( Assignment e | e .getDest ( ) = this and e .getSource ( ) = result ) }
1850
1863
}
1851
1864
1865
+ /** DEPRECATED: Alias for `VarWrite`. */
1866
+ deprecated class LValue = VarWrite ;
1867
+
1852
1868
/**
1853
- * An r-value is a read access to a variable.
1869
+ * A read access to a variable.
1854
1870
*
1855
1871
* In other words, it is a variable access that does _not_ occur as the destination of
1856
1872
* a simple assignment, but it may occur as the destination of a compound assignment
1857
1873
* or a unary assignment.
1858
1874
*/
1859
- class RValue extends VarAccess {
1860
- RValue ( ) { this .isRValue ( ) }
1875
+ class VarRead extends VarAccess {
1876
+ VarRead ( ) { this .isVarRead ( ) }
1861
1877
}
1862
1878
1879
+ /** DEPRECATED: Alias for `VarRead`. */
1880
+ deprecated class RValue = VarRead ;
1881
+
1863
1882
/** A method access is an invocation of a method with a list of arguments. */
1864
- class MethodAccess extends Expr , Call , @methodaccess {
1883
+ class MethodCall extends Expr , Call , @methodaccess {
1865
1884
/** Gets the qualifying expression of this method access, if any. */
1866
1885
override Expr getQualifier ( ) { result .isNthChildOf ( this , - 1 ) }
1867
1886
@@ -1924,6 +1943,9 @@ class MethodAccess extends Expr, Call, @methodaccess {
1924
1943
override string getAPrimaryQlClass ( ) { result = "MethodAccess" }
1925
1944
}
1926
1945
1946
+ /** DEPRECATED: Alias for `MethodCall`. */
1947
+ deprecated class MethodAccess = MethodCall ;
1948
+
1927
1949
/** A type access is a (possibly qualified) reference to a type. */
1928
1950
class TypeAccess extends Expr , Annotatable , @typeaccess {
1929
1951
/** Gets the qualifier of this type access, if any. */
0 commit comments