Commit graph

142 commits

Author SHA1 Message Date
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
zik.saleeba d5811d37d5 printf() now supports field widths, zero-padding and left/right justification.
git-svn-id: http://picoc.googlecode.com/svn/trunk@342 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-22 20:08:43 +00:00
zik.saleeba 196331d6ba 'short' data type added
git-svn-id: http://picoc.googlecode.com/svn/trunk@340 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-11 11:09:07 +00:00
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 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 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 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 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