diff --git a/doc/Manual.aux b/doc/Manual.aux deleted file mode 100644 index 26677ab..0000000 --- a/doc/Manual.aux +++ /dev/null @@ -1,30 +0,0 @@ -\relax -\@writefile{toc}{\contentsline {section}{\numberline {1}Compiling}{1}} -\@writefile{toc}{\contentsline {section}{\numberline {2}Variables}{1}} -\newlabel{sec:var}{{2}{1}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Variable Declaration}{2}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Primitive Types}{2}} -\@writefile{toc}{\contentsline {section}{\numberline {3}Functions}{2}} -\@writefile{toc}{\contentsline {section}{\numberline {4}Input and Output}{2}} -\@writefile{toc}{\contentsline {section}{\numberline {5}Memory Management}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Pointers}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}References}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {5.3}Dynamic Memory Allocation}{4}} -\@writefile{toc}{\contentsline {section}{\numberline {6}Classes}{4}} -\@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Constructors}{4}} -\@writefile{toc}{\contentsline {subsection}{\numberline {6.2}Operator Overloading}{4}} -\@writefile{toc}{\contentsline {subsection}{\numberline {6.3}Inheritance}{4}} -\@writefile{toc}{\contentsline {section}{\numberline {7}Templates}{4}} -\@writefile{toc}{\contentsline {section}{\numberline {8}Standard Library}{5}} -\@writefile{toc}{\contentsline {subsection}{\numberline {8.1}Import Statements}{5}} -\@writefile{toc}{\contentsline {subsection}{\numberline {8.2}Vector}{5}} -\@writefile{toc}{\contentsline {subsection}{\numberline {8.3}String}{5}} -\@writefile{toc}{\contentsline {subsection}{\numberline {8.4}Regex}{5}} -\@writefile{toc}{\contentsline {subsection}{\numberline {8.5}Util}{5}} -\@writefile{toc}{\contentsline {subsection}{\numberline {8.6}Data Structures}{5}} -\@writefile{toc}{\contentsline {subsubsection}{\numberline {8.6.1}Stack}{5}} -\@writefile{toc}{\contentsline {subsubsection}{\numberline {8.6.2}Queue}{5}} -\@writefile{toc}{\contentsline {subsubsection}{\numberline {8.6.3}Set}{5}} -\@writefile{toc}{\contentsline {subsubsection}{\numberline {8.6.4}Map}{5}} -\@writefile{toc}{\contentsline {section}{\numberline {9}Understanding Kraken Errors}{5}} -\@writefile{toc}{\contentsline {section}{\numberline {10}C Passthrough}{5}} diff --git a/doc/Manual.log b/doc/Manual.log deleted file mode 100644 index e2dfbca..0000000 --- a/doc/Manual.log +++ /dev/null @@ -1,281 +0,0 @@ -This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2015.9.2) 26 NOV 2015 18:56 -entering extended mode -**Manual.tex -(C:\Users\Chris\Documents\GitHub\kraken\doc\Manual.tex -LaTeX2e <2011/06/27> -Babel and hyphenation patterns for english, afrikaans, ancientgreek, ar -abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, -croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga -lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland -ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian, - lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n -german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman -ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm -an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl -ishmax, welsh, loaded. -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" -Document Class: article 2007/10/19 v1.4h Standard LaTeX document class -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo" -File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) -) -\c@part=\count79 -\c@section=\count80 -\c@subsection=\count81 -\c@subsubsection=\count82 -\c@paragraph=\count83 -\c@subparagraph=\count84 -\c@figure=\count85 -\c@table=\count86 -\abovecaptionskip=\skip41 -\belowcaptionskip=\skip42 -\bibindent=\dimen102 -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphicx.sty" -Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\keyval.sty" -Package: keyval 1999/03/16 v1.13 key=value parser (DPC) -\KV@toks@=\toks14 -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphics.sty" -Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR) - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\trig.sty" -Package: trig 1999/03/16 v1.09 sin cos tan (DPC) -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg" -File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive -) -Package graphics Info: Driver file: pdftex.def on input line 91. - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def" -File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX - -("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty" -Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO) -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty" -Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO) -) -\Gread@gobject=\count87 -)) -\Gin@req@height=\dimen103 -\Gin@req@width=\dimen104 -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty" -Package: amsmath 2013/01/14 v2.14 AMS math features -\@mathmargin=\skip43 - -For additional information on amsmath, use the `?' option. -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amstext.sty" -Package: amstext 2000/06/29 v2.01 - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty" -File: amsgen.sty 1999/11/30 v2.0 -\@emptytoks=\toks15 -\ex@=\dimen105 -)) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty" -Package: amsbsy 1999/11/29 v1.2d -\pmbraise@=\dimen106 -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty" -Package: amsopn 1999/12/14 v2.01 operator names -) -\inf@bad=\count88 -LaTeX Info: Redefining \frac on input line 210. -\uproot@=\count89 -\leftroot@=\count90 -LaTeX Info: Redefining \overline on input line 306. -\classnum@=\count91 -\DOTSCASE@=\count92 -LaTeX Info: Redefining \ldots on input line 378. -LaTeX Info: Redefining \dots on input line 381. -LaTeX Info: Redefining \cdots on input line 466. -\Mathstrutbox@=\box26 -\strutbox@=\box27 -\big@size=\dimen107 -LaTeX Font Info: Redeclaring font encoding OML on input line 566. -LaTeX Font Info: Redeclaring font encoding OMS on input line 567. -\macc@depth=\count93 -\c@MaxMatrixCols=\count94 -\dotsspace@=\muskip10 -\c@parentequation=\count95 -\dspbrk@lvl=\count96 -\tag@help=\toks16 -\row@=\count97 -\column@=\count98 -\maxfields@=\count99 -\andhelp@=\toks17 -\eqnshift@=\dimen108 -\alignsep@=\dimen109 -\tagshift@=\dimen110 -\tagwidth@=\dimen111 -\totwidth@=\dimen112 -\lineht@=\dimen113 -\@envbody=\toks18 -\multlinegap=\skip44 -\multlinetaggap=\skip45 -\mathdisplay@stack=\toks19 -LaTeX Info: Redefining \[ on input line 2665. -LaTeX Info: Redefining \] on input line 2666. -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\times.sty" -Package: times 2005/04/12 PSNFSS-v9.2a (SPQR) -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\listings\listings.sty" -\lst@mode=\count100 -\lst@gtempboxa=\box28 -\lst@token=\toks20 -\lst@length=\count101 -\lst@currlwidth=\dimen114 -\lst@column=\count102 -\lst@pos=\count103 -\lst@lostspace=\dimen115 -\lst@width=\dimen116 -\lst@newlines=\count104 -\lst@lineno=\count105 -\lst@maxwidth=\dimen117 - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\listings\lstmisc.sty" -File: lstmisc.sty 2015/06/04 1.6 (Carsten Heinz) -\c@lstnumber=\count106 -\lst@skipnumbers=\count107 -\lst@framebox=\box29 -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\listings\listings.cfg" -File: listings.cfg 2015/06/04 1.6 listings configuration -)) -Package: listings 2015/06/04 1.6 (Carsten Heinz) - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\color.sty" -Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC) - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\color.cfg" -File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive -) -Package color Info: Driver file: pdftex.def on input line 130. -) -(C:\Users\Chris\Documents\GitHub\kraken\doc\Manual.aux) -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 29. -LaTeX Font Info: ... okay on input line 29. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 29. -LaTeX Font Info: ... okay on input line 29. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 29. -LaTeX Font Info: ... okay on input line 29. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 29. -LaTeX Font Info: ... okay on input line 29. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 29. -LaTeX Font Info: ... okay on input line 29. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 29. -LaTeX Font Info: ... okay on input line 29. -LaTeX Font Info: Try loading font information for OT1+ptm on input line 29. - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\ot1ptm.fd" -File: ot1ptm.fd 2001/06/04 font definitions for OT1/ptm. -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii" -[Loading MPS to PDF converter (version 2006.09.02).] -\scratchcounter=\count108 -\scratchdimen=\dimen118 -\scratchbox=\box30 -\nofMPsegments=\count109 -\nofMParguments=\count110 -\everyMPshowfont=\toks21 -\MPscratchCnt=\count111 -\MPscratchDim=\dimen119 -\MPnumerator=\count112 -\makeMPintoPDFobject=\count113 -\everyMPtoPDFconversion=\toks22 -) -\c@lstlisting=\count114 -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <14.4> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 36. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <12> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 73. - ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\listings\lstlang1.sty" -File: lstlang1.sty 2015/06/04 1.6 listings language file -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\listings\lstlang1.sty" -File: lstlang1.sty 2015/06/04 1.6 listings language file -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\listings\lstmisc.sty" -File: lstmisc.sty 2015/06/04 1.6 (Carsten Heinz) -) -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <10> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 75. - [1 - -{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}] -LaTeX Font Info: Try loading font information for OMS+ptm on input line 97. - -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\omsptm.fd" -File: omsptm.fd -) -LaTeX Font Info: Font shape `OMS/ptm/m/n' in size <10> not available -(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 97. - -Overfull \hbox (81.00433pt too wide) in paragraph at lines 97--98 -[][][][][][][][][][][][][][][][][][][][][][][][][][] - [] - -[2] -Overfull \hbox (51.00403pt too wide) in paragraph at lines 130--131 -[][][][][][][][][][][][][][][][][][][][][][][][] - [] - - -Overfull \hbox (15.00366pt too wide) in paragraph at lines 144--146 -[][][][][][][][][][][][][][][][][][][][][][][][] - [] - - -Overfull \hbox (39.0039pt too wide) in paragraph at lines 150--152 -[][][][][][][][][][][][][][][][][][][][][][] - [] - - -Overfull \hbox (21.00372pt too wide) in paragraph at lines 168--169 -[][][][][][][][][][][][][][][][][][][][][][][][][] - [] - -[3] -LaTeX Font Info: Try loading font information for OML+ptm on input line 197. - - ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\omlptm.fd" -File: omlptm.fd -) -LaTeX Font Info: Font shape `OML/ptm/m/n' in size <10> not available -(Font) Font shape `OML/cmm/m/it' tried instead on input line 197. - -Overfull \hbox (33.00385pt too wide) in paragraph at lines 197--198 -[][][][][][][][][][][][][][][][][][][][][][][][][][] - [] - - -Overfull \hbox (87.0044pt too wide) in paragraph at lines 198--199 -[][][][][][][][][][][][][][][][][][][][][][][][][][][] - [] - -[4] [5] (C:\Users\Chris\Documents\GitHub\kraken\doc\Manual.aux) ) -Here is how much of TeX's memory you used: - 3293 strings out of 493921 - 44742 string characters out of 3144877 - 140396 words of memory out of 3000000 - 6566 multiletter control sequences out of 15000+200000 - 20598 words of font info for 43 fonts, out of 3000000 for 9000 - 841 hyphenation exceptions out of 8191 - 33i,6n,60p,335b,1580s stack positions out of 5000i,500n,10000p,200000b,50000s -{C:/Program Fi -les (x86)/MiKTeX 2.9/fonts/enc/dvips/fontname/8r.enc} -Output written on Manual.pdf (5 pages, 75691 bytes). -PDF statistics: - 39 PDF objects out of 1000 (max. 8388607) - 0 named destinations out of 1000 (max. 500000) - 1 words of extra memory for PDF output out of 10000 (max. 10000000) - diff --git a/doc/Manual.pdf b/doc/Manual.pdf deleted file mode 100644 index fce4ade..0000000 Binary files a/doc/Manual.pdf and /dev/null differ diff --git a/doc/Manual.synctex.gz b/doc/Manual.synctex.gz deleted file mode 100644 index e6c1b69..0000000 Binary files a/doc/Manual.synctex.gz and /dev/null differ diff --git a/doc/Manual.tex b/doc/Manual.tex index 9027e69..da9c39d 100644 --- a/doc/Manual.tex +++ b/doc/Manual.tex @@ -20,7 +20,7 @@ % DOCUMENT INFORMATION %---------------------------------------------------------------------------------------- -\title{Kraken Programming Guide} % Title +\title{Kraken Programming Guide v0.0} % Title \author{Jack \textsc{Sparrow}} % Author name @@ -204,8 +204,103 @@ optional after declarations. \section{Classes} \subsection{Constructors} + As with most of kraken, classes are based on their C++ counterparts, with + a few key differences. Constructors in kraken are not called by default. + You must actually call the constructor function. The constructor must return + a pointer to the object, which is denoted by the {\bf{this}} keyword. + The destructor is automatically called when the object goes out of scope, + and is just called destruct(). An example class is shown below: + \begin{lstlisting}[language=C++] + obj MyObject (Object) { + var variable1: int; + var variable2: vector::vector; + + fun construct(): *MyObject { + variable1 = 42; + variable2.construct(); + return this; + } + + //Could also pass by reference??? + fun copy_construct(old: *MyObject): void { + variable1 = &old->variable1; + variable2.copy_construct(&old->variable2); + } + + fun destruct() { + variable2.destruct(); + } + } + \end{lstlisting} \subsection{Operator Overloading} + Operator overloading allows you to use operators for syntactic sugar, and + make your code look nicer. This again borrow mostly from C++, and you can + overload most of the operators that you can in C++. An example is shown + below: + \begin{lstlisting} + //Inside a class + + //overload the assignment operator + fun operator=(other: SampleObject): void{ + destruct(); + copy_construct(&other); + } + + //overload the equality operator + fun operator==(other: SampleObject): bool{ + return EqualTest == other.EqualTest; + } + \end{lstlisting} \subsection{Inheritance} + Inheritance is one of the keys of Object Oriented Progamming. It allows you + to have related classes be derived from a base class. The classic example is + having a dog and a cat class inherit from an animal class. The animal class + is the base class, while the dog and cat are derived classes. \\ + Derived classes have the same members and functions as the base class, but can + also overload them with implementations specific to the derived class. For + instance, the animal class may have a run function, that returns some standard + speed for an animal. The derived classes would overload that run function, + and return their specific speed. Dog and cat can be passed to functions that + take in the animal class, and this is something called polymorphism. + Kraken's inheritance is taken in part from the Java style of inheritance. + All base class objects inherit from the Object class. The derived classes + only need to inherit from the base class. + \begin{lstlisting}[language=C++] + //brief class for clarity + obj Animal(Object){ + var speed: int; + + //returns the standard speed + fun run(): int; + } + + obj Dog(Animal){ + //returns the speed specific to dog + fun run(): int; + } + + obj Cat(Animal){ + //returns the speed specific to cat + fun run(): int; + } + + fun OutrunBear(me: Animal, you:Animal): bool{ + var BearSpeed = 10; + if(me.run() > you.run()) + { + //I don't have to outrun the bear + //I just have to outrun you + return true; + } else if(me.run() > BearSpeed){ + //Months at the gym paid off + return true; + }else{ + //New Year's Resolution. + //Going to hit the gym. + return false; + } + } + \end{lstlisting} %---------------------------------------------------------------------------------------- % SECTION Templates %----------------------------------------------------------------------------------------