Commit 9474e217 authored by John Spikowski's avatar John Spikowski

OXSC181230

parent a5ecff8e
'2018-12-18T16:09:42
'DATESTAMPER
'% filename "OxyDateTimeStamper.exe"
'uses RTL32
uses TimeUtil
string s=getfile("main.inc")
if len s then
int a=instr(s,"datetimestamp")
if a then
a=instr(a,s,chr(34))-1
string ti=TimeStr()
string d=chr(34)+left(ti,19)+chr(34)
int b=instr(a,s,chr(13))
s=left(s,a)+d+mid(s,b)
putfile "main.inc",s
end if
end if
This diff is collapsed.
......@@ -13,13 +13,29 @@ itr conflict with cpointer?
itr check casting with ctype unsigned char etc
itr built-in interpretation of int64_t uint32_t etc
itr assigning large numbers to quads . large negative quads
itr unprototype multiassign must have explicit pointer
itr constructor local var required when multiassigning?
to implement:
itr secondary line numbers/filename for macros
itr 10:17 18/11/2018 Fix multiply unsigned by number (oper w1="mul ")
itr 16:07 16/11/2018 Rework rtl321 and rtl641 cats. expose char count. (catbufprp badcatl3 joinsi)
rollbacks:
'11:16 24/12/2018 Support pre and post '++' '--' macro operators (++/--)
'17:08 19/12/2018 Support macro op 'make' (creating var)
'12:51 19/12/2018 Support macro ops: 'not' 'neg'
'11:10 18/12/2018 Prepare ert (o2_errno) for renumbering
18:01 29/12/2018 Fix UDT array with indirect member
13:48 29/12/2018 Fix UDT padding, including UDT arrays (mps)
13:47 29/12/2018 Fix trailing sub-UDT alignment (roundupc)
18:47 28/12/2018 Revert Appe() to using mid()
18:23 28/12/2018 Macro ops: init free conv move save (findop)
03:37 26/12/2018 Suport inner union append '+' like '=' (wmn)
11:15 24/12/2018 Change 'save' macro 1 param ("save")
12:55 20/12/2018 Support 'move'and 'conv' Remove 'load'
12:50 19/12/2018 Change macro 'constructor' to 'load'
12:50 19/12/2018 Change macro 'destructor' to 'free'
23:49 17/12/2018 Reverse _op order to (dest,src) (expr.inc)
06:12 17/12/2018 Fix macro insider ## substitution (himac)
14:29 16/12/2018 Fix wide string literal binary encoding (makerecordw)
......@@ -63,13 +79,11 @@ itr 16:07 16/11/2018 Rework rtl321 and rtl641 cats. expose char count. (catbufpr
18:18 20/11/2018 Allow dumping of returned floats and strings (tan.bas dumping)
11:51 18/11/2018 Fix dword division '/' conversion (typb=0x48)
11:28 18/11/2018 Fix byte shifts (expl.bas numop excluding shifts)
22:13 12/11/2018 Implement 'midstr' for optimised concat (midstr)
22:09 12/11/2018 Alter priority of '&' operator vs address (pars.bas identop 38)
12:33 11/11/2018 assembler error reporting format update
12:27 11/11/2018 Report error saving binary (SetLastError GetLastError)
06:41 11/11/2018 Assembler support for op labels (assm.bas yword junk)
06:35 11/11/2018 Remove requirement for istrue method (tran.bas istrue)
06:18 11/11/2018 Fix termination order of lobal destructors (pars.bas -19)
05:07 11/11/2018 Support for higher assignment ops += -= etc (tran.inc loadh)
......
......@@ -550,7 +550,7 @@ sub vars(string*s)
'
if ascw<=57
it=val(wm)
w=it and 15
w=it and 15 'INTEGER TYPES
else
'
'IDENTIFY TYPE
......@@ -570,7 +570,7 @@ sub vars(string*s)
'
if it>=typh
k=it 'CLASS OR UDT
if ndstr=0 then hasd=findop(it,"destructor",dstr)
if ndstr=0 then hasd=findop(it,"free",dstr)
endif
endif
ws=""
......@@ -895,9 +895,14 @@ sub vars(string*s)
'DEFERRED DESTRUCTOR
====================
'
if ind=0
if not arwd then arwd="1"
if findop(it,"init",w2)
hiex+=w2+"("+w3+cm+arwd+")"+cr
end if
end if
if (ind=0)and(hasd<>0)
wr=mrcso(me-1,1)
if not arwd then arwd="1"
'null variables check to be done by macro
w1=dstr+"("+w3+cm+arwd+")"+cr
if lclv
......@@ -1021,7 +1026,8 @@ end sub
' aml array size multiplier
' buil table builder string
' wih inherited elements to pre-append
' wmx max structure length for unions
' wmn union base offset
' wmx union max offset
' vtl virtual data flag
' pof offset value building def
' pk k holder
......@@ -1053,7 +1059,7 @@ sub types(int unip,vtp,*ttc,*tuc)
int a,b,c,d,e,f,g,k,m,n,v,w
int ctbl,vof,vtl,sih,pk,pof,pv,na,wmx,uni,bb,cmo,indi,sni,clas,tv,x,vtlf,mps,nentry
int ctbl,vof,vtl,sih,pk,pof,pv,na,wmn,wmx,uni,bb,cmo,indi,sni,clas,tv,x,vtlf,mps,nentry
string w1,w2,w3,w4,w5,wd,wm,wn,wr,ws,wt,buil,wih,tbls,wpr,nesn,ty,mlist,vlist
......@@ -1061,7 +1067,6 @@ sub types(int unip,vtp,*ttc,*tuc)
wm=" "+mrcso(me,1)+" " : k=1
'w ' offset accumulator
'wmx ' max offset accumulator (unions)
'pof : vof : ctbl
'
'
......@@ -1377,11 +1382,17 @@ sub types(int unip,vtp,*ttc,*tuc)
'
elseif a=61 '=' DEMARKATE UNION GROUPS
'
'UNION START MARKER '='
if w>wmx then wmx=w 'SET UNION MAX SIZE
w=wmn 'RESET OFFSET
mid(wm,swd)=" " 'WIPE CODE
continue do
'
elseif a=43 '+' DEMARKATE UNION GROUPS
'
if w>wmx then wmx=w 'SET UNION MAX SIZE
w=0 'RESET OFFSET
mid(wm,swd)=" " 'WIPE NAME
wmn=wmx 'NEW BASE OFFSET
w=wmn 'NEW OFFSET
mid(wm,swd)=" " 'WIPE CODE
continue do
'
endif 'UNIONS AND INNER STRUCTURES
......@@ -1991,7 +2002,8 @@ sub types(int unip,vtp,*ttc,*tuc)
'
c=0
if vtl+m=0
d=mrcio(a,5) : if mps<d then mps=d
d=mrcio(a,5)
if mps<d then mps=d
roundupc(w,d) 'ADJUST BASE ALIGNMENT FOR INHERITED
c=1 : w4=" 0 5 "
d=mrcio(a,1)
......@@ -2023,9 +2035,16 @@ sub types(int unip,vtp,*ttc,*tuc)
endif
'
select case c
case 0 : na=1 : pof=w
case 1 : na=aml : pof=w+mrcio(a,1)*aml 'body part (arrays supported)
case 4 : na=1 : pof=w+mrcio(a,4)*cpuw 'virtual part (no arrays supported)
case 0 :
na=1
pof=w
case 1 : 'body part (arrays supported)
na=aml
pof=w+mrcio(a,1)*aml
roundupc(pof,mrcio(a,5))
case 4 : 'virtual part (no arrays supported)
na=1
pof=w+mrcio(a,4)*cpuw
end select
'
'
......@@ -2064,8 +2083,8 @@ sub types(int unip,vtp,*ttc,*tuc)
'
c=mrcio(a,5)
if mps<c then mps=c
roundupc(vof,c)
vof+=mrcio(a,1)*aml 'accum size of objects
roundupc(vof,c)
'
'CHECK FIRST IF THERE ARE ANY ELEMENTS IN THE BODY
'-------------------------------------------------
......@@ -2110,7 +2129,9 @@ sub types(int unip,vtp,*ttc,*tuc)
c=mrcio(a,5)
if mps<c then mps=c
roundupc(pof,c)
w=pof : pof+=mrcio(a,1)*aml
w=pof
pof+=mrcio(a,1)*aml
roundupc(pof,c)
if d
endline(ws,b) : continue do 'OMIT FIRST VTP (COMPAT WITH SIH)
endif
......@@ -2187,12 +2208,7 @@ sub types(int unip,vtp,*ttc,*tuc)
'pass 2: object members
'
'
if vtlf+mrcio(a,4)=0
w=w+mrcio(a,1)*na 'ELEMENT SIZE
else
w=pof 'UPDATE OFFSET FOR VFT OR BODY
endif
'
w=pof 'ALIGNED OFFSET AFTER MEMBER(S)
k=len(wm)+2 'NEXT LINE TO PROCESS
pk=k
'
......@@ -2228,19 +2244,20 @@ sub types(int unip,vtp,*ttc,*tuc)
'
'
b=me-1
mrcsi(wm,b,1) 'CLASS STRUCTURE RECORD
mrcsi(mlist,b,2) 'MEMBER LIST (INHERITED)
mrcsi(wm,b,1) 'CLASS STRUCTURE RECORD
mrcsi(mlist,b,2) 'MEMBER LIST (INHERITED)
'
if wmx>w then w=wmx 'MAX SIZE FOR UNIONS
'roundupc(w,mps) 'ROUND UP TO NEAREST MAX PRIMITIVE SIZE
mrcio(b,1)=w 'LENGTH OF STRUCTURE
if wmx>w then w=wmx 'MAX SIZE FOR UNIONS
if pakd=0
roundupc(w,mps) 'ROUND UP TO NEAREST MAX PRIMITIVE SIZE
endif
mrcio(b,1)=w 'LENGTH OF STRUCTURE
if ctbl
mrcio(b,2)=me 'INTERNAL VIRTUAL TABLE INDEX
mrcio(b,2)=me 'INTERNAL VIRTUAL TABLE INDEX
endif
mrcio(b,3)=vtp 'VIRTUAL TABLE FLAGS (atx)
mrcio(b,5)=mps 'MAX PRIMITIVE SIZE
mrcio(b,3)=vtp 'VIRTUAL TABLE FLAGS (atx)
mrcio(b,5)=mps 'MAX PRIMITIVE SIZE
'
'mps=0 when the structure is marked as packed
'
'SOURCE LISTING
'
......
......@@ -1039,7 +1039,7 @@ function compatsig(string*p1,*p2, int pb) as int
endif
elseif n>=typh 'up-convert
if uk and 2
if findop(n,"constructor",w1)
if findop(n,"conv",w1)
'deferred object creation
paj(pa)=n
mpfx+=w1+"(#obj#,("+pex(pa)+")"+cr
......
......@@ -140,7 +140,7 @@
===================
'MACRO OP
hlex+=w2+"("+owa+cm+wacc+")"+cr
hlex+=w2+"("+wacc+cm+owa+")"+cr
rps=1
skiplspace(s,i)
ret
......@@ -151,7 +151,7 @@
'wr could be [...] or rax
a=0
if op<2
opsh="load"
opsh="move"
endif
m=typ
if findop(typ,opsh,w2)
......@@ -171,7 +171,7 @@
'
converterh: 'subroutine
=======================
if findop(m,"constructor",w2)
if findop(m,"conv",w2)
m=typc
newcleanvar(owa,wr,m) 'new owa and wr
hlex+=w2+"("+owa+cm+w4")"+cr
......@@ -453,11 +453,6 @@
'CHECK PRE INCREMENT / DECREMENT ++ --
'
if (ascw=43)or(ascw=45)
'(
' cmp ascw,43 : jz exit
' cmp ascw,45 : jz exit
' jmp fwd _end_cond
')
if ascw=asc(s,swd+1)
if ascw=43 then a=12 else a=13
i++ : wr=pword(s,i) '++A --A
......@@ -1272,12 +1267,7 @@
if varf=3
xmode=5 'FLAG FULL INDEX CALC
w2=memreg(qedi,woff) 'OFFSET ADDED LAST
a=instr(wpfx,cr)
if a
memba=mid(wpfx,a+2) : wpfx="" 'TRIM OFF BASE VARIABLE
else
memba=medi+w2+cr
endif
memba=medi+w2+cr
woff=0
endif
'
......@@ -2474,7 +2464,8 @@
if typc>=typh
if findop(typc,cpsh,w2)
wr=wacop
owa=waccp
owa=wacc
wacc=waccp
opsh=cpsh
gosub opcall
typc=4
......@@ -2558,7 +2549,7 @@
if hlex
if nst
if findop(typc,"save",w2)
hlex+=w2+"("+owa+cm+wacc+")"+cr
hlex+=w2+"("+wacc+")"+cr
end if
endif
hiex+=hlex
......
No preview for this file type
......@@ -694,8 +694,8 @@ sub appe(string*s, int*k, string*wt)
if ls<k+le
s+=nuls(le+4096)
end if
copy strptr(s)+k,strptr(wt),le
'mid(s,k+1)=wt
'copy strptr(s)+k,strptr(wt),le
mid(s,k+1)=wt
k+=le
end sub
......
......@@ -17,7 +17,9 @@
end extern
uses TimeUtil
$ o2version chr(34)+"0.1.0 2018-12-11T12:00:00"+chr(34)
'
$ datetimestamp "2018-12-30T12:31:59"
$ o2version chr(34)+"0.1.0 "+datetimestamp+chr(34)
'
'DEFINITIONS GROUP
'=================
......
/*
'14:52 29/12/2018
'indirect member in udt array
type tt
int a
int *b
end type
indexbase 1
tt t[100]
int v=21
@t.b=@v
int i=1
#show int a=t[i].b
#show int @a=t[i].b
print *a
*/
/*
'14:15 29/12/2018
'udt size alignment
'packed
type tt
int v
byte b
end type
'
print sizeof tt
tt t[10]
print bytesof t
*/
/*
'09:47 28/12/2018
#COMPILE EXE
#COMPILER OXYGEN
#OPTIONS X64
#DIM ALL
GLOBAL RK() as STRING
FUNCTION PBMAIN() AS LONG
DIM RK(10)
RK(1) = "22"
PRINTBR RK(1)
END FUNCTION
*/
/*
'06:10 17/12/2018
'fix macro ## substitution
......@@ -14,7 +68,7 @@ end macro
mm
*/
'/*
/*
'concatenation operations
'13:07 14/12/2018
'
......@@ -81,7 +135,7 @@ cat d
'c+="A" "B"
c+=d
print "ok"
'*/
*/
/*
'04:49 17/12/2018
......
......@@ -372,7 +372,7 @@ function MacroMember(string*s,*wm,*wp) as int
if asc(w2)=34
w2=mid(w2,2,len(w2)-2)
endif
w2=rmk+w2 'see findop instr
w2=rmk+w2
'
'SCAN MACRO BLOCK
a=1
......
No preview for this file type
......@@ -1209,7 +1209,7 @@ end function
if findop(typm,"save",w2)
loadh="save"
else
loadh="load"
loadh="move"
endif
if cpa>2
w3=wr+"="
......@@ -1259,7 +1259,11 @@ end function
w1=epfx+w1 : epfx=""
hiex+=storecode(w1)
rps=16
hiex+=w2+"("+accg+cm+osg+")"+cr
if loadh="move"
hiex+=w2+"("+osg+cm+accg+")"+cr
else 'save
hiex+=w2+"("+osg+")"+cr
endif
goto cleardown
end if
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment