亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? readme.html

?? building parser with C++ functions
?? HTML
字號:
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />  <title>COMP151 Programming Assignment 1, Spring 2006</title>  <meta name="generator" content="amaya 8.8.3, see http://www.w3.org/Amaya/"  /></head><body><h1>COMP151 Programming Assignment 2, Spring 2007</h1><p><strong>Author:</strong> <a href="http://www.cs.ust.hk/~dekai/">DekaiWu</a></p><p><strong>Date:</strong> Due 2007.03.28 at 23:00 by CASS</p><p><strong>Download:</strong> <ahref="http://www.cs.ust.hk/~dekai/151/assignments/a2.tar.gz">http://www.cs.ust.hk/~dekai/151/assignments/a2.tar.gz</a></p><p><strong>Assignment page:</strong> <ahref="http://www.cs.ust.hk/~dekai/151/assignments/a2/html/">http://www.cs.ust.hk/~dekai/151/assignments/a2/html/</a></p><p><strong>Course page:</strong> <ahref="http://www.cs.ust.hk/~dekai/151/">http://www.cs.ust.hk/~dekai/151/</a></p><h3>Your assignment</h3><p>You are assigned to maintain and extend the expression evaluator codebuilt in <a href="http://www.cs.ust.hk/~dekai/151/assignments/a1/html/">Assignment 1</a>.Your job this time is to take the following steps.</p><h3>Step 1: Re-design Cell using polymorphism</h3><p>Completely re-implement the <tt>Cell</tt> class, to eliminate the use of atagged union, by instead making use of polymorphism virtual functions. The<tt>Cell</tt> class is to become an abstract base class (ABC). Derivedclasses should include <tt>IntCell</tt>, <tt>DoubleCell</tt>,<tt>SymbolCell</tt>, and <tt>ConsCell</tt>.</p><p>After this step, your <tt>eval()</tt> implementation from Assignment 1should still work (assuming you didn't break encapsulation!) Note that theinterface specified in <tt>cons.hpp</tt> has <em>not</em> changed. Thefunction <em>definitions</em> in <tt>cons.hpp</tt> may have changed to fitthe new <tt>Cell</tt> implementation's use of late binding, but the<em>declarations</em> have not. This means that <tt>parse()</tt> and<tt>eval()</tt> and any other functions that made proper use of the interfaceencapsulated by <tt>cons.hpp</tt> should all still work.</p><h3>Step 2: Do a cleaner re-design of eval() to take advantage ofpolymorphism</h3><p>Re-design your <tt>eval()</tt> implementation to be much cleaner, takingadvantage of the polymorphism to get rid of all those ugly<tt>if-then-else</tt> and/or <tt>switch</tt> statements from your Assignment1 version, by instead making appropriate use of function overriding and/oroverloading.</p><p>To accomplish this step, you will have to extend the interface in<tt>Cell.hpp</tt>. Because of this, note that after this step, your new<tt>eval()</tt> implementation may no longer work with your oldimplementation of the <tt>Cell</tt> class from Assignment 1.</p><h3>Step 3: Generalize to add more arithmetic operators</h3><p>Take advantage of the cleaner polymorphic implementation, to add morearithmetic operators <em>neatly</em>. Besides the <tt>+</tt> and<tt>ceiling</tt> operators from Assignment 1, you should add the <tt>-</tt>,<tt>*</tt>, <tt>/</tt>, and <tt>floor</tt> arithmetic operators for<tt>int</tt> and <tt>double</tt> operands.</p><p>Note that the <tt>-</tt>, <tt>*</tt>, and <tt>/</tt> operators aregeneralized similarly to the <tt>+</tt> operator. The <tt>-</tt>, <tt>*</tt>,and <tt>/</tt> operators can also be called with more than two arguments; forexample, <tt>(- 11 2 3)</tt> means the same thing as <tt>(- (- 11 2) 3)</tt>.The same holds for the <tt>*</tt> and <tt>/</tt> operators, so for example,<tt>(* 11 2 3)</tt> means the same thing as <tt>(* (* 11 2) 3)</tt>, while<tt>(/ 11 2 3)</tt> means the same thing as <tt>(/ (/ 11 2) 3)</tt>.</p><p>If the <tt>*</tt> operator is called with zero arguments, then it simplyreturns 1, which is the identity value for multiplication (just like 0 forthe <tt>+</tt> operator). If the <tt>*</tt> operator is called with oneargument, then it returns the same value.</p><p>If the <tt>-</tt> operator is called with one argument, then it simplyreturns the negative of the argument. If the <tt>/</tt> operator is calledwith one argument, then it simply returns the inverse of the argument.</p><p>To avoid ambiguity, the <tt>-</tt> and <tt>/</tt> operators<em>cannot</em> be called with zero arguments, unlike the <tt>+</tt> and<tt>*</tt> operators. So, for example <tt>(-)</tt> is considered to be asemantically ill-formed expression.</p><p>If you've done things correctly, you should notice how much easier it isto add all these operators, now that you have polymorphism.</p><h3>Step 4: Implement quoted expressions</h3><p>Next you will add support for <em>quoted expressions</em>, which allow youto prevent <tt>eval()</tt> from trying to evaluate s-expressions. The special<tt>quote</tt> operator takes exactly one operand, which can be <em>any</em>s-expression, and simply returns the exact same expression. The operand is<em>not</em> evaluated, so it just needs to be a syntactically valid tree(including empty lists as well as leaf nodes representing atomic ints,doubles, or symbols). It does <em>not</em> need to be a semantically validexpression. For example:</p><p><tt>&gt; (quote (a b c))<br />(a b c)<br />&gt; (quote (+ 2 3))<br />(+ 2 3)<br />&gt; (quote (if if 5))<br />(if if 5)<br />&gt; (quote ())<br />()<br />&gt; (quote (quote (a b c)))<br />(quote (a b c))<br />&gt; (quote hello)<br />hello<br />&gt; (quote 6)<br />6<br />&gt; (quote 3.14)<br />3.14<br />&gt; (+ 4 (quote 2))<br />6<br />&gt; (+ 4 (quote (* 2 3)))<br />ERROR: operand of + cannot be a list<br />&gt; (+ 4 (* 2 3))<br />10</tt></p><h3>Step 5: Expose <tt>cons</tt>, <tt>car</tt>, <tt>cdr</tt>, and<tt>nullp</tt> in Scheme</h3><p>Finally, you will expose your existing <tt>cons.hpp</tt> C++implementation of <tt>cons</tt>, <tt>car</tt>, <tt>cdr</tt>, and<tt>nullp</tt> so that they can be called from Scheme just like otheroperators such as <tt>ceiling</tt>:</p><p><tt>&gt; (cons 4 (quote ()))<br />(4)<br />&gt; (cons (quote hello) (cons 4 (quote ())))<br />(hello 4)<br />&gt; (cons 2 (cons (quote hello) (cons 4 (quote ()))))<br />(2 hello 4)<br />&gt; (car (cons 2 (cons (quote hello) (cons 4 (quote ())))))<br />2<br />&gt; (cdr (cons 2 (cons (quote hello) (cons 4 (quote ())))))<br />(hello 4)<br />&gt; (nullp foo)<br />0<br />&gt; (nullp 0)<br />0<br />&gt; (nullp 1)<br />0<br />&gt; (nullp (quote ()))<br />1<br />&gt; (nullp (quote (a b c)))<br />0</tt></p><h3>Putting it all together</h3><p>This time, we are not including any dummy implementation of<tt>Cell.hpp</tt>, <tt>Cell.cpp</tt> or <tt>eval.cpp</tt> at all. Theimplementation is up to you. But be careful! You must make sure your<tt>Cell</tt> interface fits what <tt>cons.hpp</tt> expects!</p><p>We're again including <tt>parse.cpp</tt> for your convenience, in case youwant to build your assignment on some other machine outside the lab. Butremember you shouldn't look inside <tt>parse.cpp</tt> at all. (In the realworld, you would only get the separately-compiled <tt>parse.o</tt>, so you<em>couldn't</em> look inside <tt>parse.cpp</tt> even if you wanted to!)</p><h3>Important reminders</h3><p>You must follow the design approach outlined in this document. Do<em>not</em> just implement the required functionality using a differentdesign.</p><p>You are expected to make best possible use of polymorphism and virtualfunctions. For example, of course your old <tt>eval()</tt> from Assignment 1should still work, but without making correct use of polymorphism throughout,it will not be considered a solution to Assignment 2 (even if it implementsthe additional operators).</p><p>This time you <em>must</em> use virtual functions in this assignment, butyou still may <em>not</em> use templates. This assignment is about dynamic OOsupport in C++. (You'll get a chance to use templates in the followingassignment...)</p><p>Remember we are focusing on proper use of encapsulation. So you stillshould <em>not</em> edit the files <tt>parse.hpp</tt>, <tt>parse.cpp</tt>,<tt>cons.hpp</tt>, <tt>eval.hpp</tt>, or <tt>main.cpp</tt>. Again, theprogramming assignments are mini-exercises in how multiple programmers aresupposed to interact and communicate in the real world; these files are<em>owned</em> and <em>maintained</em> by the other author(s).</p><p>You will need to turn in a tar file <tt>a2.tar.gz</tt> containing allsource files including your own implementation of <tt>Cell.hpp</tt>,<tt>Cell.cpp</tt>, and <tt>eval.cpp</tt>. Depending on your approach, you mayor may not also wish to add more files. You should also make sure to includeall doxygen generated HTML documentation.</p><p>Depending on your approach, you may or may not need to change the<tt>Makefile</tt>. Whether you changed it or not, always make sure youinclude whatever <tt>Makefile</tt> is needed to build your program, when yousubmit assignment. Otherwise, the graders cannot build your program.</p><p>You must write the final version of the program on your own. Sophisticatedplagiarism detection systems are in operation, and they are pretty good atcatching copying! If you worked in study groups, you must also acknowledgeyour collaborators in the write-up for each problem, whether or not they areclassmates. Other cases will be dealt with as plagiarism. Re-read the policyon the course home page, and note the University's tougher policy this yearregarding cheating.</p><p><strong>Your programming style (how clearly and how well you speak C++) iswhat will be graded. Correct functioning of your program is necessary but notsufficient!</strong></p><hr /><p style="text-align: right"><i>Last updated: 2007.03.19 dekai</i></p></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲风情在线资源站| 日韩一区二区麻豆国产| 欧美久久久久久久久中文字幕| 欧美一级午夜免费电影| 亚洲男同性视频| 国产综合色视频| 欧美日韩午夜在线| 亚洲欧洲韩国日本视频| 美女网站色91| 欧美久久久久久蜜桃| 亚洲美女淫视频| 成人精品国产福利| 久久网站最新地址| 美女脱光内衣内裤视频久久网站| 欧美日韩国产一二三| 综合亚洲深深色噜噜狠狠网站| 国产一区二区中文字幕| 日韩一区二区三区视频在线观看| 五月天网站亚洲| 欧美在线影院一区二区| 亚洲免费观看在线视频| av亚洲精华国产精华| 国产亚洲欧美日韩俺去了| 免费一级欧美片在线观看| 欧美日韩免费高清一区色橹橹| 玉米视频成人免费看| av在线这里只有精品| 国产精品久久久久久久久免费樱桃 | 久久久五月婷婷| 六月丁香综合在线视频| 日韩亚洲欧美在线| 免费精品视频在线| 欧美xxx久久| 国模一区二区三区白浆| 亚洲精品一区二区三区在线观看| 久久精品国产亚洲一区二区三区| 欧美一区二区三区四区视频| 亚洲成人动漫精品| 欧美一区二区三区四区久久| 久久精品国产99国产精品| 日韩午夜激情电影| 激情另类小说区图片区视频区| 欧美精品一区二区三区高清aⅴ| 老司机午夜精品99久久| 久久免费偷拍视频| 成人黄色大片在线观看| 自拍av一区二区三区| 欧美亚洲国产bt| 日本亚洲电影天堂| 日韩精品中文字幕一区| 丰满亚洲少妇av| 一区二区久久久久| 日韩一区二区三区视频| 国产精品亚洲人在线观看| 亚洲色图19p| 欧美一卡二卡三卡四卡| 国产寡妇亲子伦一区二区| 18涩涩午夜精品.www| 欧美日韩一区精品| 国产精品一线二线三线| 亚洲乱码国产乱码精品精小说| 欧美精品丝袜中出| 国产成人日日夜夜| 亚洲午夜久久久久久久久电影网 | 97精品国产97久久久久久久久久久久| 一区二区三区在线视频观看 | 欧美三级电影精品| 国产一区二区在线电影| 亚洲激情在线激情| 精品av综合导航| 色94色欧美sute亚洲线路一久| 日本aⅴ亚洲精品中文乱码| 日韩免费高清电影| 色狠狠综合天天综合综合| 青青草91视频| 国产精品麻豆久久久| 欧美一级生活片| 91色porny| 韩国精品主播一区二区在线观看 | 欧美国产1区2区| 欧美一区二区三区成人| 91一区一区三区| 国产精品亚洲视频| 奇米亚洲午夜久久精品| 亚洲午夜在线视频| 国产视频视频一区| 99国产精品久久久| 久久99国产精品麻豆| 亚洲美女视频在线| 欧美韩国日本一区| 日韩一区二区三区视频在线观看| 91国产丝袜在线播放| 成人午夜免费视频| 精品一区二区免费看| 亚洲国产精品久久不卡毛片| 国产精品不卡视频| 国产拍揄自揄精品视频麻豆| 日韩精品一区二区三区视频播放 | 亚洲激情图片小说视频| 国产精品久久久久久一区二区三区| 日韩一级完整毛片| 717成人午夜免费福利电影| 97久久超碰国产精品| aaa亚洲精品| 成人禁用看黄a在线| 大陆成人av片| 成人一区二区三区| 粉嫩嫩av羞羞动漫久久久| 国内精品伊人久久久久av一坑 | 精品欧美一区二区在线观看 | 久久精工是国产品牌吗| 日本特黄久久久高潮| 亚洲国产cao| 亚洲高清视频在线| 亚洲国产一区视频| 亚洲mv大片欧洲mv大片精品| 亚洲国产一区二区三区青草影视| 一区二区三区中文字幕精品精品| 亚洲精品中文在线观看| 一区二区三区蜜桃| 亚洲成人av一区二区三区| 亚洲午夜免费视频| 日本sm残虐另类| 国产在线一区观看| 成人在线视频一区二区| 91浏览器在线视频| 欧美亚洲愉拍一区二区| 91.com视频| 精品国产免费一区二区三区香蕉| 久久男人中文字幕资源站| 国产精品网站导航| 亚洲色图都市小说| 日韩av中文字幕一区二区| 蓝色福利精品导航| 成人性生交大片免费看中文 | 亚洲成人资源在线| 捆绑变态av一区二区三区| 国产电影一区二区三区| 91影院在线免费观看| 51精品国自产在线| 久久精品免费在线观看| 亚洲欧美激情在线| 美女一区二区三区在线观看| 成人一区二区三区在线观看| 欧美日韩精品一区二区三区| 欧美精品乱人伦久久久久久| 欧美精品一区二区精品网| 国产精品每日更新在线播放网址 | 日韩毛片高清在线播放| 日韩国产高清在线| 国产在线精品免费| 91黄色免费看| 精品成人免费观看| 亚洲最大色网站| 国产资源精品在线观看| 在线精品视频一区二区三四| 欧美电视剧在线观看完整版| 国产精品福利av| 蜜臀av在线播放一区二区三区| 不卡一区在线观看| 欧美精品第一页| 国产精品国产三级国产有无不卡 | 久久精品999| 欧洲精品一区二区| 久久影院电视剧免费观看| 亚洲精品免费在线| 国产精品一线二线三线| 777奇米成人网| 亚洲欧美日韩精品久久久久| 国模大尺度一区二区三区| 欧美精品1区2区3区| 中文字幕一区二区三区四区不卡 | 一区二区三区在线观看国产| 国内成人免费视频| 日韩一区二区免费高清| 亚洲国产精品久久久男人的天堂| 99久久99久久综合| 久久久久国产精品厨房| 美女任你摸久久 | 91在线免费播放| 国产拍揄自揄精品视频麻豆| 久久国产精品一区二区| 欧美日韩一区小说| 一区二区三区国产| 99re6这里只有精品视频在线观看| 欧美精品一区二区在线播放| 日韩精品乱码免费| 欧美日韩三级一区二区| 亚洲综合精品自拍| 99re成人精品视频| 亚洲三级在线看| 99国产精品视频免费观看| 日韩一区在线看| 99久久国产综合精品麻豆| **网站欧美大片在线观看| 丰满白嫩尤物一区二区| 国产精品视频yy9299一区| 国产丶欧美丶日本不卡视频| 中文字幕不卡在线| 成人av网站免费观看|