Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AZHLSCU9

AZHLSCU9.m

Go to the documentation of this file.
AZHLSCU9 ; IHS/ADC/GTH:KEU - UNDEF CHECKER. %INDEX SYNTAX CHECKER ;
 ;;5.0;AZHLSC;;JUL 10, 1996
 D PARSE S LI=0,AC=255 F %=0:0 S %=$O(LV(%)) Q:%'>0  S LI(%)=0
 Q
 ;LV is a set of Linked Values
PARSE K LV,LI S (ERR,LI,PL,I)=0,(LL,LV)=1,(OP,CH)="",Q="""" ;D NEW S LL(LLO,8)=LL
 ;
PA2 S I=I+1,CH=$E(STR,I) G:CH="" PEND
 G E:CH=";"!(CH'?1ANP) I """$()"[CH D QUOTE:CH=Q,FUNC:CH="$",DN:CH="(",UP:CH=")" G PA2
 I CH="^",I=LL G PA2:$E(STR,I+1)'="[" S I=I+1,X=$E(STR,LL,I) D ADD S LL=I+1 G PA2
 I CH?1A!(CH="%") D VAR G PA2
 I CH?1N D NUM G PA2
 S:"+-#'/*&![]<>?"[CH OP=CH I CH="?",",!"'[$E(STR,I-1) D AR,PAT G PA2
 D:CH?1P AR G PA2
 ;
DN D STR S X=CH D ADD,NEW S LI(LV)=LI,LV=LV+1,PL=PL+1 S:'$D(LI(LV)) LI(LV)=0 S LI=LI(LV),LI(LV-1,1)=LI
 Q
UP D STR S EC=LI-LI(LV-1,1),X=$C(10) D ADD,NEW S LI(LV)=LI,LV=LV-1,LI=LI(LV),PL=PL-1
 S X=EC D ADD S X=CH D ADD Q
NEW S LL=I+1
 Q
AR D STR S X=CH D ADD,NEW Q
STR S X=$E(STR,LL,I-1) Q:X=""  ;Drop into ADD
ADD S LI=LI+1,LV(LV,LI)=X Q
 Q
QUOTE F I=I+1:1 S CH=$E(STR,I) Q:CH=""!(CH=Q)
 I $E(STR,I+1)=Q S I=I+1 G QUOTE
 Q
VAR F J=I+1:1 S CH=$E(STR,J) Q:CH'?1AN
 S I=J-1 Q
NUM F J=I+1:1 S CH=$E(STR,J) Q:"0123456789."'[CH!(CH="")
 I CH="E" S CH=$E(STR,J+1) I CH?1N!("+-"[CH) S I=J G NUM
 S I=J-1 Q
INC S I=I+1,CH=$E(STR,I)
 Q
FUNC D INC S X=CH D VAR S S=$E(STR,LL,I),LL=I+1 G EXT:S["$$" G SPV:CH'="("
 S S=$E(S,2,9),F1=$F("ACDEFGJLNOPQRSTVZ",X),F1=$P($T(FNC),",",F1)
 S:$E(S,1,2)="TR" F1="TRANSLATE^2;3" S:$E(S,1,2)="FN" F1="FNUMBER^2;2"
 S X="$"_F1,CH="" D ADD Q
SPV S X=S D ADD S CH=$E(S,2)
EXT ;EXTRINSIC
 S X=S,CH="" D ADD
E Q
PAT F I=I+1:1 S CH=$E(STR,I) D PATQ:CH=Q I CH=""!(CH'?1N&("ACELNPU."'[CH)) Q
 S I=I-1 Q
PATQ F I=I+1:1 S CH=$E(STR,I) Q:CH=""!(CH=Q)
 S I=I+1,CH=$E(STR,I) G:CH=Q PATQ Q
PEND D AR
 Q
 Q
FNC ;;,ASCII^1;2,CHAR^1;999,DATA^1;1,EXTRACT^1;3,FIND^2;3,GET^1;1,JUSTIFY^2;3,LENGTH^1;2,NEXT^1;1,ORDER^1;1,PIECE^2;4,QUERY^1;1,RANDOM^1;1,SELECT^1;999,TEXT^1;1,VIEW^1;999,
TEST S STR="@^(0)" D AZHLSCU9