Commit graph

154 commits

Author SHA1 Message Date
zik.saleeba b23d1e8e06 Big reorganisation to make it easier to access picoc as a library.
Also moved most internal header stuff to the new header interpreter.h.


git-svn-id: http://picoc.googlecode.com/svn/trunk@549 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-17 07:11:20 +00:00
zik.saleeba cab5e8b2d8 Added support for static type qualifiers.
git-svn-id: http://picoc.googlecode.com/svn/trunk@546 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-16 23:38:41 +00:00
zik.saleeba e6f78cff7e Moved the picoc version string into picoc.h so it can be referenced outside picoc.
git-svn-id: http://picoc.googlecode.com/svn/trunk@540 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-15 22:47:28 +00:00
zik.saleeba e44b198946 Added a new alignment system which should correspond to the struct alignments of most processors. This means that picoc struct members should match up with native C structs in most cases. I hope.
git-svn-id: http://picoc.googlecode.com/svn/trunk@532 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-15 04:25:09 +00:00
zik.saleeba e17f6f955f PICOC_VERSION is now defined as a macro in picoc
git-svn-id: http://picoc.googlecode.com/svn/trunk@528 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-14 23:42:54 +00:00
zik.saleeba 6dd3e69fa5 Fixes for Brian Schmalz for the surveyor platform.
git-svn-id: http://picoc.googlecode.com/svn/trunk@516 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-12 04:23:37 +00:00
zik.saleeba eb7010d292 Now avoiding structure assignment since it seems to cause problems on blackfin processors. Urk!
git-svn-id: http://picoc.googlecode.com/svn/trunk@515 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-12 04:04:51 +00:00
zik.saleeba 318db09eb7 Now recognising and ignoring "register" and "extern".
git-svn-id: http://picoc.googlecode.com/svn/trunk@508 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-11 05:13:58 +00:00
zik.saleeba 1301fe7a8f More intelligent allocation/deallocation of parser data. It should now be possible to report error messages from previously-parsed files.
git-svn-id: http://picoc.googlecode.com/svn/trunk@480 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-27 18:16:05 +00:00
zik.saleeba df9129b355 Calls to exit(n) now return the exit value n to the command line.
This fixes issue 100.


git-svn-id: http://picoc.googlecode.com/svn/trunk@478 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-27 15:35:25 +00:00
zik.saleeba 8e02f32095 Added the ability to select the stack size on UNIX platforms.
Fixes issue 92.


git-svn-id: http://picoc.googlecode.com/svn/trunk@477 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-27 14:03:06 +00:00
zik.saleeba 0ffbd21f2e When you're using a scripting mode - "-s", "-m" or "-i" - it now automatically includes all the system headers for you.
This fixes issue 101

git-svn-id: http://picoc.googlecode.com/svn/trunk@475 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-27 11:48:39 +00:00
zik.saleeba e45e455b9b Now handling multi-line string constants correctly.
Also handling either LF newlines or CR/LF newlines in multi-line string constants correctly.
Changed handling of multi-line comments to use the new, simpler Lexer->EmitExtraNewlines field.
Made FANCY_ERROR_REPORTING standard to reduce code obfuscation.
Fixed issue 98.


git-svn-id: http://picoc.googlecode.com/svn/trunk@473 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-27 10:35:54 +00:00
zik.saleeba 036f3efa8b Fixed a problem with variable declarations in inner blocks giving errors. bug#82.
git-svn-id: http://picoc.googlecode.com/svn/trunk@470 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-24 16:07:56 +00:00
zik.saleeba 3deb0908bb Now recognising and ignoring "static".
Recognising and ignoring 'L' following integer constants.
Tallying the line count in multi-line C-style comments more correctly.



git-svn-id: http://picoc.googlecode.com/svn/trunk@466 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-18 20:27:05 +00:00
zik.saleeba 6d20f4b02f Support for #if, #ifdef, #ifndef, #else and #endif added
git-svn-id: http://picoc.googlecode.com/svn/trunk@464 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-18 13:42:07 +00:00
zik.saleeba 145a99a7b1 Completed parameterised macros
git-svn-id: http://picoc.googlecode.com/svn/trunk@463 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-11 18:44:07 +00:00
zik.saleeba 7c754bad48 Can now parse parameterised macros. Can't evaluate them yet though.
git-svn-id: http://picoc.googlecode.com/svn/trunk@462 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-08 04:52:05 +00:00
zik.saleeba e977f325ae Now has the ability to use GNU readline for input editing
git-svn-id: http://picoc.googlecode.com/svn/trunk@461 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-05 19:53:34 +00:00
zik.saleeba ca35f78874 Added unistd.h interface module.
git-svn-id: http://picoc.googlecode.com/svn/trunk@456 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-03 21:07:47 +00:00
zik.saleeba ff7aadcc11 Fixed a little bit-rot in clibrary.c
git-svn-id: http://picoc.googlecode.com/svn/trunk@455 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-03 17:00:54 +00:00
zik.saleeba 7700f11893 Can now call with command line arguments.
git-svn-id: http://picoc.googlecode.com/svn/trunk@453 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-03 16:10:15 +00:00
zik.saleeba fcb9255ba9 Added stdbool.h module and removed old TRUE and FALSE defs which are not standard C
git-svn-id: http://picoc.googlecode.com/svn/trunk@451 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-03 14:26:04 +00:00
zik.saleeba 5efb924e6a Fixed a problem with declarations for libraries not being compatible with
some C90 compilers.


