2022-01-30 21:47:08 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.SCSPEC.AUTO
|
|
|
|
|
CC.SCSPEC.REGISTER
|
|
|
|
|
CC.SCSPEC.STATIC
|
|
|
|
|
CC.SCSPEC.EXTERN
|
|
|
|
|
.98 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CC.SCSPEC.TYPEDEF
|
|
|
|
|
jsr CC.GetNextCharNB
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
>LDYA L.CC.TYPEQUAL
|
|
|
|
|
jsr CC.LookupID
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
cpx #4 no const nor volatile
|
|
|
|
|
bcc .98
|
|
|
|
|
|
|
|
|
|
jsr CC.TYPE.Decl
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldx #SYM.SC.TYPEDEF
|
|
|
|
|
sec Reset Buffer
|
|
|
|
|
jsr CC.SYM.New Y,A=T/Q,storage class TYPEDEF
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
cmp #';'
|
|
|
|
|
bne .98
|
|
|
|
|
|
|
|
|
|
jsr CC.GetNextCharNB skip ';'
|
|
|
|
|
|
|
|
|
|
jmp CC.SYM.Store
|
|
|
|
|
|
|
|
|
|
.98 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99
|
|
|
|
|
CC.SCSPEC.TYPEDEF.RTS
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-08-20 14:37:37 +00:00
|
|
|
|
* X = type qual
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CC.DECL jsr CC.TYPE.Decl
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs CC.SCSPEC.TYPEDEF.RTS
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
sec Reset Buffer
|
|
|
|
|
|
|
|
|
|
CC.DECL.YAC ldx #SYM.SC.STATIC Y,A = Type/Qual
|
2022-06-22 06:26:44 +00:00
|
|
|
|
bit bLocalScope
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bpl .25
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
|
|
|
|
bit #SYM.Q.FUNC someone wants to add a local f() ?
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bne .98
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
|
|
|
|
ldx #SYM.SC.AUTO
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.25 jsr CC.SYM.New Y,A=T/Q, add with undef value...
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98 OOM or DUP
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
.22 jsr CC.GetCharNB
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
cmp #';'
|
|
|
|
|
beq .28
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
cmp #'{'
|
|
|
|
|
bne .26
|
|
|
|
|
|
|
|
|
|
jsr CC.GetNextCharNB skip '{'
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
jmp CC.SYM.StoreF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Initializer
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.26 cmp #'=' type var = value ?
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bne .98
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-02-06 17:14:18 +00:00
|
|
|
|
jsr CC.GetNextCharNB skip '='
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-02-06 17:14:18 +00:00
|
|
|
|
jsr CC.SYM.GetTypeInYA expected T/Q
|
|
|
|
|
jsr CC.EXP.Eval
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CC.SYM.GetAddr1
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr CC.SYM.GetTypeInYA Y,A = T/Q
|
|
|
|
|
jsr CC.SYM.PopValue Set value to this var
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.29 bcs .99
|
2022-02-06 17:14:18 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.28 jsr CC.SYM.Store
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
cmp #';'
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bne .98
|
2022-02-06 17:14:18 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.98 lda #E.CSYN
|
2022-02-04 14:57:17 +00:00
|
|
|
|
sec
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.99 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.decl
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|