Programming 板


LINE

ici 4.x 完全符合你的規格。 parse.c: 不用 yacc/bison: http://ici.cvs.sourceforge.net/viewvc/ici/ici/parse.c\ ?revision=1.51&content-type=text%2Fplain object.c http://ici.cvs.sourceforge.net/viewvc/ici/ici/object.c\ ?revision=1.43&content-type=text%2Fplain https://sourceforge.net/projects/ici/ https://en.wikipedia.org/wiki/ICI_(programming_language) http://ici.sourceforge.net/faq.html http://atrn.org/ici/ What is ICI? ICI is a C-like, high level language originally developed by Tim Long and placed into the public domain. ICI marries C's expression syntax, control structures and overall feel , with a dynamic, garbage collected, object-based, data model. Although ICI superficially resembles C, and is easy to use for C programmers, its data model is very different, higher level with types such as (real) strings, regular expressions, dynamic arrays, sets and dictionaries (struct). ICI's aggregate types are immediately useful without any extra programming typically required in C. ICI's automatic module loading, memory management and error handling frees the programmer from much of the drudgery associated with developing in C and lets you concentrate on what the program is doing rather than how it is doing it. With programs that are not overly performance critical or are I/O bound ICI makes a useful alternative to compiled languages. Even for performance critical applications the use of native-code modules in the correct areas is typically all that is required to allow development in a higher level language. 作者: 我 看板: 我的公開個版(SayYA 資訊站,已倒站?) 標題: [ici] ICI 簡介 時間: Sun Jul 14 07:01:53 2002 ICI 簡介. ICI source code is in public domain. Homepage: http://www.zeta.org.au/~atrn/ici/ Files: http://www.zeta.org.au/~atrn/ici/distfiles/ici-3.0.1.tar.bz2 http://www.zeta.org.au/~atrn/ici/distfiles/ici-modules-0.2.0.tar.bz2 ICI Main FTP Site: (ici2) ftp://ftp.research.canon.com.au/pub/misc/ici/ ICI Mail List: Send mail to "[email protected]" With the text "subscribe" in the body of the message. http://www.escribe.com/software/ici/index.html Freebsd ports: (ici3, 3.0.1) su - cd /usr/ports/lang/ici make install CVS: (ici4) cvs -d:pserver:[email protected]:/cvsroot/ici login cvs -d:pserver:[email protected]:/cvsroot/ici co ici cvs -d:pserver:[email protected]:/cvsroot/ici co ici-modules Related work: CINT http://root.cern.ch/root/Cint.html Python http://www.python.org EiC http://www.kd-dev.com/~eic (Artistic License) elastiC http://www.elasticworld.org ici-3.0.1 的安裝 makefile 似乎有點問題. cp *core*.ici /usr/local/lib/ici/ ln -s /usr/local/lib/ici /usr/local/lib/ici3 ln -s /usr/local/include/ici /usr/local/include/ici3 cvs 中的版本要手動將 Makefile.linux 中的 ici3 改成 ici4, 移除 wrap, skt. ICI 使用起來較順手. (如果熟練 C 的話.) 而且內含 PCRE (Perl-compatible regular expressions) library. 與 perl 主要的語法不同是 perl: /regexp/ ici: #regexp# 標題: [ici] perl01.ici 時間: Fri Oct 31 21:30:39 2003 // [ici] perl01.ici /* perlreftut (p3 of 16) 如何表述一個值為串列的雜湊,是 Perl 4 中常出現的一個問題。 當然,Perl 4 有雜湊,但值需為純量﹔不能是串列。 為什麼你會需要一個串列的雜湊? 讓我們看看一個例子: 你有一個城市和國家 名稱的檔案,像這樣: Chicago, USA Frankfurt, Germany Berlin, Germany Washington, USA Helsinki, Finland New York, USA 而你希望產生一個如下的輸出,每個國家印一次,然後是這個國家中照字母順序 排列的城市清單: Finland: Helsinki. Germany: Berlin, Frankfurt. USA: Chicago, New York, Washington. 這是早先我所提出的問題的答案,關於如何重新編排一個國家和城市名稱的檔案 。 1 while (<>) { 2 chomp; 3 my ($city, $country) = split /, /; 4 push @{$table{$country}}, $city; 5 } 6 7 foreach $country (sort keys %table) { 8 print "$country: "; 9 my @cities = @{$table{$country}}; 10 print join ', ', sort @cities; 11 print ".\n"; 12 } */ // join() from ici 3.x icipath.ici extern join(head, sep) { auto vargs = [array]; auto comp; if (typeof(head) == "array") { vargs = interval(head, 1); head = head[0]; } forall (comp in vargs) head = sprintf("%s%s%s", head, sep, comp); return head; } table = struct(); while(s = getline(stdin)) { // tmp = s ~~~ #(.*), (.*)#; // Using PCRE library. tmp = gettokens(s, ","); city = tmp[0]; country = tmp[1]; if (table[country]) { push(table[country], city); } else { table[country] = array(city); } } // perl01.ici, 56: argument 1 of sort() incorrectly supplied as a struct // forall(value, key in sort(table)) { forall(value, key in table) { printf("%s: ", key); cities = sort(value); // printf("%s", str.join(cities, ", ")); // ici 4.x with str module. printf("%s", join(cities, ", ")); printf(".\n"); } /* ici perl01.ici // ici 4.x with str module. Chicago, USA Frankfurt, Germany Berlin, Germany Washington, USA Helsinki, Finland New York, USA (Ctrl-D) Segmentation fault */ /* ici perl01.ici Chicago, USA Frankfurt, Germany Berlin, Germany Washington, USA Helsinki, Finland New York, USA (Ctrl-D) Germany: Berlin, Frankfurt. USA: Chicago, New York, Washington. Finland: Helsinki. */ ※ 引述《Neisseria (Neisseria)》之銘言: : 小弟先前沒事寫一個計算機 : 目前寫了 lexer, parser, interpreter : 有自製的 AST (abstract syntax tree) : 為了練功,這些功能沒依賴 yacc 或其他外部套件 : 有以下功能: : - 可處理整數和浮點數 : - 有變數的概念,可 chained assignemnt : - 簡易代數運算,像 (123 + 45)**(5 % 3) : - 常見數學公式,像指對數、三角函數等 : (直接 call host language 的相關功能) : 卡在函數 (function) 和物件 (class) 不知道如何表示 : 希望板上各位大大提示一些方向 : 目前先以 interpreter 為目標 : 因 compiler 還牽涉到轉機械碼的過程 : 目前對小弟來說太硬了 : 先在這裡謝過各位大大 -- https://youtu.be/MMWBPklrRB4 小雞逼逼(崩潰版)
https://youtu.be/KlZL1hqGxDg 《江南夜色》
https://youtu.be/WIW16vMdrZU 《告白氣球》
--



※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.163.17.145
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Programming/M.1493055404.A.3AA.html
1F:推 Neisseria: 感謝大大提供資訊,可以好好讀一下 175.180.97.241 04/25 06:22
2F:→ Neisseria: ICI 的程式碼來學習程式語言 175.180.97.241 04/25 06:23







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:Boy-Girl站內搜尋

TOP