/// <exclude/> public static object create(string cls_name,Lexer yyl) { TCreator cr = (TCreator) yyl.tokens.types[cls_name]; // Console.WriteLine("TCreating {0} <{1}>",cls_name,yyl.yytext); if (cr==null) yyl.tokens.erh.Error(new CSToolsException(6,yyl,cls_name,String.Format("no factory for {0}",cls_name))); try { return cr(yyl); } catch (CSToolsException x) { yyl.tokens.erh.Error(x); } catch (Exception e) { yyl.tokens.erh.Error(new CSToolsException(7,yyl,cls_name, String.Format("Line {0}: Create of {1} failed ({2})",yyl.Saypos(yyl.m_pch),cls_name,e.Message))); } int j = cls_name.LastIndexOf('_'); if (j>0) { cr = (TCreator)yyl.tokens.types[cls_name.Substring(0,j)]; if (cr!=null) return cr(yyl); } return null; }
public static object create(string cls_name, Lexer yyl) { TCreator cr = (TCreator)yyl.tokens.types[cls_name]; // Console.WriteLine("TCreating {0} <{1}>",cls_name,yyl.yytext); if (cr == null) { yyl.tokens.erh.Error(new CSToolsException(6, yyl, cls_name, String.Format("no factory for {0}", cls_name))); } try { return(cr(yyl)); } catch (CSToolsException x) { yyl.tokens.erh.Error(x); } catch (Exception e) { yyl.tokens.erh.Error(new CSToolsException(7, yyl, cls_name, String.Format("Line {0}: Create of {1} failed ({2})", yyl.Saypos(yyl.m_pch), cls_name, e.Message))); } int j = cls_name.LastIndexOf('_'); if (j > 0) { cr = (TCreator)yyl.tokens.types[cls_name.Substring(0, j)]; if (cr != null) { return(cr(yyl)); } } return(null); }
public static object create(string cls_name, Lexer yyl) { TCreator type1 = (TCreator)yyl.tokens.types[(object)cls_name]; if (type1 == null) { yyl.tokens.erh.Error(new CSToolsException(6, yyl, cls_name, string.Format("no factory for {0}", (object)cls_name))); } try { return(type1(yyl)); } catch (CSToolsException ex) { yyl.tokens.erh.Error(ex); } catch (Exception ex) { yyl.tokens.erh.Error(new CSToolsException(7, yyl, cls_name, string.Format("Line {0}: Create of {1} failed ({2})", (object)yyl.Saypos(yyl.m_pch), (object)cls_name, (object)ex.Message))); } int length = cls_name.LastIndexOf('_'); if (length > 0) { TCreator type2 = (TCreator)yyl.tokens.types[(object)cls_name.Substring(0, length)]; if (type2 != null) { return(type2(yyl)); } } return((object)null); }