Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/grammar/java.g')
-rw-r--r--org.eclipse.jdt.core/grammar/java.g35
1 files changed, 28 insertions, 7 deletions
diff --git a/org.eclipse.jdt.core/grammar/java.g b/org.eclipse.jdt.core/grammar/java.g
index a517fa85e6..65d6105666 100644
--- a/org.eclipse.jdt.core/grammar/java.g
+++ b/org.eclipse.jdt.core/grammar/java.g
@@ -1208,6 +1208,32 @@ CompactConstructorHeaderName ::= Modifiersopt TypeParameters 'Identifier'
-- 14 preview feature : end of record type
-----------------------------------------------
+-----------------------------------------------
+-- 14 preview feature : instanceof pattern matching
+-----------------------------------------------
+
+
+InstanceofExpression -> RelationalExpression
+InstanceofExpression ::= InstanceofExpression 'instanceof' TypeOrPattern
+/.$putCase consumeInstanceOfExpression(); $break ./
+/:$readableName Expression:/
+
+TypeOrPattern -> Type
+TypeOrPattern -> Pattern
+Pattern -> TypeTestPattern
+TypeTestPattern ::= Type Identifier
+/.$putCase consumeTypeTestPattern(); $break ./
+/:$readableName TypeTestPattern:/
+
+--InstanceofExpression ::= InstanceofExpression 'instanceof' Type Identifier
+--/.$putCase consumeInstanceOfExpressionPattern(); $break ./
+--/:$readableName Expression:/
+--/:$compliance 14:/
+
+-----------------------------------------------
+-- 14 preview feature : end of instanceof pattern matching
+-----------------------------------------------
+
ConstantDeclaration -> FieldDeclaration
/:$readableName ConstantDeclaration:/
@@ -2060,11 +2086,6 @@ RelationalExpression ::= RelationalExpression '>=' ShiftExpression
/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./
/:$readableName Expression:/
-InstanceofExpression -> RelationalExpression
-InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType
-/.$putCase consumeInstanceOfExpression(); $break ./
-/:$readableName Expression:/
-
EqualityExpression -> InstanceofExpression
EqualityExpression ::= EqualityExpression '==' InstanceofExpression
/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./
@@ -2671,9 +2692,9 @@ RelationalExpression_NotName ::= Name '>=' ShiftExpression
/:$readableName Expression:/
InstanceofExpression_NotName -> RelationalExpression_NotName
-InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType
+InstanceofExpression_NotName ::= Name 'instanceof' TypeOrPattern
/.$putCase consumeInstanceOfExpressionWithName(); $break ./
-InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType
+InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' TypeOrPattern
/.$putCase consumeInstanceOfExpression(); $break ./
/:$readableName Expression:/

Back to the top