void FunctionDeclaration() { if (currentMethod != null) { Error("Cannot define a function inside another function."); } Expect(13); Expect(57); Expect(18); Expect(1); currentMethod = new LOLMethod(GetFunction(t.val), program); short arg = 0; if (la.kind == 30) { Get(); Expect(1); currentMethod.SetArgumentName(arg++, t.val); while (la.kind == 48) { Get(); Expect(30); Expect(1); currentMethod.SetArgumentName(arg++, t.val); } } while (la.kind == 5) { Get(); } Statements(out currentMethod.statements); Expect(58); Expect(59); Expect(60); Expect(61); program.methods.Add(currentMethod.info.Name, currentMethod); currentMethod = null; }
void FunctionDeclaration() { if(currentMethod != null) Error("Cannot define a function inside another function."); Expect(13); Expect(57); Expect(18); Expect(1); currentMethod = new LOLMethod(GetFunction(t.val), program); short arg = 0; if (la.kind == 30) { Get(); Expect(1); currentMethod.SetArgumentName(arg++, t.val); while (la.kind == 48) { Get(); Expect(30); Expect(1); currentMethod.SetArgumentName(arg++, t.val); } } while (la.kind == 5) { Get(); } Statements(out currentMethod.statements); Expect(58); Expect(59); Expect(60); Expect(61); program.methods.Add(currentMethod.info.Name, currentMethod); currentMethod = null; }