public void Add(MethodDirectives dirs) { base.Add(dirs); foreach (MethodDirective dir in dirs.methoddirs) { methoddirs.Add(dir); } }
public MethodDeclaration(string objname, string name, ParametersSection @params, TypeNode ret = null, RoutineDirectives dirs = null, MethodKind kind = MethodKind.Default) : base(name, new MethodType(@params, ret, dirs, kind)) { this.objname = objname; isStatic = false; fullname = objname + "." + name; if (Directives == null) { Directives = new MethodDirectives(); } foreach (var param in @params.decls) { if (param.name == "self") { throw new IdentifierRedeclared("Method parameter cannot shadow 'self' reference"); } } }