Changeset a1294db in tol
- Timestamp:
- May 31, 2011, 9:44:36 AM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 04637383
- Parents:
- 3130ef1
- File:
-
- 1 edited
-
tol/btol/text_type/txtgra.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/text_type/txtgra.cpp
r3130ef1 ra1294db 975 975 contens_=Arg(1)->Identify(); 976 976 } 977 /* 977 978 static BText Description_second_arg_error = 979 I2("If optional second argument <member> is specified, then must be " 980 "the name of a member of the class specified as an string in first one.", 981 "Si se especifica el segundo argumento opcional <member>, debe ser el " 982 "nombre de un miembro de la clase especificada como un texto en el primer " 983 "argumento"); 984 978 985 //-------------------------------------------------------------------- 979 986 DeclareContensClass(BText, BTxtTemporary, BTxtDescription); 980 DefExtOpr(1, BTxtDescription, "Description", 1, 2, "Anything Real", 981 "(Anything var [, Real userType=False])", 982 I2("Returns the description of a variable. " 983 "If first parameter <var> is a text and optional parameter " 984 "<userType> is true then searches the Class or Struct which " 985 "name is the contens of <var> and returns its description.", 986 "Devuelve la descripción de una variable. Si el argumento " 987 "<var> es un texto y el arguemnto opcional <userType> es " 988 "cierto, entonces busca el tipo de usuario, Struct o Class, " 989 "cuyo nombre es el contenido de <var>"), 990 BOperClassify::General_); 991 */ 992 DeclareContensClass(BText, BTxtTemporary, BTxtDescription); 993 DefExtOpr(1, BTxtDescription, "Description", 1, 1, "Anything", 994 "(Anything var)", 987 DefExtOpr(1, BTxtDescription, "Description", 1, 2, "Anything Text", 988 "(Anything var [,Text member])", 995 989 I2("Returns the description of a variable. " 996 990 "If first parameter <var> is a constant string true then " … … 1000 994 "<var> es una cadena constante, entonces busca el tipo de " 1001 995 "usuario, Struct o Class, cuyo nombre es el contenido de " 1002 "<var>") ,996 "<var>")+"\n"+Description_second_arg_error, 1003 997 BOperClassify::General_); 1004 998 //-------------------------------------------------------------------- … … 1006 1000 //-------------------------------------------------------------------- 1007 1001 { 1002 1008 1003 BSyntaxObject* arg1 = Arg(1); 1009 1004 contens_=arg1->Description(); 1010 1011 if(!contens_.HasName() && 1012 (arg1->Grammar()==GraText()) && 1013 (!arg1->HasName())) 1014 { 1015 BText& txt = Text(arg1); 1016 BClass* cls = FindClass(txt,-1); 1017 if(cls) { contens_ = cls->Description(); } 1018 else 1005 BText memberName = ""; 1006 if(Arg(2)) 1007 { 1008 BText err=""; 1009 memberName = Text(Arg(2)); 1010 bool ok = arg1->Grammar()==GraText(); 1011 if(ok) 1019 1012 { 1020 BStruct* str = FindStruct(txt); 1021 if(str) { contens_ = str->Description(); } 1022 } 1023 } 1024 if(!contens_.HasName() && 1025 (arg1->Grammar()==GraCode()) && 1026 (arg1->Mode()==BOBJECTMODE)) 1027 { 1028 BUserCode* uCode = UCode(arg1); 1029 const BSpecialFunction* spf = uCode->Contens().SpecialFunction(); 1030 if(spf) 1031 { 1032 contens_=spf->Description(); 1013 BText className = Text(arg1); 1014 BClass* cls = FindClass(className,1); 1015 if(ok = (cls!=NULL)) 1016 { 1017 BMember* mbr = cls->FindMember(memberName); 1018 if(ok = (mbr!=NULL)) 1019 { 1020 contens_ = mbr->description_; 1021 } 1022 else 1023 { 1024 err = memberName+I2(" is not a member of Class ", 1025 " no es un mimebro de Class ")+className; 1026 } 1027 } 1028 else 1029 { 1030 err = className+I2(" is not a Class", 1031 " no es un Class"); 1032 } 1033 1033 } 1034 1034 else 1035 1035 { 1036 BOperator* opr = uCode->Contens().Operator(); 1037 if(opr) 1036 err = I2("First argument is not a Text", 1037 "El primer argumento no es un Text"); 1038 } 1039 if(!ok) 1040 { 1041 Error(BText("[Description] ")+Description_second_arg_error+"\n"+err); 1042 } 1043 } 1044 else 1045 { 1046 if(!contens_.HasName() && 1047 (arg1->Grammar()==GraText()) && 1048 (!arg1->HasName())) 1049 { 1050 BText& txt = Text(arg1); 1051 BClass* cls = FindClass(txt,-1); 1052 if(cls) { contens_ = cls->Description(); } 1053 else 1038 1054 { 1039 contens_=opr->Description(); 1040 if(!contens_.HasName()) { contens_ = opr->Expression(); } 1055 BStruct* str = FindStruct(txt); 1056 if(str) { contens_ = str->Description(); } 1057 } 1058 } 1059 if(!contens_.HasName() && 1060 (arg1->Grammar()==GraCode()) && 1061 (arg1->Mode()==BOBJECTMODE)) 1062 { 1063 BUserCode* uCode = UCode(arg1); 1064 const BSpecialFunction* spf = uCode->Contens().SpecialFunction(); 1065 if(spf) 1066 { 1067 contens_=spf->Description(); 1041 1068 } 1042 1069 else 1043 1070 { 1044 contens_="NOT FOUND"; 1071 BOperator* opr = uCode->Contens().Operator(); 1072 if(opr) 1073 { 1074 contens_=opr->Description(); 1075 if(!contens_.HasName()) { contens_ = opr->Expression(); } 1076 } 1077 else 1078 { 1079 contens_="NOT FOUND"; 1080 } 1045 1081 } 1046 1082 } 1083 if(!contens_.HasName()) { contens_ = arg1->Expression(); } 1047 1084 } 1048 if(!contens_.HasName()) { contens_ = arg1->Expression(); }1049 1085 } 1050 1086
Note: See TracChangeset
for help on using the changeset viewer.
