开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 1 Fork 0

子安/ooc

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
项目仓库所选许可证以仓库主分支所使用许可证为准
master
分支 (1)
master
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
贡献代码
同步代码
对比差异 通过 Pull Request 同步
同步更新到分支
通过 Pull Request 同步
将会在向当前分支创建一个 Pull
Request,合入后将完成同步
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Sources for "Object-Oriented Programming with ANSI-C" (rerelease
02-01-04 and 14-01-03)
Copyright (c) 1993 Axel T. Schreiner, University of Osnabrueck, Germany
contact ----------------------------------------------------------------
mail: Axel T. Schreiner, 36 Muirfield Ct, Pittsford NY 14534 USA
http://www.cs.rit.edu/~ats/, phone +1.585.264.0944
mailto: axel@schreiner-family.net
legalese ---------------------------------------------------------------
While you may use this software package, neither I nor my employers can
be made responsible for whatever problems you might cause or encounter.
While you may give away this package and/or software derived with
it, you should not charge for it, you should not claim that ooc is
your work, and I have published my own book about ooc before you did.
The same restrictions apply to whoever might get this package from you.
executive summary ------------------------------------------------------
ooc is a technique to do object-oriented programming (classes,
methods, dynamic linkage, simple inheritance, polymorphisms,
persistent objects, method existence testing, message forwarding,
exception handling, etc.) using ANSI-C.
ooc is a preprocessor to simplify the coding task by converting
class descriptions and method implementations into ANSI-C as required
by the technique. You implement the algorithms inside the methods
and the ooc preprocessor produces the boilerplate.
ooc consists of a shell script driving a modular awk script (with
provisions for debugging), a set of reports -- code generation
templates -- interpreted by the script, and the source of a root
class to provide basic functionality. Everything is designed to
be changed if desired. There are manual pages, lots of examples,
among them a calculator based on curses and X11, and you can ask
me about the book.
ooc as a technique requires an ANSI-C system -- classic C would
necessitate substantial changes. The preprocessor needs a healthy
Bourne-Shell and "new" awk as described in Aho, Weinberger, and
Kernighan's book.
ooc was developed primarily to teach about object-oriented programming
without having to learn a new language. If you see how it is done
in a familiar setting, it is much easier to grasp the concepts and
to know what miracles to expect from the technique and what not.
Conceivably, the preprocessor can be used for production programming
but this was not the original intent. Being able to roll your own
object-oriented coding techniques has its possibilities, however...
technical details ------------------------------------------------------
Most sources should be viewed with tab stops set at 4 characters.
The original system ran on NeXTSTEP 3.2 and older, ESIX (System
V) 4.0.4, and Linux 0.99.pl4-49. The first rerelease was tested on MacOS X
version 10.1.2 and Solaris version 5.8; the second one on MacOS X 10.9.1. You need to review paths in the
script 'ooc/ooc' before running anything. Make sure the first line
of this script points to a Bourne-style shell. Also make sure that
the first line of '09/munch' points to a (new) awk.
The rereleased 'ooc' awk-programs have been tested with GNU awk versions
3.0.1 and 3.0.3. Previous versions did not support AWKPATH properly
(but this is not essential).
The makefiles could be smarter but they are naive enough for all
systems. This is a heterogeneous system -- set the environment
variable $OSTYPE to an architecture-specific name. 'make' in the current
directory will create everything by calling 'make' in the various
subdirectories. Each 'makefile' includes 'make/Makefile.$OSTYPE', review
your 'make/Makefile.$OSTYPE' before you start.
The following make calls are supported throughout:
 make [all]	create examples
 make test	[make and] run examples
 make clean	remove all but sources
 make depend	make dependencies (if makefile.$OSTYPE supports it)
Make dependencies can be built with the -MM option of the GNU C
compiler. They are stored in a file 'depend' in each subdirectory. They
should apply to all systems. 'makefile.$OSTYPE' may include a target
'depend' to recreate 'depend' -- check 'makefile.darwin1.4' for an
example.
contents ---------------------------------------------------------------
The following is a walk through the file hierarchy in the order of
the book:
makefile	dispatch standard make calls to known directories
make/
 Makefile.*	boilerplate code for */makefile
*/ depend	make dependencies
 makefile	create and test
