📄 csymbolinfo.class
字号:
' Gambas class fileSTATIC PRIVATE $cTypeName AS NEW CollectionPUBLIC Name AS StringPUBLIC Type AS StringPUBLIC Kind AS StringPUBLIC Signature AS StringPUBLIC Value AS StringPUBLIC Class AS StringPUBLIC Component AS StringPUBLIC NotPublic AS BooleanPUBLIC LineNumber AS IntegerSTATIC PUBLIC SUB _init() $cTypeName["b"] = "Boolean" $cTypeName["c"] = "Byte" $cTypeName["h"] = "Short" $cTypeName["i"] = "Integer" $cTypeName["d"] = "Date" $cTypeName["f"] = "Float" $cTypeName["v"] = "Variant" $cTypeName["s"] = "String" $cTypeName["o"] = "Object"ENDPUBLIC FUNCTION IsHidden() AS Boolean RETURN Left$(Name) = "_"ENDPUBLIC FUNCTION IsStatic() AS Boolean RETURN UCase(Kind) = KindENDPUBLIC FUNCTION GetIcon() AS String DIM bStatic AS Boolean DIM sIcon AS String bStatic = UCase(Kind) = Kind SELECT CASE LCase(Kind) CASE "r" sIcon = "img/16" &/ If(bStatic, "s-property-ro.png", "property-ro.png") CASE "p" sIcon = "img/16" &/ If(bStatic, "s-property.png", "property.png") CASE "v" sIcon = "img/16" &/ If(bStatic, "s-variable.png", "variable.png") CASE "c" sIcon = "img/16/constant.png" CASE ":" sIcon = "img/16/event.png" CASE "t" sIcon = "img/16/control.png" CASE "m" sIcon = "img/16" &/ If(bStatic, "s-method.png", "method.png") END SELECT RETURN sIconENDPRIVATE FUNCTION GetType(sType AS String, bBalise AS Boolean) AS String IF Len(sType) = 1 THEN sType = $cTypeName[sType] ELSE IF Left$(sType) = "." THEN sType = "Object" ENDIF IF bBalise THEN RETURN "<B>" & sType & "</B>" ELSE RETURN sType ENDIFENDPUBLIC FUNCTION GetSignature(OPTIONAL bBalise AS Boolean) AS String DIM iInd AS Integer DIM sRes AS String DIM sCar AS String DIM iPos AS Integer DIM bName AS Boolean DIM bFirst AS Boolean DIM sSign AS String DIM sBold AS String DIM sNoBold AS String sSign = Signature IF Left$(sSign) = "#" THEN RETURN Mid$(sSign, 2) ENDIF IF bBalise THEN sBold = "<B>" sNoBold = "</B>" ENDIF bFirst = TRUE DO iInd = iInd + 1 IF iInd > Len(sSign) THEN BREAK sCar = Mid$(sSign, iInd, 1) IF sCar = "'" OR sCar = "(" THEN IF sCar = "'" THEN iPos = Instr(sSign, "'", iInd + 1) ELSE iPos = Instr(sSign, ")", iInd + 1) ENDIF IF iPos = 0 THEN BREAK IF bFirst THEN bFirst = FALSE ELSE sRes = sRes & sBold & "," & sNoBold & " " ENDIF sRes = sRes & Mid$(sSign, iInd + 1, iPos - iInd - 1) & " " & sBold & "AS" & sNoBold & " " iInd = iPos bName = TRUE CONTINUE ENDIF IF sCar = "<" THEN iPos = Instr(sSign, ">", iInd + 1) IF iPos = 0 THEN BREAK iInd = iPos CONTINUE ENDIF IF sCar = "[" THEN sRes = sRes & " " & sBold & "[" & sNoBold CONTINUE ENDIF IF sCar = "]" THEN sRes = sRes & " " & sBold & "] " & sNoBold CONTINUE ENDIF IF NOT bName THEN IF bFirst THEN bFirst = FALSE ELSE sRes = sRes & sBold & "," & sNoBold & " " ENDIF sRes = sRes & sBold & "? AS " & sNoBold bName = FALSE ENDIF IF iInd = Len(sSign) THEN IF sCar = "." THEN sRes = sRes & ", ..." CONTINUE ENDIF ENDIF IF (sCar >= "A" AND sCar <= "Z") OR sCar = "." THEN iPos = Instr(sSign, ";", iInd) IF iPos = 0 THEN iPos = Len(sSign) + 1 sRes = sRes & Mid$(sSign, iInd, iPos - iInd) iInd = iPos CONTINUE ENDIF sRes = sRes & GetType(sCar, bBalise) LOOP IF Name = "_get" OR Name = "_put" THEN sRes = "[ " & sRes & " ]" ELSE sRes = "( " & sRes & " )" ENDIF IF Type THEN sRes = sRes & " AS " & GetType(Type, bBalise) RETURN sResEND
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -