Commit graph

525 commits

Author SHA1 Message Date
zik.saleeba 8e735ef68f First cut of casts completed but not debugged
git-svn-id: http://picoc.googlecode.com/svn/trunk@338 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-10 17:59:55 +00:00
zik.saleeba 7d135bbdd5 Doing some work on casts and sizeof
git-svn-id: http://picoc.googlecode.com/svn/trunk@337 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-10 14:49:49 +00:00
zik.saleeba fcab11f844 Made both Val and Op co-exist in the ExpressionStack.
Some preliminary work for casts.


git-svn-id: http://picoc.googlecode.com/svn/trunk@336 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-04 16:22:19 +00:00
zik.saleeba 5785884764 Removed soft floating point library. Decided not to do this after all.
git-svn-id: http://picoc.googlecode.com/svn/trunk@335 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-04 14:53:31 +00:00
zik.saleeba a739b40b2c Fixed quicksort test
Fixed math library test


git-svn-id: http://picoc.googlecode.com/svn/trunk@334 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-17 10:39:32 +00:00
zik.saleeba 902aac9a94 Added support for '%x', '%u' and '%b' in printf formatting
git-svn-id: http://picoc.googlecode.com/svn/trunk@333 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-15 15:08:05 +00:00
zik.saleeba 93713ed830 Removed asinh(), acosh(), atanh() as unnecessary.
Added exit().

git-svn-id: http://picoc.googlecode.com/svn/trunk@332 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-15 14:33:21 +00:00
zik.saleeba 32727cc365 Native pointers feature added
git-svn-id: http://picoc.googlecode.com/svn/trunk@331 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-05 00:55:54 +00:00
zik.saleeba 3a1e39f9d3 New fancy error reporting feature makes nice error messages
git-svn-id: http://picoc.googlecode.com/svn/trunk@330 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-04 07:41:06 +00:00
zik.saleeba 2a69c48777 Fixed a bug in parsing "while ()" and "do..while()". I tried to be too clever. Bad idea.
git-svn-id: http://picoc.googlecode.com/svn/trunk@329 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-04 00:18:28 +00:00
zik.saleeba 390ff153a1 printf() now handles various formats of strings
git-svn-id: http://picoc.googlecode.com/svn/trunk@328 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-03 08:40:30 +00:00
zik.saleeba d432ebf74a Fixed a problem with returning void.
Updated quicksort test to be a real working test.


git-svn-id: http://picoc.googlecode.com/svn/trunk@327 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-03 05:24:41 +00:00
zik.saleeba b55ab05d48 Added support for octal and hex character constants
git-svn-id: http://picoc.googlecode.com/svn/trunk@326 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-03 02:57:23 +00:00
zik.saleeba 637e224fff Now parses but ignores signed/unsigned declarations
git-svn-id: http://picoc.googlecode.com/svn/trunk@325 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-03 02:31:43 +00:00
zik.saleeba 44eb3d3def Now handles "4 = b;" correctly (ie. with an error message)
Also fixed a problem with prompting again for more input on EOF.


git-svn-id: http://picoc.googlecode.com/svn/trunk@324 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-03 02:15:25 +00:00
zik.saleeba d38b4fa617 Added nicer error reports to parameter assignment
git-svn-id: http://picoc.googlecode.com/svn/trunk@323 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-03 00:26:14 +00:00
zik.saleeba 6f00c2a853 Added a check for rubbish after parameters in a function defintion.
git-svn-id: http://picoc.googlecode.com/svn/trunk@322 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 08:23:59 +00:00
zik.saleeba eb6f323f06 HeapAlloc() changed to HeapAllocMem() to avoid clash with win32 namespace.
git-svn-id: http://picoc.googlecode.com/svn/trunk@321 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 08:00:02 +00:00
zik.saleeba bb0d19a733 Now conforms fully to the ISO C90 standard
git-svn-id: http://picoc.googlecode.com/svn/trunk@320 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 07:50:46 +00:00
zik.saleeba 43cf4f5c9f Permitting parsing of expressions which start with an asterisk prefix operator.
git-svn-id: http://picoc.googlecode.com/svn/trunk@319 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 07:10:35 +00:00
zik.saleeba a4889edcf1 Fixes in handling void values.
Making quicksort test more real.
Better error reporting for invalid parameters.



git-svn-id: http://picoc.googlecode.com/svn/trunk@318 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 07:01:43 +00:00
zik.saleeba 9f9728dab5 Made it so a null character causes EOF. This shouldn't really be necessary but maybe it makes it easier for some implementations.
git-svn-id: http://picoc.googlecode.com/svn/trunk@317 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 06:40:47 +00:00
zik.saleeba 2f8f365d46 "int a = *'" now reports an error
git-svn-id: http://picoc.googlecode.com/svn/trunk@316 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 06:30:14 +00:00
zik.saleeba f4b2bdcc64 Fixed a bug which was causing declarations in functions to run even when just scanning.
git-svn-id: http://picoc.googlecode.com/svn/trunk@315 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 06:07:59 +00:00
zik.saleeba 825c393240 Reworking of how assignment works. Now all places which do assignment of values
should work the same.


