From 7363b53489a1955951e283af4a6b9b683602c297 Mon Sep 17 00:00:00 2001 From: Chris Fadden Date: Mon, 16 Mar 2015 13:49:05 -0400 Subject: [PATCH] Made ChrisTest for testing numerical library --- ChrisTest/.ChrisVec.krak.un~ | Bin 0 -> 60285 bytes ChrisTest/.ChrisVecTest.krak.un~ | Bin 0 -> 13231 bytes ChrisTest/.ErrorLog.txt.un~ | Bin 0 -> 1843 bytes ChrisTest/.HelloWorld.krak.un~ | Bin 0 -> 13547 bytes ChrisTest/.SupressOut.sh.un~ | Bin 0 -> 1406 bytes ChrisTest/ChrisVec.krak | 50 +++ ChrisTest/ChrisVecTest.krak | 28 ++ ChrisTest/DotProdTest/DotProdTest | Bin 0 -> 13872 bytes ChrisTest/DotProdTest/DotProdTest.c | 362 ++++++++++++++++++ ChrisTest/DotProdTest/DotProdTest.h | 155 ++++++++ ChrisTest/DotProdTest/DotProdTest.sh | 2 + ChrisTest/ErrorLog.txt | 2 + ChrisTest/HelloWorld.krak | 14 + ChrisTest/SupressOut.sh | 2 + stdlib/.io.krak.un~ | Bin 0 -> 1369 bytes stdlib/io.krak | 12 + tests/SupressOut.sh | 2 + .../test_topLevelVarInit/test_topLevelVarInit | Bin 0 -> 11000 bytes .../test_topLevelVarInit.c | 225 +++++++++++ .../test_topLevelVarInit.h | 116 ++++++ .../test_topLevelVarInit.results | 1 + .../test_topLevelVarInit.sh | 2 + 22 files changed, 973 insertions(+) create mode 100644 ChrisTest/.ChrisVec.krak.un~ create mode 100644 ChrisTest/.ChrisVecTest.krak.un~ create mode 100644 ChrisTest/.ErrorLog.txt.un~ create mode 100644 ChrisTest/.HelloWorld.krak.un~ create mode 100644 ChrisTest/.SupressOut.sh.un~ create mode 100644 ChrisTest/ChrisVec.krak create mode 100644 ChrisTest/ChrisVecTest.krak create mode 100755 ChrisTest/DotProdTest/DotProdTest create mode 100644 ChrisTest/DotProdTest/DotProdTest.c create mode 100644 ChrisTest/DotProdTest/DotProdTest.h create mode 100644 ChrisTest/DotProdTest/DotProdTest.sh create mode 100644 ChrisTest/ErrorLog.txt create mode 100644 ChrisTest/HelloWorld.krak create mode 100755 ChrisTest/SupressOut.sh create mode 100644 stdlib/.io.krak.un~ create mode 100755 tests/SupressOut.sh create mode 100755 tests/test_topLevelVarInit/test_topLevelVarInit create mode 100644 tests/test_topLevelVarInit/test_topLevelVarInit.c create mode 100644 tests/test_topLevelVarInit/test_topLevelVarInit.h create mode 100644 tests/test_topLevelVarInit/test_topLevelVarInit.results create mode 100755 tests/test_topLevelVarInit/test_topLevelVarInit.sh diff --git a/ChrisTest/.ChrisVec.krak.un~ b/ChrisTest/.ChrisVec.krak.un~ new file mode 100644 index 0000000000000000000000000000000000000000..1fa0c76a81ee3e576ca411f2287137743817d089 GIT binary patch literal 60285 zcmWH`%$*;a=aT=Ff$5v$mA7~87`r2P2!8!pu)2Oi!G>!6yq@68uiutD+WTx90|SE* z0|SGYfuhgO-O{KUn;z`%`G7K5S%R7S&`0*W$FG=ZaXG@4++LMu9yjdK~k zXkt=OfaWJq#DF3Z<`Ph(fg%*lAB`w*Fwl?)W#ilcjwmKbr3uO-JXrD*C|W>rFsFc` z45V%}KfywTrgSKqgc>-Spv4}ju>i9W)aU@S!3_*h{RHMg8=hS7<_x0A11cPm)qvSx z-JskE=0SDy)MVzB)F|X8X69*tdYF(z0!j?Xsu;1iZ$J){Q&7mvx3VfI%FHXt$?YJD9S+TOc3O_(P#pN z0xfYUn?xdVG$9uRplA|8@6{-1K=T(UqChnP%ypnh9E~_wXwaMvWs^w47jc5<5eJJm zP&|PK3}G$=#i1CqgdOc~!a{{+bSRrd4syJSBH0AWaEO5cP{i;d$$}ycR9b?CMoUI; zFwl?)Ws_(@jwn!j0+e?^c?A?vunG(mE&NFC07V%nnuI}OqtOHk1zO@zHi@a|(FCfR z#GwNN!U_udT4(@TgMng70Lg8jSOmo|SZFlnz`;O6B9u*HI&#dxVht8^unY!@7I142 z>K0Ixi9p$-6&5TYXhw&!NxVXiCQ!KsiX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BiE-GpxI&UbX0bwk8hA$BNCoViHz%!ZIa4d`C?UXr>9)lLy5TXmK{oVW1cUTKK9AJv}|}O5O7OqHKG6d(i!tkfZ|2rJ$$e0y%!kh+a^1HX%73 z6xE;-9yFpf8ofvXLmOr&+r4b$=mlk6Q1FAYFQ|l9C8~r6xeYvLhF*X}wt6Ei$jgKk z+n{)E2I+%hP#OT~2FKD}U8jVY&fT0aDlW^bwFbP literal 0 HcmV?d00001 diff --git a/ChrisTest/.ChrisVecTest.krak.un~ b/ChrisTest/.ChrisVecTest.krak.un~ new file mode 100644 index 0000000000000000000000000000000000000000..f8608e6584e26f6db9ae1964801982f557d6964f GIT binary patch literal 13231 zcmWH`%$*;a=aT=Ff$3F8$v@@8GSjBc+rKv0;`QAL3w8I8fiQ^8@c;k+{|wAv<|sjv z5C~<9{sE2-28OQ^Xf}YO!L$(^O&~UMM1Z1<3#J|%O&}F8fl->uArQ(Iqlp|%oD2*M z+)xY-cxW_%qJ;&?Zcvo5GB7akgTzLo2^0#n#G!04;mFYhiV8NQXcEZGEyyn_QE<*E z$}A2`O}2(c8!Vb&ZUgB9MKPE^8g1ZUpdk^;7L$b>Z5#{?3_M8D#sG~bP_%%e6Xq09 z&KfNQVWB~DI+QIY7aUDYkh%(#LqLTfF9QR(y#b3RP_(ckxds$vplFf>iH+taP$ zP_|q5k)sKeLqNeV%D}(?Y6=P~C@3f-g{3CzC8ngf=A~$4YFdMw18(XIFfcHH@+C+y zavKs9hoIsTq!5Hb@e48()JTE!$iS*WQlpsqArQ)T>mzcUf}#nO?LZh5@XQJdwb1qm zC}uzvAj}bNBcL)5l$p?@2^1}$HVVugpeO@1L%{seXaWZV4T(^;+l|Q4 z1j!D46oQ&AFvo+U7ZlB4{%Fnv2Lla>P`3Nr;3$O_kf4GP6b0xx z4F$Rr$gE9^CL$Ss2&3i*`wzsP_%&B>o5m_q72l=2lGdB6F3-X zNQAQ87e`J!S=kYG_^q z#SExD3Udo6)%L zkM{S#!9YVIlb{y_N(6eXaDf(>$kq6O5`gE<8x4^jt?s?lhI1q-d{P`3LU zkfR9{?4Vi+6b+zg!qYICygBOM$JG$caV9(sc#9hy5q{Weg}1QnW~ zXhO6wK@o%O5KyFnTAg6A(TD;E0}Y8#wuipph+>E2PEZ~JwI)IN2NY2Zrj5^60RZ(Y Baq|EG literal 0 HcmV?d00001 diff --git a/ChrisTest/.ErrorLog.txt.un~ b/ChrisTest/.ErrorLog.txt.un~ new file mode 100644 index 0000000000000000000000000000000000000000..4a2cdf11502ba1368acd91bd44b6f7a91e4f2b0b GIT binary patch literal 1843 zcmWH`%$*;a=aT=Ffhj*|^Yr6Eo_$hr%V!)`KKz5_F1!6t!MdII-L!ZAjjq_lz`(%7 zz`!7=XseK$nVwOike6SgP@Z3u4VB2msMA%n-`PQO5$3EgPEfQO+p})^_K`ZIv5zfN}$;Qjt0|4a5RC~$PodGGB%ic za5RBbzywBVDu+NQ>n{`JXkukxU|@%0aKJ;O2^1|XNOpsw45St;G#X9dV4xup%KFO^ zIhsIG!GR^3P@;u_fdQm$G&j*OVo;3^W&LG^98I7c0?JLC3=9m&xd|m&7#J8p>OdH* zW;8dU1}gP=p{&1LkfR9}9k6I(Qc!>vd!R@GMIg)#pu7aapk@lB5dn@enDi)3-4F<6 z{S|;5QLyNMMHC-WOED);0~%?d2m%$3Ft>mr5L7UN`J=fD91JuhLRo)BBS#vn=>Ur~ zuFSj=h1|rS9&}C~s1FUzX`pxl^`v2r1H~b{1{;kx zSg_EF4rTrS0UU2gonlbjfuaQz4P2SI1^GoK3Yq!V&Ph2^JcSFmN!? zkO*b{{{>rwfuaN)4bW%;MGG&IJ3#WF@(?UE8cpC}pdk^;`u_)VG=Ulppy20cU_guk zf`_3%xee6Z0LdUnASlAXje4jnL6He+xPZB%5eNZ+}zY61&xx#B!%Ss+=86cl2lCv|I(6z(h|4KoK$F3gQ8Xd$upp62Sqig zs2%MTAO#F^g&uTdyVEK;ylFt&ybgM#8o7|BhbI0VHTNPINjkOGD_%uqI#ba1>eLvkp3ya_8P z)THI)CzfEw94MwlkX!|dMNruaY6p+T98$p0h8fDn@(LVtERdK3h!sWh1Srx$5v>9e8?8h^p+HL<%ErnLj%Zfw5$yqv=%mujoD^95n4;(g zMK8F01oads>Os-13F41NHz*Wni9^{~&B4*lhCRA{iHUA-Y5;YOpj{$DSsWC{;z+&% z#XqPP1`WoKmgPtRLmOr&8*2+V&e9}#74_mP$F+clyzUA5DGqT$`TS9~E18PtH=eg|1z`(%7 zz`(#$l&heXU6h!eUs|FC6=PvwU|?imU|?o|01yqs456&QMOi?yj12J?Ao5^?piHnv zkTjV8|NsC0aAUwCqXczBAe8ktBRD!37`{rN84ZpG(?)PKf!Lrpged{VJqUy1ngJY5 zAQdp#QJTsj5X$| a, |vector| b) +{ + if(a.size < b.size) + { + println("Error: Vectors not of same size"); + print("Vector a is of size: "); + println(a.size); + print("Vector b is of size: "); + println(b.size); + println("Did you know that Grover Cleveland served two seperate terms as President of the United States, four years apart?"); + } + + |double| ans = 0; + for(|int| i = 0; i < lesser(a.size, b.size); i++;) + { + ans = ans + a.at(i) * b.at(i); + } + + println(ans); + + return ans; +} + + + + + + + + + + + + + + + + + + diff --git a/ChrisTest/ChrisVecTest.krak b/ChrisTest/ChrisVecTest.krak new file mode 100644 index 0000000..a5af09d --- /dev/null +++ b/ChrisTest/ChrisVecTest.krak @@ -0,0 +1,28 @@ +/* + ../build/kraken InputFile.krak ../krakGrammer(tabComplete) OutputFile +*/ + +import vector:*; +import ChrisVec:*; + +|int| main() +{ + + |vector| aVec.construct(); + |vector| bVec.construct(); + + + |double| j; + for(|int| i = 0; i < 4; i++;) + { + j = i + 0.0; + aVec.addEnd(j); + bVec.addEnd(j); + } + + bVec.addEnd(12.3); + + |double| dotProd = dot(aVec, bVec); + + return 0; +} diff --git a/ChrisTest/DotProdTest/DotProdTest b/ChrisTest/DotProdTest/DotProdTest new file mode 100755 index 0000000000000000000000000000000000000000..5303b9e72200cdae339a19e78f805a81c7c27d28 GIT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n}k;M!@(6|X`3>s!X zY`iW8svkDK4|6|E9gGI`H$Y?BFg|Qt57Zw8*$E4O&^SG^`$2LbTm>Fi0j<0S@j#2k zApMCBsQoa1!t6))KWNSv6ems)?eKBJ1yKDJP;rockYCXC_kqV_AmIyA3Y*7}02#`_ zfHCp~6$U8<<4!dFuyIERs6z0ZIanoxfc3LsG-w6QBtXT|GMg2Gsq~rXCbFAPnQf=+|iaVdKRWQ2mhH2+|3`Fnur@v_c(}eqrv1jVtef>W8@# zq8l;q2jl;O&IQ8s!}`%Dp!#9iGeUoKd5{K@nIOG7Q}|p zpnfpSZjd+(i-9U8klSDip%Q3Z(2NUo1s7BSlv02e`~lDjNzix@Xv-GNKhWgC0Lq`( U>@QG*7-R#}0O5k|gEGMs0I`6PCIA2c literal 0 HcmV?d00001 diff --git a/ChrisTest/DotProdTest/DotProdTest.c b/ChrisTest/DotProdTest/DotProdTest.c new file mode 100644 index 0000000..39ee4cf --- /dev/null +++ b/ChrisTest/DotProdTest/DotProdTest.c @@ -0,0 +1,362 @@ +#include "DotProdTest.h" + +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/** + * Variable Declarations + */ + +/** + * Function Definitions + */ + + +double dot_vector_lessthan_double_greaterthan__vector_lessthan_double_greaterthan_(vector_lessthan_double_greaterthan_ a, vector_lessthan_double_greaterthan_ b) +{ + if (((((a).size))<(((b).size)))) + { + println_char_P__("Error: Vectors not of same size") ; + print_char_P__("Vector a is of size: ") ; + println_int(((a).size)) ; + print_char_P__("Vector b is of size: ") ; + println_int(((b).size)) ; + println_char_P__("Did you know that Grover Cleveland served two seperate terms as President of the United States, four years apart?") ; + }; +; + double ans = 0;; + for ( int i = 0;((i)<(lesser_lessthan_int_greaterthan__int_int(((a).size), ((b).size)) )); i++) + { + ans = ((ans)+(((vector_lessthan_double_greaterthan___at_int(&a,i) )*(vector_lessthan_double_greaterthan___at_int(&b,i) )))); + }; +; + println_double(ans) ; + return ans; +} +int main() +{ + vector_lessthan_double_greaterthan_ aVec; vector_lessthan_double_greaterthan___construct(&aVec) /*Init Position Call*/; + vector_lessthan_double_greaterthan_ bVec; vector_lessthan_double_greaterthan___construct(&bVec) /*Init Position Call*/; + double j;; + for ( int i = 0;((i)<(4)); i++) + { + j = ((i)+(0.0)); + vector_lessthan_double_greaterthan___addEnd_double(&aVec,j) ; + vector_lessthan_double_greaterthan___addEnd_double(&bVec,j) ; + }; +; + vector_lessthan_double_greaterthan___addEnd_double(&bVec,12.3) ; + double dotProd = dot_vector_lessthan_double_greaterthan__vector_lessthan_double_greaterthan_(aVec, bVec) ;; + return 0; + vector_lessthan_double_greaterthan___destruct(&aVec); + vector_lessthan_double_greaterthan___destruct(&bVec); +} +void print_char_P__(char* toPrint) +{ + { + + printf(toPrint); + ; + }; + return; +} +void print_string(string toPrint) +{ + print_char_P__(string__toCharArray(&toPrint) ) ; +} +void print_int(int toPrint) +{ + { + + printf("%d", toPrint); + ; + }; + return; +} +void print_float(float toPrint) +{ + { + + printf("%f", toPrint); + ; + }; + return; +} +void print_double(double toPrint) +{ + { + + printf("%f", toPrint); + ; + }; + return; +} +void println() +{ + print_char_P__("\n") ; +} +void println_char_P__(char* toPrint) +{ + print_char_P__(toPrint) ; + println() ; +} +void println_string(string toPrint) +{ + println_char_P__(string__toCharArray(&toPrint) ) ; +} +void println_int(int toPrint) +{ + print_int(toPrint) ; + println() ; +} +void println_float(float toPrint) +{ + print_float(toPrint) ; + println() ; +} +void println_double(double toPrint) +{ + print_double(toPrint) ; + println() ; +} +void delete_lessthan_char_greaterthan__char_P__(char* toDelete) +{ + free(toDelete) ; +} +void delete_lessthan_char_greaterthan__char_P___int(char* toDelete, int itemCount) +{ + delete_lessthan_char_greaterthan__char_P__(toDelete) ; +} +void delete_lessthan_double_greaterthan__double_P__(double* toDelete) +{ + free(toDelete) ; +} +void delete_lessthan_double_greaterthan__double_P___int(double* toDelete, int itemCount) +{ + delete_lessthan_double_greaterthan__double_P__(toDelete) ; +} +char* malloc_lessthan_char_greaterthan__int(int size) +{ + char* memPtr = 0;; + { + + memPtr = malloc(size); + ; + }; + return memPtr; +} +double* malloc_lessthan_double_greaterthan__int(int size) +{ + double* memPtr = 0;; + { + + memPtr = malloc(size); + ; + }; + return memPtr; +} +char* new_lessthan_char_greaterthan__int(int count) +{ + return malloc_lessthan_char_greaterthan__int(((sizeof_lessthan_char_greaterthan_() )*(count))) ; +} +double* new_lessthan_double_greaterthan__int(int count) +{ + return malloc_lessthan_double_greaterthan__int(((sizeof_lessthan_double_greaterthan_() )*(count))) ; +} +int sizeof_lessthan_char_greaterthan_() +{ + int result = 0;; + char testObj;; + { + + result = sizeof(testObj); + ; + }; + return result; +} +int sizeof_lessthan_double_greaterthan_() +{ + int result = 0;; + double testObj;; + { + + result = sizeof(testObj); + ; + }; + return result; +}/* Method Definitions for string */ + +string* string__construct(string* this) +{ + vector_lessthan_char_greaterthan___construct(&this->data) ; + return this; +} + +string* string__construct_char_P__(string* this, char* str) +{ + vector_lessthan_char_greaterthan___construct(&this->data) ; + while (*(str)) + { + vector_lessthan_char_greaterthan___addEnd_char(&this->data,*(str)) ; + str = ((str)+(1)); + }; +; + return this; +} + +char* string__toCharArray(string* this) +{ + char* out = new_lessthan_char_greaterthan__int(((this->data).size)) ;; + for ( int i = 0;((i)<(((this->data).size))); i++) + (out)[i] = vector_lessthan_char_greaterthan___get_int(&this->data,i) ; +; + return out; +} +/* Done with string */ + +int lesser_lessthan_int_greaterthan__int_int(int a, int b) +{ + if (((a)>(b))) + return b; +; + return a; +}/* Method Definitions for vector */ + +vector_lessthan_char_greaterthan_* vector_lessthan_char_greaterthan___construct(vector_lessthan_char_greaterthan_* this) +{ + this->size = 0; + this->available = 8; + this->data = new_lessthan_char_greaterthan__int(8) ; + return this; +} + +void vector_lessthan_char_greaterthan___destruct(vector_lessthan_char_greaterthan_* this) +{ + delete_lessthan_char_greaterthan__char_P__(this->data) ; +} + +bool vector_lessthan_char_greaterthan___resize_int(vector_lessthan_char_greaterthan_* this, int newSize) +{ + char* newData = new_lessthan_char_greaterthan__int(newSize) ;; + if (!(newData)) + return false; +; + for ( int i = 0;((i)<(lesser_lessthan_int_greaterthan__int_int(this->size, newSize) )); i++) + (newData)[i] = (this->data)[i]; +; + delete_lessthan_char_greaterthan__char_P___int(this->data, 0) ; + this->data = newData; + this->available = newSize; + return true; +} + +char vector_lessthan_char_greaterthan___at_int(vector_lessthan_char_greaterthan_* this, int index) +{ + return vector_lessthan_char_greaterthan___get_int(this,index) ; +} + +char vector_lessthan_char_greaterthan___get_int(vector_lessthan_char_greaterthan_* this, int index) +{ + if (((((index)<(0)))||(((index)>=(this->size))))) + { + return (this->data)[0]; + }; +; + return (this->data)[index]; +} + +char* vector_lessthan_char_greaterthan___getBackingMemory(vector_lessthan_char_greaterthan_* this) +{ + return this->data; +} + +void vector_lessthan_char_greaterthan___set_int_char(vector_lessthan_char_greaterthan_* this, int index, char dataIn) +{ + if (((((index)<(0)))||(((index)>=(this->size))))) + return; +; + (this->data)[index] = dataIn; +} + +void vector_lessthan_char_greaterthan___addEnd_char(vector_lessthan_char_greaterthan_* this, char dataIn) +{ + this->size++; + if (((this->size)>=(this->available))) + vector_lessthan_char_greaterthan___resize_int(this,((this->size)*(2))) ; +; + (this->data)[((this->size)-(1))] = dataIn; +} +/* Done with vector */ +/* Method Definitions for vector */ + +vector_lessthan_double_greaterthan_* vector_lessthan_double_greaterthan___construct(vector_lessthan_double_greaterthan_* this) +{ + this->size = 0; + this->available = 8; + this->data = new_lessthan_double_greaterthan__int(8) ; + return this; +} + +void vector_lessthan_double_greaterthan___destruct(vector_lessthan_double_greaterthan_* this) +{ + delete_lessthan_double_greaterthan__double_P__(this->data) ; +} + +bool vector_lessthan_double_greaterthan___resize_int(vector_lessthan_double_greaterthan_* this, int newSize) +{ + double* newData = new_lessthan_double_greaterthan__int(newSize) ;; + if (!(newData)) + return false; +; + for ( int i = 0;((i)<(lesser_lessthan_int_greaterthan__int_int(this->size, newSize) )); i++) + (newData)[i] = (this->data)[i]; +; + delete_lessthan_double_greaterthan__double_P___int(this->data, 0) ; + this->data = newData; + this->available = newSize; + return true; +} + +double vector_lessthan_double_greaterthan___at_int(vector_lessthan_double_greaterthan_* this, int index) +{ + return vector_lessthan_double_greaterthan___get_int(this,index) ; +} + +double vector_lessthan_double_greaterthan___get_int(vector_lessthan_double_greaterthan_* this, int index) +{ + if (((((index)<(0)))||(((index)>=(this->size))))) + { + return (this->data)[0]; + }; +; + return (this->data)[index]; +} + +double* vector_lessthan_double_greaterthan___getBackingMemory(vector_lessthan_double_greaterthan_* this) +{ + return this->data; +} + +void vector_lessthan_double_greaterthan___set_int_double(vector_lessthan_double_greaterthan_* this, int index, double dataIn) +{ + if (((((index)<(0)))||(((index)>=(this->size))))) + return; +; + (this->data)[index] = dataIn; +} + +void vector_lessthan_double_greaterthan___addEnd_double(vector_lessthan_double_greaterthan_* this, double dataIn) +{ + this->size++; + if (((this->size)>=(this->available))) + vector_lessthan_double_greaterthan___resize_int(this,((this->size)*(2))) ; +; + (this->data)[((this->size)-(1))] = dataIn; +} +/* Done with vector */ diff --git a/ChrisTest/DotProdTest/DotProdTest.h b/ChrisTest/DotProdTest/DotProdTest.h new file mode 100644 index 0000000..d28375f --- /dev/null +++ b/ChrisTest/DotProdTest/DotProdTest.h @@ -0,0 +1,155 @@ +#include +#include +#include +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/** + * Plain Typedefs + */ + +/*typedef string */ +typedef struct __struct_dummy_string__ string; +/*typedef vector */ +/* non instantiated template vector *//*typedef vector */ +typedef struct __struct_dummy_vector_lessthan_char_greaterthan___ vector_lessthan_char_greaterthan_; +/*typedef vector */ +typedef struct __struct_dummy_vector_lessthan_double_greaterthan___ vector_lessthan_double_greaterthan_; +/** + * Import Includes + */ + +/** + * Extern Variable Declarations + */ + +/** + * Class Structs + */ + +struct __struct_dummy_vector_lessthan_double_greaterthan___ { + double* data; + int size; + int available; +}; +struct __struct_dummy_vector_lessthan_char_greaterthan___ { + char* data; + int size; + int available; +}; +struct __struct_dummy_string__ { + vector_lessthan_char_greaterthan_ data; +}; +/** + * Function Prototypes + */ + + +double dot_vector_lessthan_double_greaterthan__vector_lessthan_double_greaterthan_(vector_lessthan_double_greaterthan_ a, vector_lessthan_double_greaterthan_ b); /*func*/ + +int main(); /*func*/ + +void print_char_P__(char* toPrint); /*func*/ + +void print_string(string toPrint); /*func*/ + +void print_int(int toPrint); /*func*/ + +void print_float(float toPrint); /*func*/ + +void print_double(double toPrint); /*func*/ + +void println(); /*func*/ + +void println_char_P__(char* toPrint); /*func*/ + +void println_string(string toPrint); /*func*/ + +void println_int(int toPrint); /*func*/ + +void println_float(float toPrint); /*func*/ + +void println_double(double toPrint); /*func*/ +/* template function delete NoValue */ +/* template function delete NoValue */ +/* template function delete NoValue */ +/* template function delete NoValue */ + +void delete_lessthan_char_greaterthan__char_P__(char* toDelete); /*func*/ + +void delete_lessthan_char_greaterthan__char_P___int(char* toDelete, int itemCount); /*func*/ + +void delete_lessthan_double_greaterthan__double_P__(double* toDelete); /*func*/ + +void delete_lessthan_double_greaterthan__double_P___int(double* toDelete, int itemCount); /*func*/ +/* template function free NoValue */ +/* template function malloc NoValue */ + +char* malloc_lessthan_char_greaterthan__int(int size); /*func*/ + +double* malloc_lessthan_double_greaterthan__int(int size); /*func*/ +/* template function new NoValue */ +/* template function new NoValue */ + +char* new_lessthan_char_greaterthan__int(int count); /*func*/ + +double* new_lessthan_double_greaterthan__int(int count); /*func*/ +/* template function sizeof NoValue */ + +int sizeof_lessthan_char_greaterthan_(); /*func*/ + +int sizeof_lessthan_double_greaterthan_(); /*func*/ +/* Method Prototypes for string */ + +string* string__construct(string* this); + +string* string__construct_char_P__(string* this, char* str); + +char* string__toCharArray(string* this); +/* Done with string */ +/* template function greater NoValue */ +/* template function lesser NoValue */ + +int lesser_lessthan_int_greaterthan__int_int(int a, int b); /*func*/ +/* Method Prototypes for vector */ + +vector_lessthan_char_greaterthan_* vector_lessthan_char_greaterthan___construct(vector_lessthan_char_greaterthan_* this); + +void vector_lessthan_char_greaterthan___destruct(vector_lessthan_char_greaterthan_* this); + +bool vector_lessthan_char_greaterthan___resize_int(vector_lessthan_char_greaterthan_* this, int newSize); + +char vector_lessthan_char_greaterthan___at_int(vector_lessthan_char_greaterthan_* this, int index); + +char vector_lessthan_char_greaterthan___get_int(vector_lessthan_char_greaterthan_* this, int index); + +char* vector_lessthan_char_greaterthan___getBackingMemory(vector_lessthan_char_greaterthan_* this); + +void vector_lessthan_char_greaterthan___set_int_char(vector_lessthan_char_greaterthan_* this, int index, char dataIn); + +void vector_lessthan_char_greaterthan___addEnd_char(vector_lessthan_char_greaterthan_* this, char dataIn); +/* Done with vector */ +/* Method Prototypes for vector */ + +vector_lessthan_double_greaterthan_* vector_lessthan_double_greaterthan___construct(vector_lessthan_double_greaterthan_* this); + +void vector_lessthan_double_greaterthan___destruct(vector_lessthan_double_greaterthan_* this); + +bool vector_lessthan_double_greaterthan___resize_int(vector_lessthan_double_greaterthan_* this, int newSize); + +double vector_lessthan_double_greaterthan___at_int(vector_lessthan_double_greaterthan_* this, int index); + +double vector_lessthan_double_greaterthan___get_int(vector_lessthan_double_greaterthan_* this, int index); + +double* vector_lessthan_double_greaterthan___getBackingMemory(vector_lessthan_double_greaterthan_* this); + +void vector_lessthan_double_greaterthan___set_int_double(vector_lessthan_double_greaterthan_* this, int index, double dataIn); + +void vector_lessthan_double_greaterthan___addEnd_double(vector_lessthan_double_greaterthan_* this, double dataIn); +/* Done with vector */ diff --git a/ChrisTest/DotProdTest/DotProdTest.sh b/ChrisTest/DotProdTest/DotProdTest.sh new file mode 100644 index 0000000..e882242 --- /dev/null +++ b/ChrisTest/DotProdTest/DotProdTest.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cc -std=c99 DotProdTest.c -o DotProdTest \ No newline at end of file diff --git a/ChrisTest/ErrorLog.txt b/ChrisTest/ErrorLog.txt new file mode 100644 index 0000000..ddeec13 --- /dev/null +++ b/ChrisTest/ErrorLog.txt @@ -0,0 +1,2 @@ +else statements don't work +!= doesn't work diff --git a/ChrisTest/HelloWorld.krak b/ChrisTest/HelloWorld.krak new file mode 100644 index 0000000..9d77ec7 --- /dev/null +++ b/ChrisTest/HelloWorld.krak @@ -0,0 +1,14 @@ +/* + ../build/kraken InputFile.krak ../krakGrammer(tab complete) OutputFile + +*/ + +import io; + +|int| main() +{ + |double| var = 3; + io::println(var); + + return 0; +} diff --git a/ChrisTest/SupressOut.sh b/ChrisTest/SupressOut.sh new file mode 100755 index 0000000..eee017e --- /dev/null +++ b/ChrisTest/SupressOut.sh @@ -0,0 +1,2 @@ +#!/bin/bash +rm *krakout* diff --git a/stdlib/.io.krak.un~ b/stdlib/.io.krak.un~ new file mode 100644 index 0000000000000000000000000000000000000000..550e9d80772f6d049166801609184ecf9bfa1688 GIT binary patch literal 1369 zcmWH`%$*;a=aT=FfoYZGH^v_oK3$dn`<4{S3eWU8p7mS%=j7Vk7as@aWChP=U|PqCWiP6Pz6j-8bpDlTtN&F{{R2~e+G~Uh%<_55CWlW z>|x;OU|{$v!N9=af@B9c;7uFB(F9_H;t(bciZVACXEd5%AwerTl#M+aIhsH@#FK%6 y!HX2(J~_d literal 0 HcmV?d00001 diff --git a/stdlib/io.krak b/stdlib/io.krak index 3182d81..a5d7b60 100644 --- a/stdlib/io.krak +++ b/stdlib/io.krak @@ -67,3 +67,15 @@ __if_comp__ __C__ __simple_passthrough__ """ println(); } +|void| println(|double| toPrint){ + print(toPrint); + println(); +} + + + + + + + + diff --git a/tests/SupressOut.sh b/tests/SupressOut.sh new file mode 100755 index 0000000..eee017e --- /dev/null +++ b/tests/SupressOut.sh @@ -0,0 +1,2 @@ +#!/bin/bash +rm *krakout* diff --git a/tests/test_topLevelVarInit/test_topLevelVarInit b/tests/test_topLevelVarInit/test_topLevelVarInit new file mode 100755 index 0000000000000000000000000000000000000000..4ed2f7ab08e1408f85d355aab87e4345dc74a411 GIT binary patch literal 11000 zcmb<-^>JfjWMqH=CI&kO5N`pC16T+`GB8vqgSlYBfx&`-gTaA8jzOA%je&uIm4Sf) zrp^J%g3$*+hA}WOz-SJz2@DL(3=9k`AT|?-U|?Wif|>xOWuU?^8fpyKZ6N!g(kM2A z#Qq3?NCpNN&A^}l769o7xs^c>%w=E@On@+;v;))~9#9&l55xuOlYr`zfU1Yl7eEFx zFfhPqnEyb217R7E0SpWbGBAHZX%~p?3@{p`79jg}MWFV< zXpmZv%D|^3DIj-(*u-FHFfr)oWG0!J=;x&9=49rTR_In(nCY6C=oRPd8G+*mqz+`I zyI&~SSde!>_JBeaWVZ+dBrZYnpP9RQ0=mx?uVDXp;GE9Z|8^F#;P?XR2Vt-QL=xHz z3=Be8)PjNqo46zn^#%;Em_#)UWCjSMiZU=TCXP*9YaSCYn%o0yZ6pUe;+ z50Z&5E=epZiO)^U%wtF^N=;>mk5A9d&w~obGr0SBIyuK1=^5#nf=p&&06_)@CI&_@ zWMBY=CrGALDw7i=ZV%!xFfhCjf}}@K*n+|pD$Kwk3=wB%U;u|DOk4m-926%oaS0@G zP#%McDBA9`J!K3*I$6=U>5c4)q{|(=Ic3zD0=zQeS{NzJGi0APG0o)D@9>)(p-~v&{r?EOPyjcGK z|Nk#({PHdg3_IL~6Bt50bRC2f7(AMP@OgATEtB2>at_EFg0cHS68|5h@yoY>1Q}uv zr-6VTjK2>gAL`Ng4n%t#{KxFk`P8HHgU7)a_8yGKJTCq#5rvz^4Ks~j9%K&K{s!BZ zyb25qrGlXzoljrn{r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sW{)E|&?tjo61}ILPAll*M4xsidNT>otK-YGG{DQ8( z58Ur#0EaI~DQsL+0%Rxy14d68DhyHz#+_*TVdEGMP=(+*9I#3V0c+>OXi&cv6fU6f z0jYqsUl&02Z-PmHBpE<$Unm1g%|f#uHZBqZ9Y}?ZXF`>O*FwSAAR5wtMub0X{3HRY z9~5RFbubKd7L3cV0%|`j{$cC8VC%kM>$_kY(DiRa(+?YuX@FW>gQfu%e=ze7FfcIi zLGu7u3_30iTOWt69-V&%vE{`m{jl{{FQALUVCunP0~)u7GGOAb(e%T{pFTkKLvkZj6Bhkn z(DcLlrv{(_BrNF_W-rXdUr;k);Rox7I6(EIt4B)?44?rmQ2qg}kAs;BqG9?$data) ; + return this; +} + +string* string__construct_char_P__(string* this, char* str) +{ + vector_lessthan_char_greaterthan___construct(&this->data) ; + while (*(str)) + { + vector_lessthan_char_greaterthan___addEnd_char(&this->data,*(str)) ; + str = ((str)+(1)); + }; +; + return this; +} + +char* string__toCharArray(string* this) +{ + char* out = mem_scopeop_new_lessthan_char_greaterthan__int(((this->data).size)) ;; + for ( int i = 0;((i)<(((this->data).size))); i++) + (out)[i] = vector_lessthan_char_greaterthan___get_int(&this->data,i) ; +; + return out; +} +/* Done with string */ + +int lesser_lessthan_int_greaterthan__int_int(int a, int b) +{ + if (((a)>(b))) + return b; +; + return a; +}/* Method Definitions for vector */ + +vector_lessthan_char_greaterthan_* vector_lessthan_char_greaterthan___construct(vector_lessthan_char_greaterthan_* this) +{ + this->size = 0; + this->available = 8; + this->data = new_lessthan_char_greaterthan__int(8) ; + return this; +} + +void vector_lessthan_char_greaterthan___destruct(vector_lessthan_char_greaterthan_* this) +{ + delete_lessthan_char_greaterthan__char_P__(this->data) ; +} + +bool vector_lessthan_char_greaterthan___resize_int(vector_lessthan_char_greaterthan_* this, int newSize) +{ + char* newData = new_lessthan_char_greaterthan__int(newSize) ;; + if (!(newData)) + return false; +; + for ( int i = 0;((i)<(lesser_lessthan_int_greaterthan__int_int(this->size, newSize) )); i++) + (newData)[i] = (this->data)[i]; +; + delete_lessthan_char_greaterthan__char_P___int(this->data, 0) ; + this->data = newData; + this->available = newSize; + return true; +} + +char vector_lessthan_char_greaterthan___at_int(vector_lessthan_char_greaterthan_* this, int index) +{ + return vector_lessthan_char_greaterthan___get_int(this,index) ; +} + +char vector_lessthan_char_greaterthan___get_int(vector_lessthan_char_greaterthan_* this, int index) +{ + if (((((index)<(0)))||(((index)>=(this->size))))) + { + return (this->data)[0]; + }; +; + return (this->data)[index]; +} + +char* vector_lessthan_char_greaterthan___getBackingMemory(vector_lessthan_char_greaterthan_* this) +{ + return this->data; +} + +void vector_lessthan_char_greaterthan___set_int_char(vector_lessthan_char_greaterthan_* this, int index, char dataIn) +{ + if (((((index)<(0)))||(((index)>=(this->size))))) + return; +; + (this->data)[index] = dataIn; +} + +void vector_lessthan_char_greaterthan___addEnd_char(vector_lessthan_char_greaterthan_* this, char dataIn) +{ + this->size++; + if (((this->size)>=(this->available))) + vector_lessthan_char_greaterthan___resize_int(this,((this->size)*(2))) ; +; + (this->data)[((this->size)-(1))] = dataIn; +} +/* Done with vector */ diff --git a/tests/test_topLevelVarInit/test_topLevelVarInit.h b/tests/test_topLevelVarInit/test_topLevelVarInit.h new file mode 100644 index 0000000..78e92ad --- /dev/null +++ b/tests/test_topLevelVarInit/test_topLevelVarInit.h @@ -0,0 +1,116 @@ +#include +#include +#include +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/*unknown declaration named translation_unit*/ +/** + * Plain Typedefs + */ + +/*typedef string */ +typedef struct __struct_dummy_string__ string; +/*typedef vector */ +/* non instantiated template vector *//*typedef vector */ +typedef struct __struct_dummy_vector_lessthan_char_greaterthan___ vector_lessthan_char_greaterthan_; +/** + * Import Includes + */ + +/** + * Extern Variable Declarations + */ + +extern int a; /*extern identifier*/ +/** + * Class Structs + */ + +struct __struct_dummy_vector_lessthan_char_greaterthan___ { + char* data; + int size; + int available; +}; +struct __struct_dummy_string__ { + vector_lessthan_char_greaterthan_ data; +}; +/** + * Function Prototypes + */ + + +int main(); /*func*/ + +void print_char_P__(char* toPrint); /*func*/ + +void print_string(string toPrint); /*func*/ + +void print_int(int toPrint); /*func*/ + +void print_float(float toPrint); /*func*/ + +void print_double(double toPrint); /*func*/ + +void println(); /*func*/ + +void println_char_P__(char* toPrint); /*func*/ + +void println_string(string toPrint); /*func*/ + +void println_int(int toPrint); /*func*/ + +void println_float(float toPrint); /*func*/ +/* template function delete NoValue */ +/* template function delete NoValue */ +/* template function delete NoValue */ +/* template function delete NoValue */ + +void delete_lessthan_char_greaterthan__char_P__(char* toDelete); /*func*/ + +void delete_lessthan_char_greaterthan__char_P___int(char* toDelete, int itemCount); /*func*/ +/* template function free NoValue */ +/* template function malloc NoValue */ + +char* malloc_lessthan_char_greaterthan__int(int size); /*func*/ + +char* mem_scopeop_new_lessthan_char_greaterthan__int(int count); /*func*/ +/* template function new NoValue */ +/* template function new NoValue */ + +char* new_lessthan_char_greaterthan__int(int count); /*func*/ +/* template function sizeof NoValue */ + +int sizeof_lessthan_char_greaterthan_(); /*func*/ +/* Method Prototypes for string */ + +string* string__construct(string* this); + +string* string__construct_char_P__(string* this, char* str); + +char* string__toCharArray(string* this); +/* Done with string */ +/* template function greater NoValue */ +/* template function lesser NoValue */ + +int lesser_lessthan_int_greaterthan__int_int(int a, int b); /*func*/ +/* Method Prototypes for vector */ + +vector_lessthan_char_greaterthan_* vector_lessthan_char_greaterthan___construct(vector_lessthan_char_greaterthan_* this); + +void vector_lessthan_char_greaterthan___destruct(vector_lessthan_char_greaterthan_* this); + +bool vector_lessthan_char_greaterthan___resize_int(vector_lessthan_char_greaterthan_* this, int newSize); + +char vector_lessthan_char_greaterthan___at_int(vector_lessthan_char_greaterthan_* this, int index); + +char vector_lessthan_char_greaterthan___get_int(vector_lessthan_char_greaterthan_* this, int index); + +char* vector_lessthan_char_greaterthan___getBackingMemory(vector_lessthan_char_greaterthan_* this); + +void vector_lessthan_char_greaterthan___set_int_char(vector_lessthan_char_greaterthan_* this, int index, char dataIn); + +void vector_lessthan_char_greaterthan___addEnd_char(vector_lessthan_char_greaterthan_* this, char dataIn); +/* Done with vector */ diff --git a/tests/test_topLevelVarInit/test_topLevelVarInit.results b/tests/test_topLevelVarInit/test_topLevelVarInit.results new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/test_topLevelVarInit/test_topLevelVarInit.results @@ -0,0 +1 @@ +0 diff --git a/tests/test_topLevelVarInit/test_topLevelVarInit.sh b/tests/test_topLevelVarInit/test_topLevelVarInit.sh new file mode 100755 index 0000000..30705f8 --- /dev/null +++ b/tests/test_topLevelVarInit/test_topLevelVarInit.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cc -std=c99 ./test_topLevelVarInit.c -o ./test_topLevelVarInit \ No newline at end of file