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/cn.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灯, 水草

请输入看板名称,例如:Tech_Job站内搜寻

TOP