Yacc說(shuō)明及使用文檔
yacc(Yet Another Compiler Compiler),是Unix/Linux上一個(gè)用來(lái)生成編譯器的編譯器(編譯器代碼生成器)。yacc生成的編譯器主要是用C語(yǔ)言寫(xiě)成的語(yǔ)法解析器(Parser),需要與詞法解析器Lex一起使用,再把兩部份產(chǎn)生出來(lái)的C程序一併編譯。yacc本來(lái)只在Unix系統(tǒng)上才有,但現(xiàn)時(shí)已普遍移植往Windows及其他平臺(tái)。
一個(gè)基于GTK+的單詞數(shù)值計(jì)算器,1、 按照規(guī)則計(jì)算單詞的值,如果 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 26個(gè)字母(全部用大寫(xiě))的值分別為 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,如:
WINJACK這個(gè)單詞的值就為:W+I+N+J+A+C+K=23+9+14+1+3+11=71%
HARDWORK=H+A+R+D+W+O+R+D=8+1+18+4+23+15+18+11=98%
LOVE=L+O+V+E=12+15+22+5=54%
LUCK=L+U+C+K=12+21+3+11=47%
ATTITUDE= A+T+T+I+T+U+D+E=1+20+20+9+20+24+4+5=100%
2、對(duì)程序的界面布局參考如下圖所示,在第一個(gè)單行文本框輸入一個(gè)單詞,點(diǎn)擊“計(jì)算”按鈕,按照以上算法計(jì)算出該單詞的值。
3、如果在最下面的單行文本框輸入一個(gè)文件路徑,此文件每行記錄一個(gè)單詞,那么經(jīng)過(guò)程序計(jì)算出各個(gè)單詞的值,并把結(jié)果輸出到當(dāng)前目錄下result.txt文件中。如果文件不存在,應(yīng)該提示錯(cuò)誤。
漢諾塔?。?!
Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation
eg. if n = 2 A→B A→C B→C
if n = 3 A→C A→B C→B A→C B→A B→C A→C
在各種不同的網(wǎng)絡(luò)傳送協(xié)議上,為網(wǎng)絡(luò)編程提供一個(gè)大家都很熟悉的接口,需注意各種網(wǎng)絡(luò)協(xié)議的一些特征。本章將全面講述使用特定協(xié)議時(shí)應(yīng)該留意的一些特征,其中包括一些基本的網(wǎng)絡(luò)連接原理。另外,我們還將討論如何通過(guò)程序向 Wi n s o c k查詢協(xié)議信息,并探討針對(duì)一種具體協(xié)議創(chuàng)建套接字所需的基本步驟。
P3.20. Consider an analog signal xa (t) = sin (2πt), 0 ≤t≤ 1. It is sampled at Ts = 0.01, 0.05,
and 0.1 sec intervals to obtain x(n).
b) Reconstruct the analog signal ya (t) from the samples x(n) using the sinc interpolation
(use ∆ t = 0.001) and determine the frequency in ya (t) from your plot. (Ignore the end
effects.)
C) Reconstruct the analog signal ya (t) from the samples x (n) using the cubic spline
interpolation and determine the frequency in ya (t) from your plot. (Ignore the end effects.)