public override void VisitRoutine(RoutineDefinition rout)
{
rout.Arguments.Accept(this);
rout.ReturnType.Accept(this);
TypeBuilder typeBuilder = currentClass.TypeBuilder;
try {
CheckMethodConfliction(currentClass.TypeData, rout.Name,
rout.ReturnType.NodeType,
rout.Arguments);
}
catch (MethodConflictionException e) {
report.Error(rout.Location, e.Message);
return;
}
CheckMethodConformance(currentClass.TypeData, rout.Name,
rout.ReturnType.NodeType,
rout.Arguments,
ancestorMethods);
MethodAttributes attributes =
MethodAttributes.Virtual | MethodAttributes.HideBySig;
switch (rout.Modifier) {
case RoutineModifier.None:
attributes |= MethodAttributes.Public;
break;
case RoutineModifier.Private:
attributes |= MethodAttributes.Private;
break;
}
rout.MethodBuilder =
DefineMethod(typeBuilder, rout.Name, attributes,
rout.ReturnType.NodeType, rout.Arguments);
}