Related articles |
---|
A new implementation of BC: C-BC markh@csd4.csd.uwm.edu (1993-08-14) |
Implementation notes for C-BC available markh@csd4.csd.uwm.edu (1993-08-17) |
Newsgroups: | comp.compilers |
From: | markh@csd4.csd.uwm.edu (Mark) |
Keywords: | arithmetic, available, FTP |
Organization: | Computing Services Division, University of Wisconsin - Milwaukee |
Date: | Sat, 14 Aug 1993 13:33:02 GMT |
This is followup to an article posted last month on the implementation
of the BC language. The software package is soon to be released into the
public domain, by Sunday evening or sooner. You will find it at the
csd4.csd.uwm.edu archive at pub/compilers/cbc/*, and (given the room) also
packaged as the file pub/compilers/cbc.zip.
The standard BC language is a stack-based typeless calculator language
that works only with arbitrary precision numbers and one-dimensional
arrays of numbers and a very limited subset of C's syntax. The revised
language, which I call C-BC (formerly, I used the name GC) is a large
strongly typed superset of BC whose basic types include (among other
things) arbitrary precision numbers and complex numbers. Type building
operations allow you to define dynamic arrays of arbitrary dimension and
pointers (along with the ability to allocate and free dynamic arrays at
run-time). The method used to handle dynamic arrays throughout, I call
Lazy Allocation. It is basically nothing more than source-level caching.
The resulting language's syntax is made to resemble ANSI-C more, but is
still mostly compatible with POSIX-BC. The only exceptions have to do with
the strong typing system, and with slight differences with string handling,
somewhat analogous to the differences between ANSI-C and C. You should still
be able to run your BC programs with little or no change.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.