|
| 1 | +picoc |
| 2 | +----- |
| 3 | + |
| 4 | +PicoC is a very small C interpreter for scripting. It was originally written |
| 5 | +as a script language for a UAV's on-board flight system. It's also very |
| 6 | +suitable for other robotic, embedded and non-embedded applications. |
| 7 | + |
| 8 | +The core C source code is around 3500 lines of code. It's not intended to be |
| 9 | +a complete implementation of ISO C but it has all the essentials. When |
| 10 | +compiled it only takes a few k of code space and is also very sparing of |
| 11 | +data space. This means it can work well in small embedded devices. It's also |
| 12 | +a fun example of how to create a very small language implementation while |
| 13 | +still keeping the code readable. |
| 14 | + |
| 15 | +picoc is now feature frozen. Since it's important that it remain small it's |
| 16 | +intended that no more major features will be added from now on. It's been |
| 17 | +tested on x86-32, x86-64, powerpc, arm, ultrasparc, HP-PA and blackfin |
| 18 | +processors and is easy to port to new targets. |
| 19 | + |
| 20 | + |
| 21 | +Compiling picoc |
| 22 | +--------------- |
| 23 | + |
| 24 | +picoc can be compiled for a UNIX/Linux/POSIX host by typing "make". |
| 25 | + |
| 26 | +The test suite can be run by typing "make test". |
| 27 | + |
| 28 | + |
| 29 | +Porting picoc |
| 30 | +------------- |
| 31 | + |
| 32 | +platform.h is where you select your platform type and specify the includes |
| 33 | +etc. for your platform. |
| 34 | + |
| 35 | +platform_XXX.c contains support functions so the compiler can work on |
| 36 | +your platform, such as how to write characters to the console etc.. |
| 37 | + |
| 38 | +platform_library.c contains your library of functions you want to make |
| 39 | +available to user programs. |
| 40 | + |
| 41 | +There's also a clibrary.c which contains user library functions like |
| 42 | +printf() which are platform-independent. |
| 43 | + |
| 44 | +Porting the system will involve setting up suitable includes and defines |
| 45 | +in platform.h, writing some I/O routines in platform_XXX.c, putting |
| 46 | +whatever user functions you want in platform_library.c and then changing |
| 47 | +the main program in picoc.c to whatever you need to do to get programs |
| 48 | +into the system. |
| 49 | + |
| 50 | +platform.h is set to UNIX_HOST by default so tests can be easily run on |
| 51 | +a UNIX system. You'll need to specify your own host setup dependent on |
| 52 | +your target platform. |
| 53 | + |
| 54 | + |
| 55 | +Copyright |
| 56 | +--------- |
| 57 | + |
| 58 | +picoc is published under the "New BSD License". |
| 59 | +http://www.opensource.org/licenses/bsd-license.php |
| 60 | + |
| 61 | + |
| 62 | +Copyright (c) 2009-2011, Zik Saleeba |
| 63 | +All rights reserved. |
| 64 | + |
| 65 | +Redistribution and use in source and binary forms, with or without |
| 66 | +modification, are permitted provided that the following conditions are |
| 67 | +met: |
| 68 | + |
| 69 | + * Redistributions of source code must retain the above copyright |
| 70 | + notice, this list of conditions and the following disclaimer. |
| 71 | + |
| 72 | + * Redistributions in binary form must reproduce the above copyright |
| 73 | + notice, this list of conditions and the following disclaimer in |
| 74 | + the documentation and/or other materials provided with the |
| 75 | + distribution. |
| 76 | + |
| 77 | + * Neither the name of the Zik Saleeba nor the names of its |
| 78 | + contributors may be used to endorse or promote products derived |
| 79 | + from this software without specific prior written permission. |
| 80 | + |
| 81 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 82 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 83 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 84 | +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 85 | +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 86 | +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 87 | +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 88 | +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 89 | +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 90 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 91 | +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0 commit comments