public static new FORMAL_GENERIC parse(iSCOPE context) { Debug.Indent(); Debug.WriteLine("Entering FORMAL_GENERIC.parse"); Token id = expect(TokenCode.Identifier); if (id == null) { return(null); // error } FORMAL_GENERIC result = null; Token token = get(); if (token.code == TokenCode.Colon) { forget(); result = FORMAL_NONTYPE.parse(id, context); } else { result = FORMAL_TYPE.parse(id, context); } Debug.WriteLine("Exiting FORMAL_GENERIC.parse"); Debug.Unindent(); return(result); }
public static FORMAL_NONTYPE parse(Token id, iSCOPE context) { Debug.Indent(); Debug.WriteLine("Entering FORMAL_NONTYPE.parse"); // parameter name is passed via 'id'. // ':' is already eaten. FORMAL_NONTYPE generic_nontype_par = new FORMAL_NONTYPE(id); TYPE type = TYPE.parse(context); generic_nontype_par.type = type; type.parent = generic_nontype_par; Debug.WriteLine("Exiting FORMAL_NONTYPE.parse"); Debug.Unindent(); generic_nontype_par.setSpan(id.span, type.span); return(generic_nontype_par); }