public override void ExitXppinlineMethod([NotNull] XP.XppinlineMethodContext context) { // should do the same as the 'normal' methods in VO Class // method init becomes constructor // method initClass becomes Class constructor context.SetSequencePoint(context.I, context.end.Stop); if (context.Info == null) // This should not happen { context.AddError(new ParseErrorData(context, ErrorCode.WRN_XPPMethodNotDeclared, context.ShortName)); // setup dummy declaration context.Info = new XppDeclaredMethodInfo() { Name = context.ShortName, Parent = _currentClass, Declaration = context, Entity = context, Visibility = XP.HIDDEN, Inline = true }; } if (context.Data.IsInitAxit) { implementConstructor(context); return; } var attributes = context.Attributes?.GetList <AttributeListSyntax>() ?? EmptyList <AttributeListSyntax>(); var modifiers = decodeXppMemberModifiers(context.Info.Visibility, false, context.Modifiers?._Tokens); TypeSyntax returnType = context.Type?.Get <TypeSyntax>(); if (returnType == null) { returnType = _getMissingType(); } var parameters = context.ParamList?.Get <ParameterListSyntax>() ?? EmptyParameterList(); var method = XppCreateMethod(context, context.Id.Get <SyntaxToken>(), attributes, modifiers, parameters, returnType); context.Put(method); }
public override void EnterXppinlineMethod([NotNull] XP.XppinlineMethodContext context) { // should do the same as the 'normal' methods in VO Class // method init becomes constructor // method initClass becomes Class constructor Check4ClipperCC(context, context.ParamList?._Params, null, context.Type); CheckInitMethods(context); var decl = new XppDeclaredMethodInfo() { Name = context.ShortName, Parent = _currentClass, Visibility = _currentClass.CurrentVisibility, Declaration = context, Entity = context, Inline = true }; context.Info = decl; _currentClass.Methods.Add(decl); }