Skip to content

Commit

Permalink
Preparation work for type changes; see: #36
Browse files Browse the repository at this point in the history
  • Loading branch information
cpurdy committed Jun 22, 2022
1 parent 1eb4c78 commit 71cd9cc
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions doc/bnf.x
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ ElseComposition
Composition
"extends" TypeExpression ArgumentList-opt
"implements" ExtendedTypeExpression
"delegates" ExtendedTypeExpression "(" Expression ")"
"delegates" AnyTypeExpression "(" Expression ")"
"incorporates" IncorporatesFinish
"into" ExtendedTypeExpression
"into" AnyTypeExpression
ImportClause QualifiedName VersionRequirement-opt
"default" "(" Expression ")"

Expand Down Expand Up @@ -579,7 +579,7 @@ UsingStatement
"using" "(" UsingResources ")" StatementBlock

TypeDefStatement
"typedef" ExtendedTypeExpression "as" Name ";"
"typedef" AnyTypeExpression "as" Name ";"

#
# expressions
Expand Down Expand Up @@ -730,8 +730,8 @@ PostfixExpression
PostfixExpression NoWhitespace "?"
PostfixExpression "." "&"-opt Name TypeParameterTypeList-opt
PostfixExpression ".new" NewFinish
PostfixExpression ".as" "(" ExtendedTypeExpression ")"
PostfixExpression ".is" "(" ExtendedTypeExpression ")"
PostfixExpression ".as" "(" AnyTypeExpression ")"
PostfixExpression ".is" "(" AnyTypeExpression ")"

ArrayDims
"[" DimIndicators-opt "]"
Expand Down Expand Up @@ -1086,6 +1086,22 @@ TypeExpression
ExtendedTypeExpression
ExtendedUnionedTypeExpression

AnyTypeExpression
AnonTypeExpression
ExtendedTypeExpression

AnonTypeExpression
"{" NameOrSignatureList ";" "}" # note: at least one name or signature is required

NameOrSignatureList
NameOrSignature
NameOrSignatureList ";" NameOrSignature

NameOrSignature
Name # ref to 1+ property/method
PropertyModifiers-opt TypeExpression Name # property
MethodModifiers-opt TypeParameterList-opt MethodIdentity ParameterList # method

# '+' creates a union of two types; '-' creates a difference of two types
UnionedTypeExpression
IntersectingTypeExpression
Expand All @@ -1102,6 +1118,7 @@ IntersectingTypeExpression
IntersectingTypeExpression | NonBiTypeExpression

ExtendedIntersectingTypeExpression
AnonTypeExpression
ExtendedNonBiTypeExpression
ExtendedIntersectingTypeExpression | ExtendedNonBiTypeExpression

Expand Down

0 comments on commit 71cd9cc

Please sign in to comment.