Commit graph

112 commits

Author SHA1 Message Date
zik.saleeba cf28c7513c Fixed some inconsistencies in array handling
git-svn-id: http://picoc.googlecode.com/svn/trunk@105 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-24 02:28:35 +00:00
zik.saleeba e94767ba98 New NO_FP compile option allows removal of all floating point support
git-svn-id: http://picoc.googlecode.com/svn/trunk@101 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-24 00:21:17 +00:00
zik.saleeba 93a6a0e9d0 Fixed a bug in array allocation (regression)
git-svn-id: http://picoc.googlecode.com/svn/trunk@100 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-24 00:08:11 +00:00
zik.saleeba 4b11999dea stdarg parameter type checking bug sorted
git-svn-id: http://picoc.googlecode.com/svn/trunk@99 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-21 23:38:07 +00:00
zik.saleeba 4821d689ad Big changes to string constants.
Got rid of str.c.
First attempt at stdarg params in printf()


git-svn-id: http://picoc.googlecode.com/svn/trunk@97 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-21 02:35:52 +00:00
zik.saleeba 89e5c66189 Implemented ellipsis for stdargs and stdarg stack handling
git-svn-id: http://picoc.googlecode.com/svn/trunk@95 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-20 09:04:45 +00:00
zik.saleeba a128b58610 Implemented 'return'.
All tests now pass.

git-svn-id: http://picoc.googlecode.com/svn/trunk@93 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-20 00:12:58 +00:00
zik.saleeba 957b620703 Revised stack and parameter handling in intrinsic functions
git-svn-id: http://picoc.googlecode.com/svn/trunk@92 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-19 23:55:40 +00:00
zik.saleeba ebc32dc1f0 Removed unnecessary ResultOnHeap parameters - they just added code for no reason.
Arguments are now stored fully on the stack to fix a bug with nested function calls.

git-svn-id: http://picoc.googlecode.com/svn/trunk@91 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-19 23:29:35 +00:00
zik.saleeba b428c0f544 Small fix for parameter count
git-svn-id: http://picoc.googlecode.com/svn/trunk@90 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-19 11:07:56 +00:00
zik.saleeba 2ba0598f1c Fixed a bug in do..while - now works
git-svn-id: http://picoc.googlecode.com/svn/trunk@89 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-19 11:01:14 +00:00
zik.saleeba 6a1d28c1dc switch is now working.
did some work on break / continue in loops.


git-svn-id: http://picoc.googlecode.com/svn/trunk@87 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-19 09:07:00 +00:00
zik.saleeba 2f5523f400 Fixed a parser bug with token checking
git-svn-id: http://picoc.googlecode.com/svn/trunk@83 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-18 11:03:14 +00:00
zik.saleeba fdad9f8d30 Changes to help with implementing switch/case/break/continue/return
git-svn-id: http://picoc.googlecode.com/svn/trunk@82 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-18 08:19:06 +00:00
zik.saleeba d94b70212b Syntax of "switch" is now handled. Not semantics though.
git-svn-id: http://picoc.googlecode.com/svn/trunk@81 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-17 23:36:09 +00:00
zik.saleeba 2e545deb6a Arrays debugged and working
git-svn-id: http://picoc.googlecode.com/svn/trunk@80 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-15 07:39:41 +00:00
zik.saleeba 78e0ff8bc1 Implemented array lookup
git-svn-id: http://picoc.googlecode.com/svn/trunk@79 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-15 06:46:37 +00:00
zik.saleeba 038431067f Arithmetic fixed to work with new system. "for" now works correctly again.
git-svn-id: http://picoc.googlecode.com/svn/trunk@78 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-15 06:16:54 +00:00
zik.saleeba b073f187f8 Revamped the way lvalues work. Now both structs and '.' should work.
git-svn-id: http://picoc.googlecode.com/svn/trunk@77 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-15 05:52:03 +00:00
zik.saleeba f3b46b9afc Fixed bugs in "for"
git-svn-id: http://picoc.googlecode.com/svn/trunk@76 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-12 12:15:25 +00:00
zik.saleeba bd5fe4b73c Made a cleaner interface to creating shared values
git-svn-id: http://picoc.googlecode.com/svn/trunk@74 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-11 06:47:36 +00:00
zik.saleeba 177c2a549b '*' dereference operator implemented
git-svn-id: http://picoc.googlecode.com/svn/trunk@73 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-11 06:42:30 +00:00
zik.saleeba e348021c51 Fixed some egregious bugs
git-svn-id: http://picoc.googlecode.com/svn/trunk@72 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-10 22:25:20 +00:00
zik.saleeba 2b1983b668 Implemented the "address of" operator - working towards pointers
git-svn-id: http://picoc.googlecode.com/svn/trunk@71 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-10 11:19:48 +00:00
zik.saleeba 51afc538be struct are now working
git-svn-id: http://picoc.googlecode.com/svn/trunk@69 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-10 08:42:09 +00:00
zik.saleeba a8b4b08d93 Implemented the '.' operator for struct/union member access
git-svn-id: http://picoc.googlecode.com/svn/trunk@66 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-09 11:40:56 +00:00
zik.saleeba c9abac9fad Fixed an EOF lexing problem.
Added some optional debug.
Turned debug off.
Fixed handling of LValues to work with stack frames better.
Fixed the handling of stack frames in function calls.
Fixed a bug in popping variable stack frames.

