Commit graph

190 commits

Author SHA1 Message Date
Russell Joyce 97030639f1
Fixed for loop initialisers with variable declarations 2020-06-18 19:18:14 +01:00
Russell Joyce 9d2327b8be
Added support for commas in for loop initialiser statement 2020-06-18 18:41:27 +01:00
Russell Joyce 3979f563aa
Added support for commas in for loop update statement 2020-06-18 17:05:10 +01:00
Russell Joyce d04337125e
Added support for extern variable declarations
Effectively just ignores any declarations as global scope is shared
across files in PicoC anyway, so the ultimate definition should be
enough.
2020-06-17 19:57:10 +01:00
Russell Joyce 62969cb0ee
Added handling of 'const' type qualifier keyword
There is currently no enforcement of a variable being constant, and the
actual type is the same as if 'const' wasn't present.
2020-06-11 11:30:51 +01:00
Russell Joyce 9abf00e2d3
Added basic pragma parsing
Actual contents of the pragma are currently just discarded. This
supports both #pragma and _Pragma() definitions, but the pragma must end
the line it is on and cannot be in the middle of a statement.
2020-06-09 19:21:00 +01:00
Russell Joyce 45d85111f0
Added parsing of volatile qualifier
This doesn't affect code execution, but is exposed through TypeParse().
2020-06-09 12:30:47 +01:00
Russell Joyce 409f520b61
Added functions to log and count parsing of statements and expressions
Currently prints all expressions and statements to stderr, then outputs
a total count of each token to stderr after program execution.
2020-05-13 18:44:09 +01:00
Joseph Poirier e8a2a13595
fix parsing typedef usage outside of the actual declaration, don't decrement loop counter 2018-01-16 16:12:07 -06:00
Joseph Poirier f551e28a49 formatting 2015-06-21 20:54:56 -05:00
Joseph Poirier 9316233d16 formatting, initial multiline macro support 2015-06-19 04:45:51 -05:00
Joseph Poirier 9c05060820 initialize 2015-06-18 22:49:47 -05:00
Joseph Poirier 97fbbaaf8f system includes before user includes, and cleanup 2015-06-17 16:34:26 -05:00
Joseph Poirier 0ac0f71fc0 proper static prototypes 2015-06-17 04:30:27 -05:00
Joseph Poirier 1ff1ef9cfb minor formatting, add message on how to terminate interactive mode 2015-06-14 15:48:18 -05:00
Joseph Poirier 890694a14a formatting 2015-06-14 04:46:15 -05:00
Joseph Poirier 463f086a33 changes after simple analysis, added FIXMEs 2015-06-14 02:08:10 -05:00
Joseph Poirier 9636ca0b2a minor format changes 2015-06-13 19:06:23 -05:00
Joseph Poirier d865074892 malloc deref pointer to struct syntax, minor formatting changes 2015-06-13 09:41:41 -05:00
Joseph Poirier 8c18e1d061 respect 80 col mark when it makes sense 2015-06-10 19:27:30 -05:00
Joseph Poirier e52188dcda respect 80 col mark when it makes sense 2015-06-10 18:49:09 -05:00
Joseph Poirier 9293ed0443 use stdbool.h and convert TRUE/FALSE to true/false 2015-06-10 14:24:53 -05:00
Joseph Poirier ff49007571 removed FEATURE_AUTO_DECLARE_VARIABLES 2015-06-10 13:54:32 -05:00
Joseph Poirier c063462464 reorder types 2015-06-10 13:07:58 -05:00
Joseph Poirier f26b78f29f PRINT_SOURCE_POS macro refactors 2015-06-10 12:33:16 -05:00
Joseph Poirier c504c52cd1 misc formatting, more descriptive out of mem erros, increase default stack size 2015-06-09 02:45:00 -05:00
Joseph Poirier a755ebfbe6 proper debug func prototypes, remove DEBUGGER compile switch double negative :/ 2015-06-07 21:12:20 -05:00
Joseph Poirier 1a4b9a92c4 ongoing dev: remove unused platform specific code 2015-06-07 20:56:23 -05:00
Joseph Poirier 8964112c70 define NO_BUGGER by default in make file 2015-06-07 00:02:32 -05:00
Joseph Poirier a61bd97d9b formatting 2015-06-06 23:40:08 -05:00
zik.saleeba 864c372dbb Fix for issue #191 suggested by Christopher Foucher.
git-svn-id: http://picoc.googlecode.com/svn/trunk@606 21eae674-98b7-11dd-bd71-f92a316d2d60
2014-03-01 04:23:55 +00:00
zik.saleeba 019c4cb42c Patch from christophe.foucher added.
Issue #168


git-svn-id: http://picoc.googlecode.com/svn/trunk@600 21eae674-98b7-11dd-bd71-f92a316d2d60
2013-03-16 07:42:55 +00:00
zik.saleeba b5a600a749 Merged in a pile of changes from broscutamaker
git-svn-id: http://picoc.googlecode.com/svn/trunk@599 21eae674-98b7-11dd-bd71-f92a316d2d60
2013-03-16 07:39:34 +00:00
zik.saleeba 505f229419 continue bug in "for" thanks to broscutamaker
git-svn-id: http://picoc.googlecode.com/svn/trunk@596 21eae674-98b7-11dd-bd71-f92a316d2d60
2013-03-16 06:02:05 +00:00
zik.saleeba 37ada79ac9 Fix for "Break statement not working correctly".
Issue #163


git-svn-id: http://picoc.googlecode.com/svn/trunk@594 21eae674-98b7-11dd-bd71-f92a316d2d60
2013-03-16 05:49:01 +00:00
zik.saleeba d74c7bba38 Fix from broscutamaker for "return outside function body leads to crash".
Issue #143.


git-svn-id: http://picoc.googlecode.com/svn/trunk@593 21eae674-98b7-11dd-bd71-f92a316d2d60
2013-03-16 05:45:44 +00:00
zik.saleeba 54cfcffa9b Fix for eclipse submitted by christophe.foucher
Issue #177


git-svn-id: http://picoc.googlecode.com/svn/trunk@589 21eae674-98b7-11dd-bd71-f92a316d2d60
2013-02-23 23:18:47 +00:00
zik.saleeba 35e64fa8c1 Fixed a regression I added while implementing re-entrancy.
git-svn-id: http://picoc.googlecode.com/svn/trunk@582 21eae674-98b7-11dd-bd71-f92a316d2d60
2012-09-23 08:13:05 +00:00
zik.saleeba 62bc229f4a Adapted to be fully re-entrant.
Issue #137


git-svn-id: http://picoc.googlecode.com/svn/trunk@581 21eae674-98b7-11dd-bd71-f92a316d2d60
2012-09-22 05:11:44 +00:00
zik.saleeba 29d15395ba Fixed regression in array initialisers with trailing commas.
git-svn-id: http://picoc.googlecode.com/svn/trunk@579 21eae674-98b7-11dd-bd71-f92a316d2d60
2012-09-06 12:07:57 +00:00
zik.saleeba 83de73dc45 Assignment to unsized array from array initialisers is implemented.
git-svn-id: http://picoc.googlecode.com/svn/trunk@578 21eae674-98b7-11dd-bd71-f92a316d2d60
2012-09-06 11:33:39 +00:00
zik.saleeba 853b6f6259 Added some more comments.
Added the beginnings of a debugger. It's not useful yet.


git-svn-id: http://picoc.googlecode.com/svn/trunk@570 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-05-01 06:50:00 +00:00
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