public override void EnterProperty([NotNull] XSharpParser.PropertyContext context) { String name = ""; // if (context.Id != null) { name = context.Id.GetText(); } if (context.SELF() != null) { name = context.SELF()?.GetText(); } var tokens = context.Modifiers?._Tokens; XTypeMember newMethod = new XTypeMember(name, Kind.Property, decodeModifiers(tokens), decodeVisibility(tokens), new TextRange(context), new TextInterval(context), (context.Type == null) ? "Void" : context.Type.GetText(), isStatic(tokens)); // addParameters(context.Params, newMethod); // addMember(newMethod); }
public override void EnterProperty([NotNull] XSharpParser.PropertyContext context) { // Ok, let's "cheat" : We will not analyze the element // we will just copy the whole source code in a Snippet Member CodeSnippetTypeMember snippet = CreateSnippetMember(context); writeTrivia(snippet, context); this.CurrentClass.Members.Add(snippet); }
public override void ExitProperty([NotNull] XSharpParser.PropertyContext context) { var isInInterface = context.isInInterface(); var isExtern = context.Modifiers?.EXTERN().Length > 0; var isAbstract = context.Modifiers?.ABSTRACT().Length > 0; bool HasBody = (context.Auto != null || context.Multi != null); if (!HasBody) { foreach (var aCtx in context._LineAccessors) { if (aCtx.Expr != null && aCtx.ExprList != null) { HasBody = true; } } } if (HasBody) { if (isInInterface) { _parseErrors.Add(new ParseErrorData(context.Start, ErrorCode.ERR_InterfaceMemberHasBody, "Property")); } if (isExtern) { _parseErrors.Add(new ParseErrorData(context.Start, ErrorCode.ERR_ExternHasBody, "Property")); } if (isAbstract) { _parseErrors.Add(new ParseErrorData(context.Start, ErrorCode.ERR_AbstractHasBody, "Property")); } } if (isAbstract && isExtern) { _parseErrors.Add(new ParseErrorData(context.Modifiers, ErrorCode.ERR_AbstractAndExtern)); } }
public override void ExitProperty([NotNull] XSharpParser.PropertyContext context) { TagRegion(context, context.ChildCount - 2); }
public override void ExitProperty([NotNull] XSharpParser.PropertyContext context) { endMember(context); }