A2osX/BIN/CC.S.STMT.txt
burniouf 04a83f00f3 SH:new ALIAS cmd, new && operator
MKDIR:completely implemented
LS/RM/MV/CP: combined switches
KERNEL:SList API now handle options to handle several languages/parsers
2022-10-07 21:21:37 +02:00

210 lines
3.2 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*--------------------------------------
STMT.Get jsr CC.GetCharNB
jsr CC.IsLetter
ldx #$ff
bcc .20
>LDYA L.CC.PREOPS ++var ?
jsr CC.LookupOP
bcs .9
.20 stx StmtPreOp
jsr SYM.Lookup var or func() ?
bcs .99
ldy #SYM.SC
lda (ZPLookupSymPtr),y
cmp #SYM.SC.TYPEDEF
bne .60
*--------------------------------------
jsr CORE.GetNCharNB
bcs .9
* >DEBUG
ldy #SYM.Q
lda (ZPLookupSymPtr),y
pha
lda (ZPLookupSymPtr)
pha
jsr SYM.LookupFree
ply
pla
sec Reset Buffer
jmp DECL.YAC
*--------------------------------------
.60 ldy #SYM.Q
lda (ZPLookupSymPtr),y
bit #SYM.Q.FUNC
beq .61
bit StmtPreOp
bpl .9 ++func ????????
jsr F.CallNoRetV func( ... );
bcs .99
jmp SYM.LookupFree
*--------------------------------------
.61 jsr STMT.SetVar
bcs .99
jmp SYM.LookupFree
.9 lda #E.CSYN
sec
.99 rts
*--------------------------------------
STMT.SetVar stz ExpState
jsr EXP.POSTOPS var++, var[0]... ?
bcs .99
ldx StmtPreOp
jsr EXP.PREOPS apply ++var, ....
bcs .99
jsr CC.GetCharNB
bcs .90
jsr CC.IsEndArg var++; or ++var; ?
bcc .8
jsr CC.LookupAOP var=, var+= ... ?
bcs .90
cpx #0 TOTO : all AOPS
bne *
lda ExpState
bmi .90 VonStack
asl
bmi .7 AinPTR
asl
bmi .6 AonStack
jsr EXP.GetAddr1
bcc .7
rts
.6 >LDYA L.PCC.PopAddr1
jsr CODE.EmitPCC
bcs .99
.7 ldy #SYM.Q
lda (ZPLookupSymPtr),y
pha
lda (ZPLookupSymPtr)
tay
pla get expected T/Q
jsr EXP.Eval
bcs .99
jmp SYM.PopValue
.8 clc
rts
.90 lda #E.CSYN
sec
.99 rts
*--------------------------------------
*--------------------------------------
* X = KW.ID
*--------------------------------------
CC.STMT.CPStmt.NEW
>LDA.G CC.CPSID+1
jsr CC.Push
bcs .99
>LDA.G CC.CPSID
jsr CC.Push
bcs .99
lda LocalPtr Locals
jsr CC.Push
bcs .99
lda #0 bState
jsr CC.Push
bcs .99
txa
jsr CC.Push
bcs .99
lda #'}'
jmp CC.Push
.99 rts
*--------------------------------------
CC.STMT.Stmt.END
jsr CC.Get
bcs .8
cmp #'}'
beq .8
cmp #';' must be ';' on stack....
bra CC.STMT.POP
.8 clc
CC.STMT.Stmt.RTS
rts
*--------------------------------------
CC.STMT.CPStmt.END
jsr CC.Get
bcs CC.STMT.Stmt.RTS
cmp #'}' must be '}' on stack....
CC.STMT.POP bne .98
iny
lda (ZPCCStack),y
jsr .7
bcs .99
bvs .1 DONT POP reused context (ELSE....)
lda CStackPtr
* clc
adc #7
sta CStackPtr
jsr CC.Pop Locals
sta LocalPtr
.1 clc
rts
*--------------------------------------
.7 tax
bmi .8
jmp (J.CC.KW.END,x)
.8 jmp F.Def.END
.98 lda #E.CSYN
sec
.99 rts
*--------------------------------------
MAN
SAVE usr/src/bin/cc.s.stmt
LOAD usr/src/bin/cc.s
ASM