[operators][1/2]feat: Add Assignment operation expr with multiply and assignment operator by summer-ji-eng · Pull Request #320 · googleapis/sdk-platform-java · GitHub
Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public interface AstNodeVisitor {

public void visit(LogicalOperationExpr logicalOperationExpr);

public void visit(AssignmentOperationExpr assignmentOperationExpr);

/** =============================== COMMENT =============================== */
public void visit(LineComment lineComment);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public enum OperatorKind {
ARITHMETIC_ADDITION,
LOGICAL_AND,
LOGICAL_OR,
ASSIGNMENT_XOR,
ASSIGNMENT_MULTIPLY,
RELATIONAL_EQUAL_TO,
RELATIONAL_NOT_EQUAL_TO,
RELATIONAL_LESS_THAN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ public static boolean isNumericType(TypeNode type) {
|| type.equals(TypeNode.BYTE);
}

public static boolean isFloatingPointType(TypeNode type) {
return type.equals(TypeNode.DOUBLE) || type.equals(TypeNode.FLOAT);
}

public static boolean isBoxedType(TypeNode type) {
return isReferenceType(type) && BOXED_TYPE_MAP.containsValue(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.api.generator.engine.ast.AnonymousClassExpr;
import com.google.api.generator.engine.ast.ArithmeticOperationExpr;
import com.google.api.generator.engine.ast.AssignmentExpr;
import com.google.api.generator.engine.ast.AssignmentOperationExpr;
import com.google.api.generator.engine.ast.AstNodeVisitor;
import com.google.api.generator.engine.ast.BlockComment;
import com.google.api.generator.engine.ast.BlockStatement;
Expand Down Expand Up @@ -240,6 +241,12 @@ public void visit(LogicalOperationExpr logicalOperationExpr) {
logicalOperationExpr.rhsExpr().accept(this);
}

@Override
public void visit(AssignmentOperationExpr assignmentOperationExpr) {
assignmentOperationExpr.variableExpr().accept(this);
assignmentOperationExpr.valueExpr().accept(this);
}

/** =============================== STATEMENTS =============================== */
@Override
public void visit(ExprStatement exprStatement) {
Expand Down
Loading