git-svn-id: http://picoc.googlecode.com/svn/trunk@65 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-04 00:17:30 +00:00
zik.saleeba bd30654f74 Fixed a problem with VariableAllocValueAndData() allocating the wrong amount of memory.
Fixed a problem with type parsing.


git-svn-id: http://picoc.googlecode.com/svn/trunk@62 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-03 10:39:48 +00:00
zik.saleeba e267efdb96 Changed order of initialisation to fix reserved word bug
git-svn-id: http://picoc.googlecode.com/svn/trunk@54 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-02 22:35:34 +00:00
zik.saleeba 1389084b36 Fixed some egrerious bugs
git-svn-id: http://picoc.googlecode.com/svn/trunk@49 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-02 11:50:55 +00:00
zik.saleeba 956efab67f Parser is now updated to work with the new lexer and string system.
System now compiles - needs debug.


git-svn-id: http://picoc.googlecode.com/svn/trunk@48 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-02 11:08:36 +00:00
zik.saleeba 8bd1c18d24 Converting to use shared strings
git-svn-id: http://picoc.googlecode.com/svn/trunk@45 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-02 03:27:05 +00:00
zik.saleeba 86af5318da Bulko lexer change for more efficient pre-scanned tokens.
Removed Str type - replaced with standard C strings.
Added hashed string tables for efficient string storage.


git-svn-id: http://picoc.googlecode.com/svn/trunk@43 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-01 11:31:18 +00:00
zik.saleeba 86cea880e3 Changed away from old FunctionStore approach now that I have dynamic
allocation available.


