Commit graph

148 commits

Author SHA1 Message Date
zik.saleeba 3d7eaa7da6 Added "goto" statement.
git-svn-id: http://picoc.googlecode.com/svn/trunk@560 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-21 04:44:16 +00:00
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 88cf377659 Changes for a clean compile on the SRV
git-svn-id: http://picoc.googlecode.com/svn/trunk@537 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-15 21:06:47 +00:00
zik.saleeba de95adb36a Fixed a bug where function prototypes were not being deallocated
correctly when they were overridden by the actual function.



git-svn-id: http://picoc.googlecode.com/svn/trunk@529 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-15 01:21:27 +00:00
zik.saleeba b2c4d6ce83 Fixed bug108 - brackets were not collapsing the expression stack
as they should have.
Now more permissive in declarations of void main()


git-svn-id: http://picoc.googlecode.com/svn/trunk@520 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-14 06:05:53 +00:00
zik.saleeba 19b22261d3 Now checks for correct parameters to main()
git-svn-id: http://picoc.googlecode.com/svn/trunk@517 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-12 04:52:45 +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 4da8196e9d Fixed a problem with do..while() and breack/continue.
git-svn-id: http://picoc.googlecode.com/svn/trunk@510 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-11 06:32:52 +00:00
zik.saleeba b4f882354d Fixed a problem with nested while() loops not handling break and continue correctly.
Fixes issue #96.


git-svn-id: http://picoc.googlecode.com/svn/trunk@509 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-11 06:27:54 +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 e236537ab2 Fixed problem with returns inside switch() statements not working correctly outside the switch block.
Issue #116


git-svn-id: http://picoc.googlecode.com/svn/trunk@506 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-11 04:49:44 +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 c0a21f5c37 Fixed for loops of the form:
for (;;)

Fixes issue 93


git-svn-id: http://picoc.googlecode.com/svn/trunk@474 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-27 11:34:24 +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 809cdf5b94 Fixed issue with void parameters not being ignored
git-svn-id: http://picoc.googlecode.com/svn/trunk@465 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-07-18 17:01:00 +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 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 a21f1d8a70 Implemented typedef
git-svn-id: http://picoc.googlecode.com/svn/trunk@421 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-06-06 17:03:15 +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 f596c5aea4 Fixed pre-decrement and pre-increment
git-svn-id: http://picoc.googlecode.com/svn/trunk@408 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-02-28 13:52:11 +00:00
zik.saleeba 57ce5fd4c6 Fixed a problem with accidentally running the first case in a switch when
running in skip mode.
Bug report #71


git-svn-id: http://picoc.googlecode.com/svn/trunk@407 21eae674-98b7-11dd-bd71-f92a316d2d60
2010-02-25 21:25:05 +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 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