Commit graph

120 commits

Author SHA1 Message Date
zik.saleeba 1d32e04c48 Fixed a problem with parsing array initialisers when not in RunModeRun.
git-svn-id: http://picoc.googlecode.com/svn/trunk@399 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-11 19:30:18 +00:00
zik.saleeba d09e156558 Fixes for Surveyor SRV-1 platform
git-svn-id: http://picoc.googlecode.com/svn/trunk@398 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-08 19:23:50 +00:00
zik.saleeba a648f2cf27 Array initialisers are now implemented - enhancement issue #42
git-svn-id: http://picoc.googlecode.com/svn/trunk@396 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-11-08 16:33:31 +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 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 c920ea1771 Problems with "return" fixed.
Issue #50


git-svn-id: http://picoc.googlecode.com/svn/trunk@365 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-31 17:08:21 +00:00
zik.saleeba 03cf6dcc90 Removed free()-like function of delete().
git-svn-id: http://picoc.googlecode.com/svn/trunk@361 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-31 14:17:45 +00:00
zik.saleeba ffd045f26f Fixed a bug with defining void pointers.
git-svn-id: http://picoc.googlecode.com/svn/trunk@347 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-25 20:54:14 +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 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 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 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 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 5dcde3d5ea Fix for a bug where variables which were initialised on declaration weren't writable.
git-svn-id: http://picoc.googlecode.com/svn/trunk@279 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-14 00:21:29 +00:00
zik.saleeba a76fc34881 By popular demand I'm adding support for native pointers. It's a work in progress - not working yet.
git-svn-id: http://picoc.googlecode.com/svn/trunk@277 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-06 00:25:09 +00:00
zik.saleeba 2e22614595 Final problems with the new expression system fixed
git-svn-id: http://picoc.googlecode.com/svn/trunk@248 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-04-15 10:47:51 +00:00
zik.saleeba 61174fb115 Interactive mode error handling fixed for surveyor.
All surveyor warnings fixed.


git-svn-id: http://picoc.googlecode.com/svn/trunk@216 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-04-04 03:11:12 +00:00
zik.saleeba 1ab28fcfb7 Took a first stab at implementing new/delete. Needs a bit more thought on how to handle dangling references to deallocated storage.
git-svn-id: http://picoc.googlecode.com/svn/trunk@211 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-16 04:25:58 +00:00
zik.saleeba eff849ad28 Fixed a problem with function definition parsing which was causing
prompt2 to be displayed in error.


git-svn-id: http://picoc.googlecode.com/svn/trunk@207 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-15 10:52:48 +00:00
zik.saleeba ce80c66e8f Added new "delete" keyword, used for undefining variables or functions
in interactive mode.


git-svn-id: http://picoc.googlecode.com/svn/trunk@206 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-15 10:44:56 +00:00
zik.saleeba 436b0cafc0 Conditional support for #include for surveyor
git-svn-id: http://picoc.googlecode.com/svn/trunk@202 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-12 20:44:50 +00:00
zik.saleeba 48a6472c68 All allocations are now cleaned up neatly on exit. This is probably unnecessary given that we run our own heap but gives confidence that there are no internal memory leaks.
git-svn-id: http://picoc.googlecode.com/svn/trunk@199 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-11 23:49:10 +00:00
zik.saleeba 6a586cee75 Fixed bug in enum declaration requiring a variable name
git-svn-id: http://picoc.googlecode.com/svn/trunk@187 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-10 08:03:10 +00:00
zik.saleeba 9769bd432b Fixed problem with 'return' parsing which was causing the factorial example to fail
git-svn-id: http://picoc.googlecode.com/svn/trunk@185 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-10 02:18:17 +00:00
zik.saleeba 8d76edfe4b #include now works
git-svn-id: http://picoc.googlecode.com/svn/trunk@182 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-10 01:01:57 +00:00
zik.saleeba 23bce9d38a enums implemented
git-svn-id: http://picoc.googlecode.com/svn/trunk@180 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-09 22:36:01 +00:00
zik.saleeba b9990d2c39 Functions returning void fixed
git-svn-id: http://picoc.googlecode.com/svn/trunk@176 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-09 00:43:31 +00:00
zik.saleeba 1b312544d9 'else' fixed, along with semicolon handling
git-svn-id: http://picoc.googlecode.com/svn/trunk@175 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-09 00:34:32 +00:00
zik.saleeba 1169e6f909 Prompt changes
git-svn-id: http://picoc.googlecode.com/svn/trunk@172 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-08 23:03:59 +00:00
zik.saleeba dc04ba8dd0 Split parsing across two files parse.c and the new expression.c
git-svn-id: http://picoc.googlecode.com/svn/trunk@170 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-08 07:56:28 +00:00
zik.saleeba 46c4bad533 Interactive mode now works.
git-svn-id: http://picoc.googlecode.com/svn/trunk@167 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-08 04:26:28 +00:00
zik.saleeba 05d377e49d First stab at interactive mode needs debug.
git-svn-id: http://picoc.googlecode.com/svn/trunk@164 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-07 11:23:42 +00:00
zik.saleeba f5fac3fdf2 First stab at making lists of tokens from interactive input. Not ready yet.
git-svn-id: http://picoc.googlecode.com/svn/trunk@162 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-07 07:49:17 +00:00
zik.saleeba 8a5ed05fd2 Now copying function tokens so when we're in interactive mode we can free the original tokens without
losing the box and dice.


git-svn-id: http://picoc.googlecode.com/svn/trunk@161 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-07 06:17:11 +00:00
zik.saleeba 86bb48b158 #define now works for simple unparameterised expression macros
git-svn-id: http://picoc.googlecode.com/svn/trunk@159 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-06 07:27:45 +00:00
zik.saleeba 3bdbb51d5c Now allowing multiple declarations in one statement
git-svn-id: http://picoc.googlecode.com/svn/trunk@157 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-06 06:00:51 +00:00
zik.saleeba 8b410241ee Declarations can now assign an initial value
git-svn-id: http://picoc.googlecode.com/svn/trunk@156 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-06 04:55:11 +00:00
zik.saleeba d137fdcbeb More expression parser tinkering
git-svn-id: http://picoc.googlecode.com/svn/trunk@154 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-05 04:05:15 +00:00
zik.saleeba 8020a9ca57 Expression fiddling
git-svn-id: http://picoc.googlecode.com/svn/trunk@151 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-04 10:09:56 +00:00