git-svn-id: http://picoc.googlecode.com/svn/trunk@39 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-29 10:56:50 +00:00
zik.saleeba 75e45704e8 Bulk changes to accomodate the new storage model.
The system now compiles again (probably doesn't run though).


git-svn-id: http://picoc.googlecode.com/svn/trunk@38 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-26 08:57:32 +00:00
zik.saleeba 4524270e50 Changing everything to handled heap-allocated values
git-svn-id: http://picoc.googlecode.com/svn/trunk@37 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-25 02:09:44 +00:00
zik.saleeba b9e1086cbb Moving towards a working new type system
git-svn-id: http://picoc.googlecode.com/svn/trunk@36 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-24 03:15:02 +00:00
zik.saleeba fad5c6db69 Big changes and progress towards the new type system. Doesn't compile right now. Maybe tomorrow.
git-svn-id: http://picoc.googlecode.com/svn/trunk@35 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-23 11:34:12 +00:00
zik.saleeba a59be13de3 Now compiles with some of the new structure in place
git-svn-id: http://picoc.googlecode.com/svn/trunk@34 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-21 09:02:05 +00:00
zik.saleeba a15cf7dd36 Fixed a problem with passing unnamed parameters.
Fixed a problem with file reading.

git-svn-id: http://picoc.googlecode.com/svn/trunk@30 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-05 05:50:04 +00:00
zik.saleeba 883c862474 #include implemented
git-svn-id: http://picoc.googlecode.com/svn/trunk@28 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-05 04:38:19 +00:00
zik.saleeba 93a6dffee4 #define macros implemented
git-svn-id: http://picoc.googlecode.com/svn/trunk@27 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-05 04:28:54 +00:00
zik.saleeba 995266ce9c Added test framework.
Implemented preprocessor-style directives (not finished yet).


git-svn-id: http://picoc.googlecode.com/svn/trunk@26 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-04 04:08:49 +00:00
zik.saleeba 939c68cd4d Intrinsic functions implemented
git-svn-id: http://picoc.googlecode.com/svn/trunk@25 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-27 04:36:45 +00:00
zik.saleeba bf0fe101e5 Support for floating point output added
git-svn-id: http://picoc.googlecode.com/svn/trunk@24 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-27 03:04:58 +00:00
zik.saleeba 224a90dca3 Fixed bug in scoping accessing all stack frames, not just local and
global


git-svn-id: http://picoc.googlecode.com/svn/trunk@23 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-27 02:28:29 +00:00
zik.saleeba 704f20e1c4 Added floating point support
git-svn-id: http://picoc.googlecode.com/svn/trunk@22 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-27 02:25:49 +00:00
zik.saleeba a8008e9ac7 Function calls now work.
git-svn-id: http://picoc.googlecode.com/svn/trunk@21 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-24 03:27:53 +00:00
zik.saleeba 69113a26c6 Function calls added
git-svn-id: http://picoc.googlecode.com/svn/trunk@20 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-24 02:30:29 +00:00
zik.saleeba 252e1339d6 Type and parameter parsing - working toward function handling.
"plain token" lexical analysis for brevity.


git-svn-id: http://picoc.googlecode.com/svn/trunk@19 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-22 11:52:31 +00:00
zik.saleeba e5920c041c Local variables implemented
git-svn-id: http://picoc.googlecode.com/svn/trunk@18 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-22 02:29:19 +00:00
zik.saleeba b57f0eac65 Simple counting loops now work
git-svn-id: http://picoc.googlecode.com/svn/trunk@17 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-21 03:46:32 +00:00
zik.saleeba ebf601bfb9 Removed unused path in TableSet()
git-svn-id: http://picoc.googlecode.com/svn/trunk@16 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-21 03:13:25 +00:00
zik.saleeba eba1492fcb Function definitions implemented.
Lexer changed to not carry values in LexState.


git-svn-id: http://picoc.googlecode.com/svn/trunk@15 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-21 01:36:09 +00:00
zik.saleeba 19fbe151ff Fixed a number lexing bug.
Fixed an assignment bug.
Beginnings of function handling.
Now can run a simple program for the first time.


git-svn-id: http://picoc.googlecode.com/svn/trunk@14 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-20 11:46:21 +00:00
zik.saleeba 42c28c78c7 Neatened calling and error handling.
Parser now handles assignment.


git-svn-id: http://picoc.googlecode.com/svn/trunk@13 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-20 10:24:34 +00:00
zik.saleeba a41ac67b50 Now compiles
git-svn-id: http://picoc.googlecode.com/svn/trunk@10 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-19 00:22:52 +00:00
zik.saleeba 8cfd9c6013 Wrote much of the parser
git-svn-id: http://picoc.googlecode.com/svn/trunk@9 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-11-22 02:56:08 +00:00
zik.saleeba 50c7494508 Starting the parser
git-svn-id: http://picoc.googlecode.com/svn/trunk@8 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-10-16 07:04:23 +00:00
zik.saleeba 96674aad41 Now uses internal printf
git-svn-id: http://picoc.googlecode.com/svn/trunk@5 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-10-14 11:18:43 +00:00
zik.saleeba 32c5617d83 Fixed errors
git-svn-id: http://picoc.googlecode.com/svn/trunk@4 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-10-14 04:51:34 +00:00
zik.saleeba 7bfc2c0be5 Initial checkin of picoc. Not working yet.
git-svn-id: http://picoc.googlecode.com/svn/trunk@2 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-10-13 00:53:28 +00:00