void FUNCTION(out pBaseLangObject outObj, pBaseLangObject parent, Encapsulation e) { var obj = new Function(parent); obj.encapsulation = e; outObj = obj; pBaseLangObject blo; VarType v; if (la.kind == 57) { Get(); obj.IsAsync = true; } if (la.kind == 58) { Get(); obj.Override = true; } if (StartOf(2)) { VARTYPE(out v); obj.varType = new VarTypeObject(v); } else if (la.kind == 48) { Get(); obj.varType = new VarTypeObject(VarType.Void); } else if (StartOf(12)) { bool isStrict = false; if (la.kind == 49) { Get(); isStrict = true; } IDENTACCESS(out blo, obj, false); obj.varType = new VarTypeObject((Ident)blo, isStrict); if (la.kind == 21) { Template te; TEMPLATE(out te, outObj); obj.varType.TemplateObject = te; } } else SynErr(94); IDENT(out blo, obj); obj.Name = (Ident)blo; Expect(10); if (StartOf(13)) { NEWVARIABLE(out blo, obj); obj.addChild(blo); while (la.kind == 18) { Get(); NEWVARIABLE(out blo, obj); obj.addChild(blo); } } Expect(11); obj.markArgListEnd(); Expect(14); while (StartOf(14)) { CODEINSTRUCTION(out blo, obj); obj.addChild(blo); } Expect(15); }
void CONSTRUCTOR(out pBaseLangObject outObj, pBaseLangObject parent, Encapsulation e) { var obj = new Function(parent); obj.varType = new VarTypeObject(((oosClass)parent).Name, true); obj.encapsulation = e; outObj = obj; pBaseLangObject blo; IDENT(out blo, obj); obj.Name = (Ident)blo; Expect(10); if (StartOf(13)) { NEWVARIABLE(out blo, obj); obj.addChild(blo); while (la.kind == 18) { Get(); NEWVARIABLE(out blo, obj); obj.addChild(blo); } } Expect(11); obj.markArgListEnd(); if (la.kind == 59) { Get(); IDENTACCESS(out blo, obj); obj.addChild(blo); while (StartOf(1)) { IDENTACCESS(out blo, obj); obj.addChild(blo); } } obj.markBaseCallEnd(); Expect(14); while (StartOf(14)) { CODEINSTRUCTION(out blo, obj); obj.addChild(blo); } Expect(15); }