git-svn-id: http://picoc.googlecode.com/svn/trunk@449 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-01 19:48:04 +00:00
zik.saleeba b313de2aa1 Added ctype.h module
git-svn-id: http://picoc.googlecode.com/svn/trunk@448 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-29 20:25:34 +00:00
zik.saleeba 08b08595f4 Added new cstdlib errno.h module
git-svn-id: http://picoc.googlecode.com/svn/trunk@445 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-28 20:43:21 +00:00
zik.saleeba ff9960fc18 Added time.h module
git-svn-id: http://picoc.googlecode.com/svn/trunk@443 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-23 20:36:40 +00:00
zik.saleeba 985e6c960f Platform libraries now require explicit #includes
git-svn-id: http://picoc.googlecode.com/svn/trunk@440 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-13 20:47:17 +00:00
zik.saleeba 907f2b26d9 Changed "NativePointer" to "Pointer" for brevity
git-svn-id: http://picoc.googlecode.com/svn/trunk@437 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-13 14:41:03 +00:00
zik.saleeba 019731da60 String library completed
git-svn-id: http://picoc.googlecode.com/svn/trunk@435 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-13 14:17:29 +00:00
zik.saleeba 0afc055ab1 Initial version of a standard string library added.
Some regressions fixed.


git-svn-id: http://picoc.googlecode.com/svn/trunk@433 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-13 12:19:32 +00:00
zik.saleeba 36069a5a2f First version of standard math.h handling added
git-svn-id: http://picoc.googlecode.com/svn/trunk@429 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-13 11:05:24 +00:00
zik.saleeba 073769ab2e Now with added sprintf() wonderfulness
git-svn-id: http://picoc.googlecode.com/svn/trunk@425 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-11 20:47:03 +00:00
zik.saleeba 40e338b823 Added printf() and variants to stdio
git-svn-id: http://picoc.googlecode.com/svn/trunk@424 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-11 17:12:49 +00:00
zik.saleeba a591133f35 Added support for #include of predefined libraries.
Created a stdio.h predefined library.


git-svn-id: http://picoc.googlecode.com/svn/trunk@420 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-05 19:00:46 +00:00
zik.saleeba ea10e1a369 Added function prototypes as requested in issue #74
git-svn-id: http://picoc.googlecode.com/svn/trunk@410 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-03-01 20:39:08 +00:00
zik.saleeba 441f8b4073 Added example functions lineno() and errorprintf()
git-svn-id: http://picoc.googlecode.com/svn/trunk@405 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-02-03 20:01:01 +00:00
zik.saleeba fc348214c9 Stricter handling of semicolons at the end of statements.
git-svn-id: http://picoc.googlecode.com/svn/trunk@402 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-22 11:36:15 +00:00
zik.saleeba fcc6fd6846 Fixed printing of longs
git-svn-id: http://picoc.googlecode.com/svn/trunk@393 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-07 21:12:12 +00:00
zik.saleeba c3dcac1812 Added long and unsigned long data types
git-svn-id: http://picoc.googlecode.com/svn/trunk@392 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-07 21:05:15 +00:00
zik.saleeba b777be13be Fixed the HPPA floating point problem
git-svn-id: http://picoc.googlecode.com/svn/trunk@386 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-07 17:47:25 +00:00
zik.saleeba d2718f62c5 Removed unnecessary guff
git-svn-id: http://picoc.googlecode.com/svn/trunk@375 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-04 20:21:10 +00:00
zik.saleeba e75518e139 Changed the way that arrays are represented to a simpler one without
the extra level of indirection.
Fixed various array-related problems, including array assignment
which is issue #49.


git-svn-id: http://picoc.googlecode.com/svn/trunk@373 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-04 02:02:37 +00:00
zik.saleeba 2e07f89194 Possible fix for big-endian bug
git-svn-id: http://picoc.googlecode.com/svn/trunk@371 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-03 20:40:35 +00:00
zik.saleeba 274f21fdbc Removed "unsigned char" - now all chars are unsigned again.
git-svn-id: http://picoc.googlecode.com/svn/trunk@370 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-01 21:16:19 +00:00
zik.saleeba f1aeadb077 Removed redundant "struct ArrayValue"
git-svn-id: http://picoc.googlecode.com/svn/trunk@369 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-01 21:10:48 +00:00
zik.saleeba 18acb6dc1a Removed old pointer system. Now it's "native pointers" all the way.
git-svn-id: http://picoc.googlecode.com/svn/trunk@368 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-01 21:02:31 +00:00
zik.saleeba 24a601271a malloc() and free() implemented.
git-svn-id: http://picoc.googlecode.com/svn/trunk@346 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-25 20:50:56 +00:00
zik.saleeba c6d483ee6f Unsigned types now exist. They're probably not handled quite correctly in expressions yet though.
git-svn-id: http://picoc.googlecode.com/svn/trunk@345 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-25 11:54:34 +00:00
zik.saleeba 8c7434424d Native pointers no longer carry their size with them.
git-svn-id: http://picoc.googlecode.com/svn/trunk@344 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-23 19:01:32 +00:00