01/*		chapter 1: abstract data types
 sets	Set demo
 bags	Bag demo: Set with reference count
02/*		chapter 2: dynamic linkage
 strings	String demo
 atoms	Atom demo: unique String
03/*		chapter 3: manipulating expressions with dyn. linkage
 postfix	postfix output of expression
 value	expression evaluation
 infix	infix output of expression
04/*		chapter 4: inheritance
 points	Point demo
 circles	Circle demo: Circle: Point with radius
05/*		chapter 5: symbol table with inheritance
 value	expression evaluation with vars, consts, functions
06/*		chapter 6: class hierarchy and meta classes
 any		objects that do not differ from any object
ooc/*		ooc preprocessor
 ooc		command script; review 'home' 'OOCPATH' 'AWKPATH'
 awk/*.awk	modules
 awk/*.dbg	debugging modules
 rep/*.rep	reports
 rep-*/*.rep	reports for early chapters
man/ooc.1	manual page (for final version)
07/*		chapter 7: ooc preprocessor; use ooc -7
 points	Point demo: PointClass is a new metaclass
 circles	Circle demo: Circle is a new class
 queue	Queue demo: List is an abstract base class
 stack	Stack demo: another subclass of List
08/*		chapter 8: dynamic type checking; use ooc -8
 circles	Circle demo: nothing changed
 list	List demo: traps insertion of numbers or strings
09/*		chapter 9: automatic initialization; use ooc -9
 munch	awk program to collect class list from nm -p output
 circles	Circle demo: no more init calls
 list	List demo: no more init calls
man/munch.1	manual page
10/*		chapter 10: respondsTo method; use ooc -10
 cmd		Filter demo: how flags and options are handled
 wc		word count filter
 sort	sorting filter, adds sort method to List
11/*		chapter 11: class methods
 value	expression evaluator, based on class hierarchy
 value x	memory reclamation enabled
man/retrieve.2	manual page
c.12/*		chapter 12: persistent objects
 value	expression evaluator, with save and load
13/*		chapter 13: exception handling
 value	expression evaluator with exception handler
 except	Exception demo
14/*		chapter 14: message forwarding
 makefile.etc (naive) generated rules for the library
 Xapp	resources for X11-based programs
 hello	LineOut demo: hello, world
 button	Button demo
 run		terminal-oriented calculator
 cbutton	Crt demo: hello, world changes into a
 crun	curses-based caluclator
 xhello	XLineOut demo: hello, world
 xbutton	XButton demo with XawBox and XawForm
 xrun	X11-based calculator with callbacks
man/*		manual pages
 *.1		tools
 *.2		functions
 *.3		some classes
 *.4		classes in chapter 14
hp700 hp/ux ------------------------------------------------------------
c.07 Object.dc
extern ...
static ...
 draws a warning, but uses static.
c.08
 does not trap type checking
 use _SIGBUS rather than SIGBUS
c.12
 munch botched -- nm does not output static data symbols.
	it looks like we have to generate fake things with ooc or
	we have to produce classes.c on another architecture. GNU
	nm does not compile, it seems.
sunos 4 ----------------------------------------------------------------
must use gcc, not cc
parse.c
	strerror() does not exist -- replace call simply by "bad
	number" (could make it from sys_nerr, etc.). strtod() must
	be declared by including math.h.
new.r
 need to include stddef.h to define size_t.
mathlib.c
 strerror() does not exist.
binary.c
 memmove must be replaced by bcopy (arguments reversed).
Symbol.dc
 strerror() does not exist.
Object.dc/retrieve()
 stdlib.h declares char * bsearch(), rather than void *.
Object.dc/Object_geto()
 fprintf knows %p, but fscanf does not. use %x.
cbutton.c
 ex // comments...
Crt.dc
 does not have atexit().
va_copy ----------------------------------------------------------------
C99 subtly changed the semantics of <stdarg.h> and introduced va_copy:
at least for LLVM C and GNU C on MacOS X it is no longer legal to
assign to a va_list. The assignment must be replaced using va_copy and
the result must eventually be handed to va_end (see
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf>). The
sources have been conditionalized based on va_copy to account for this
difference.
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

Object-Oriented Programming With ANSI-C
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/andrewgithub/ooc.git
git@gitee.com:andrewgithub/ooc.git
andrewgithub
ooc
ooc
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /