From 4933c8f3c5694d5e84ee510f39d16eae91c3832c Mon Sep 17 00:00:00 2001 From: Kevin Glynn Date: Tue, 19 Oct 2010 14:48:32 +0200 Subject: [PATCH] Mark static methods --- .../antlr3/src/cs2j/CLR/TranslationTemplate.cs | 11 +++++++++-- CSharpTranslator/antlr3/src/cs2jTemplateGen/Main.cs | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CSharpTranslator/antlr3/src/cs2j/CLR/TranslationTemplate.cs b/CSharpTranslator/antlr3/src/cs2j/CLR/TranslationTemplate.cs index f249598..851d685 100644 --- a/CSharpTranslator/antlr3/src/cs2j/CLR/TranslationTemplate.cs +++ b/CSharpTranslator/antlr3/src/cs2j/CLR/TranslationTemplate.cs @@ -302,8 +302,14 @@ namespace RusticiSoftware.Translator.CLR // Return type public string Return { get; set; } + // isStatic method? + [XmlAttribute("static")] + [System.ComponentModel.DefaultValueAttribute(false)] + public bool IsStatic{ get; set; } + public MethodRepTemplate () { + IsStatic = false; } public MethodRepTemplate (string retType, string methodName, string[] tParams, List pars, string[] imps, string javaRep) : base(pars, imps, javaRep) @@ -311,6 +317,7 @@ namespace RusticiSoftware.Translator.CLR Name = methodName; TypeParams = tParams; Return = retType; + IsStatic = false; } public MethodRepTemplate (string retType, string methodName, string[] tParams, List pars) : this(retType, methodName, tParams, pars, null, null) @@ -332,7 +339,7 @@ namespace RusticiSoftware.Translator.CLR } } - return Return == other.Return && Name == other.Name && base.Equals(other); + return Return == other.Return && Name == other.Name && IsStatic == other.IsStatic && base.Equals(other); } public override bool Equals (object obj) @@ -364,7 +371,7 @@ namespace RusticiSoftware.Translator.CLR } } - return hashCode ^ (Return ?? String.Empty).GetHashCode () ^ (Name ?? String.Empty).GetHashCode () ^ base.GetHashCode(); + return hashCode ^ (Return ?? String.Empty).GetHashCode () ^ (Name ?? String.Empty).GetHashCode () ^ IsStatic.GetHashCode() ^ base.GetHashCode(); } #endregion diff --git a/CSharpTranslator/antlr3/src/cs2jTemplateGen/Main.cs b/CSharpTranslator/antlr3/src/cs2jTemplateGen/Main.cs index 874ac0a..b6b2426 100644 --- a/CSharpTranslator/antlr3/src/cs2jTemplateGen/Main.cs +++ b/CSharpTranslator/antlr3/src/cs2jTemplateGen/Main.cs @@ -110,6 +110,9 @@ namespace cs2j.Template.Utils methRep.TypeParams = tParams; } buildParameters(methRep, m); + if (m.IsStatic) { + methRep.IsStatic = true; + } iface.Methods.Add(methRep); }