Skip to content

Commit

Permalink
updated jars, start for GuardedPattern and NullPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMOBrien committed Feb 21, 2024
1 parent 22da2cc commit f96b0d5
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 56 deletions.
Binary file removed lib/datagen/org.eclipse.core.commands-3.10.200.jar
Binary file not shown.
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.core.expressions-3.8.200.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.core.filesystem-1.9.500.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.core.jobs-3.13.100.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.core.resources-3.18.0.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.core.runtime-3.26.0.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.equinox.app-1.6.200.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.equinox.common-3.16.200.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.jdt.core-3.31.0.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.osgi-3.18.100.jar
Binary file not shown.
Binary file removed lib/datagen/org.eclipse.text-3.12.200.jar
Binary file not shown.
141 changes: 85 additions & 56 deletions src/compiled-proto/boa/types/Ast.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions src/java/boa/datagen/util/JavaVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public class JavaVisitor extends ASTVisitor {
public static final int JLS15 = 15;
public static final int JLS16 = 16;
public static final int JLS17 = 17;
public static final int JLS18 = 18;
public static final int JLS19 = 19;
public static final int JLS20 = 20;
public static final int JLS21 = 21;

public static final int SOURCE_JAVA_ERROR = 999;

protected CompilationUnit root = null;
Expand Down Expand Up @@ -2573,6 +2578,33 @@ public boolean visit(final RecordDeclaration node) {
return false;
}

//begin Java 21

@Override
public boolean visit(final NullPattern node) {
setAstLevel(JLS21);

final boa.types.Ast.Expression.Builder eb = boa.types.Ast.Expression.newBuilder();
eb.setKind(boa.types.Ast.Expression.ExpressionKind.NULL_PATTERN);
expressions.push(eb.build());

return false;
}

@Override
public boolean visit(final GuardedPattern node) {
setAstLevel(JLS21);

final boa.types.Ast.Expression.Builder eb = boa.types.Ast.Expression.newBuilder();
eb.setKind(boa.types.Ast.Expression.ExpressionKind.GUARDED_PATTERN);
eb.addExpressions(expressions.pop());
node.getPattern().accept(this);
eb.addExpressions(expressions.pop());
expressions.push(eb.build());

return false;
}

//////////////////////////////////////////////////////////////
// Utility methods

Expand Down
3 changes: 3 additions & 0 deletions src/proto/ast.proto
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ message Expression {
PROVIDES = 106;
PACKAGE_NAME = 107;
MODULE_NAME = 108;
PATTERN = 109;
NULL_PATTERN = 110;
GUARDED_PATTERN = 111;
}
/** The kind of expression */
required ExpressionKind kind = 1;
Expand Down

0 comments on commit f96b0d5

Please sign in to comment.