While I was looking at C# Language Specification v4.0 , I noticed that there was a rule group defined as follows:
invocationExpression: primaryExpression '(' argumentList? ')' primary-expression: primary-no-array-creation-expression array-creation-expression primary-no-array-creation-expression: literal simple-name parenthesized-expression member-access invocation-expression element-access this-access base-access post-increment-expression post-decrement-expression object-creation-expression delegate-creation-expression anonymous-object-creation-expression typeof-expression checked-expression unchecked-expression default-value-expression anonymous-method-expression base-access: 'base' '.' identifier 'base' '[' argument-list ']'
When I tried to compare this statement (which, by the way, is correct, I saw how it was used in the project)
base.VisitList<T>(list, visitor);
to these rules, I have not seen a way how to do this. There should be no base-access defined as:
base-access: 'base' '.' identifier type-parameter-list(opt) 'base' '[' argument-list ']'
or something similar in such a way that the grammar can capture the statement?
EDIT The example I saw was in the C # version of the db4o project, and it is something like this (I deleted most of the ads and left only the important ones)
internal abstract class ExpressionVisitor { protected virtual void VisitList<T>() { } } internal class HashCodeCalculation : ExpressionVisitor { protected override void VisitList<T>() { base.VisitList<T>(); } }
source share