git-svn-id: http://picoc.googlecode.com/svn/trunk@314 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 05:51:51 +00:00
zik.saleeba d2da61b81d Added a quicksort test case
git-svn-id: http://picoc.googlecode.com/svn/trunk@311 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 03:24:36 +00:00
zik.saleeba 5f0960d161 Added tests for new math library
git-svn-id: http://picoc.googlecode.com/svn/trunk@310 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 01:01:07 +00:00
zik.saleeba 280458a7c6 Made Makefile consistent with options
git-svn-id: http://picoc.googlecode.com/svn/trunk@309 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:51:48 +00:00
zik.saleeba 022e09a7a6 Fixed a bug which was causing decimal constants less than zero to be interpreted as octal
git-svn-id: http://picoc.googlecode.com/svn/trunk@308 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:40:45 +00:00
zik.saleeba c1381adae5 Fixed missing references to fdlibm functions.
git-svn-id: http://picoc.googlecode.com/svn/trunk@307 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:32:40 +00:00
zik.saleeba 4bc228c439 Fixed bogus references to native math library
git-svn-id: http://picoc.googlecode.com/svn/trunk@306 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:21:58 +00:00
zik.saleeba ece89990de Removed old, verbose fdlibm with many files
git-svn-id: http://picoc.googlecode.com/svn/trunk@305 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:14:26 +00:00
zik.saleeba a38afda0ab Limited decimal printing to sane precision.
Made C library able to access new math library.
UNIX compile defaults to using new math library.
Changed name of new math library to math.library.c
Added defines for new math library.
Renamed new soft floating point library to softfloat_library.c

git-svn-id: http://picoc.googlecode.com/svn/trunk@304 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:12:12 +00:00
zik.saleeba 11e56d378c Added some extra math library functions.
The beginnings of support for soft float and math library. Not working yet.


git-svn-id: http://picoc.googlecode.com/svn/trunk@303 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-28 08:22:24 +00:00
zik.saleeba ef5d729bd8 Added software floating point library. Not integrated yet.
git-svn-id: http://picoc.googlecode.com/svn/trunk@302 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-28 03:22:16 +00:00
zik.saleeba a99af94f38 Added a math library for architectures with none. Not integrated yet.
git-svn-id: http://picoc.googlecode.com/svn/trunk@301 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-28 02:54:23 +00:00
zik.saleeba ec303bd4bc Fixed a mistake in the test case
git-svn-id: http://picoc.googlecode.com/svn/trunk@299 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-28 00:18:52 +00:00
zik.saleeba d1d1b7e84e Fixed a problem with type coercion on parameter passing.
Added a handy feature for better-than-C type coercion in printf().
Added a regression test for all sorts of type coercion.

git-svn-id: http://picoc.googlecode.com/svn/trunk@298 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 23:54:22 +00:00
zik.saleeba 4668c0a80e Fixed a bug which caused a hang when a comma was omitted in a parameter list, followed by an identifier.
git-svn-id: http://picoc.googlecode.com/svn/trunk@297 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 05:59:44 +00:00
zik.saleeba 8b2fd2c56a Added tests for FP type coercion
git-svn-id: http://picoc.googlecode.com/svn/trunk@296 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 05:06:36 +00:00
zik.saleeba 4949ad046a Added type coercion to floating point from numeric types in parameters.
git-svn-id: http://picoc.googlecode.com/svn/trunk@295 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 05:03:48 +00:00
zik.saleeba 83d6b9a6d3 Added a new math library.
Fixed printing of floating point 0.0.


git-svn-id: http://picoc.googlecode.com/svn/trunk@294 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 04:55:44 +00:00
zik.saleeba 2cb35ef26a Fixed a problem with floating point prefix expressions.
Added a regression test for floating point.

git-svn-id: http://picoc.googlecode.com/svn/trunk@293 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 04:01:52 +00:00
zik.saleeba 8092d67c70 Fixed a problem with printing negative floating point numbers
git-svn-id: http://picoc.googlecode.com/svn/trunk@292 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 03:43:37 +00:00
zik.saleeba da2cd4805d Fixed an annoying bug which looked like a floating point issue but was in fact a string lexer issue.
git-svn-id: http://picoc.googlecode.com/svn/trunk@291 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 03:23:41 +00:00
zik.saleeba 77c4b6e71b Floating point evaluation implicit casting fixes.
Fixed a problem on UNIX where the program usage message couldn't be printed due to the platform output system not being initialised by that point in execution.

git-svn-id: http://picoc.googlecode.com/svn/trunk@290 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 03:02:30 +00:00
zik.saleeba 6015fc5694 Fixed return of floating point tokens
git-svn-id: http://picoc.googlecode.com/svn/trunk@289 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 00:06:09 +00:00
zik.saleeba 6c8d9ba4cb Fixed a floating point type error bug.
Re-ordered handling of infix floating point operators to handle them before integer coercion.

git-svn-id: http://picoc.googlecode.com/svn/trunk@288 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 00:05:31 +00:00
zik.saleeba eac072593c Nicer formatting of '.0'
git-svn-id: http://picoc.googlecode.com/svn/trunk@287 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-26 23:23:39 +00:00
zik.saleeba 758955fc11 A slightly better fix for the FP printing problem
git-svn-id: http://picoc.googlecode.com/svn/trunk@286 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-26 22:42:38 +00:00