-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathUpdateExpression.java
More file actions
36 lines (30 loc) · 899 Bytes
/
UpdateExpression.java
File metadata and controls
36 lines (30 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.semmle.js.ast;
/** An increment or decrement expression. */
public class UpdateExpression extends Expression {
private final String operator;
private final Expression argument;
private final boolean prefix;
public UpdateExpression(
SourceLocation loc, String operator, Expression argument, Boolean prefix) {
super("UpdateExpression", loc);
this.operator = operator;
this.argument = argument;
this.prefix = Boolean.TRUE.equals(prefix);
}
@Override
public <Q, A> A accept(Visitor<Q, A> v, Q q) {
return v.visit(this, q);
}
/** The operator of this expression. */
public String getOperator() {
return operator;
}
/** The argument of this expression. */
public Expression getArgument() {
return argument;
}
/** Is this a prefix increment or decrement expression? */
public boolean isPrefix() {
return prefix;
}
}