public MethodDefinition(string objname, string name, ParametersSection @params, TypeNode ret = null, RoutineDirectives dirs = null, MethodKind kind = MethodKind.Default, RoutineSection body = null) : base(objname, name, @params, ret, dirs, kind) { this.body = body; }
public RoutineDefinition(string name, ParametersSection @params, TypeNode ret = null, RoutineDirectives dirs = null, RoutineSection body = null) : base(name, @params, ret, dirs) { this.body = body; body.declaringCallable = this; }
public RoutineDeclaration(string name, ParametersSection @params, TypeNode ret = null, RoutineDirectives dirs = null) : base(name, @params, ret, dirs) { if (Directives == null) { Directives = new RoutineDirectives(); } }
public ProceduralType(ParametersSection @params, TypeNode ret = null, RoutineDirectives dirs = null) { this.@params = @params; this.funcret = ret; if (dirs != null) { Directives = dirs; } if (ret != null) { // TODO check and emit error if any parameter is named 'Result' @params.returnVar = new OutParamDeclaration("result", ret); } }
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"); } } }
public MethodType(ParametersSection @params, TypeNode ret = null, RoutineDirectives dirs = null, MethodKind kind = MethodKind.Default) : base(@params, ret, dirs) { this.kind = kind; }
public CallableDeclaration(string name, ParametersSection @params, TypeNode ret = null, RoutineDirectives dirs = null) : base(name, new ProceduralType(@params, ret, dirs)) { }
public ExportItem(String name, ParametersSection pars, int index) : base(name) { this.formalparams = pars; this.index = index; }
public ExportItem(String name, ParametersSection pars, String exportname = null) : base(name) { this.formalparams = pars; this.exportname = exportname; }
public override bool Equals(object obj) { ParametersSection sec = obj as ParametersSection; return(sec != null && returnVar.Equals(sec.returnVar) && decls.SequenceEqual(sec.decls)); }