mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-25 20:33:13 +00:00
143 lines
2.2 KiB
Plaintext
143 lines
2.2 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
DECL.AUTO
|
||
DECL.REGISTER
|
||
DECL.STATIC
|
||
DECL.EXTERN
|
||
.98 lda #E.CSYN
|
||
sec
|
||
.99 rts
|
||
*--------------------------------------
|
||
DECL.TYPEDEF jsr CORE.GetNCharNB
|
||
bcs .98
|
||
|
||
>LDYA L.CC.TYPEQUAL
|
||
jsr CC.LookupID
|
||
bcs .98
|
||
|
||
cpx #4 no const nor volatile
|
||
bcc .98
|
||
|
||
jsr TYPE.GetTQInYA
|
||
bcs .99
|
||
|
||
ldx #SYM.SC.TYPEDEF
|
||
sec Reset Buffer
|
||
jsr SYM.New Y,A=T/Q,storage class TYPEDEF
|
||
bcs .99
|
||
|
||
jsr CC.GetCharNB
|
||
bcs .98
|
||
|
||
cmp #';'
|
||
bne .98
|
||
|
||
jmp SYM.Store
|
||
|
||
.98 lda #E.CSYN
|
||
sec
|
||
.99 rts
|
||
*--------------------------------------
|
||
* X = type qual
|
||
*--------------------------------------
|
||
DECL.X jsr TYPE.GetTQInYA
|
||
bcs .99
|
||
|
||
cpy #SYM.T.SU
|
||
bne .7
|
||
|
||
tax save Q
|
||
jsr CC.GetCharNB
|
||
bcs .98
|
||
|
||
cmp #';' from a tag def
|
||
beq .8
|
||
|
||
jsr CC.IsLetter
|
||
bcs .98
|
||
|
||
.1 clc reuse buffer
|
||
ldy #SYM.T.SU
|
||
txa restore Q
|
||
jsr DECL.YAC
|
||
bcs .99
|
||
|
||
jsr CC.GetCharNB
|
||
bcs .98
|
||
|
||
cmp #','
|
||
bne .2
|
||
|
||
jsr CORE.GetNCharNBNL
|
||
bcc .1
|
||
bcs .98
|
||
|
||
.2 cmp #';' TODO: struct initalizers
|
||
bne .98
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
.98 lda #E.CSYN
|
||
sec
|
||
.99 rts
|
||
|
||
.7 sec Reset Buffer
|
||
*--------------------------------------
|
||
DECL.YAC ldx #SYM.SC.STATIC Y,A = Type/Qual
|
||
|
||
bit bLocalScope
|
||
bpl .22
|
||
|
||
ldx #SYM.SC.AUTO
|
||
|
||
.22 jsr SYM.New Y,A=T/Q, X=SC, C=clear/reuse
|
||
bcs .99 OOM or DUP
|
||
|
||
jsr SYM.GetTQInYA Y,A = T/Q
|
||
bit #SYM.Q.FUNC
|
||
bne .8
|
||
|
||
jsr CC.GetCharNB
|
||
bcs .98
|
||
|
||
cmp #';' no initializer...store SYM
|
||
beq .28
|
||
|
||
cmp #'=' type var = value ?
|
||
bne .98
|
||
|
||
jsr CORE.GetNCharNB skip '='
|
||
bcs .98
|
||
|
||
jsr SYM.GetTQInYA expected T/Q
|
||
jsr EXP.Eval
|
||
bcs .99
|
||
|
||
jsr SYM.GetAddr1
|
||
bcs .99
|
||
|
||
jsr SYM.GetTQInYA Y,A = T/Q
|
||
jsr SYM.PopValue Set value to this var
|
||
.29 bcs .99
|
||
|
||
.28 jsr SYM.Store
|
||
bcs .99
|
||
|
||
jsr CC.GetCharNB
|
||
cmp #';'
|
||
bne .98
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
.98 lda #E.CSYN
|
||
sec
|
||
.99 rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/bin/cc.s.decl
|
||
LOAD usr/src/bin/cc.s
|
||
ASM
|