Commit graph

78 commits

Author SHA1 Message Date
zik.saleeba 172e6e5e8b Fixed problem with negative exponents in floating point constants (issue #62)
git-svn-id: http://picoc.googlecode.com/svn/trunk@355 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-10-29 19:26:47 +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 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 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 b55ab05d48 Added support for octal and hex character constants
git-svn-id: http://picoc.googlecode.com/svn/trunk@326 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-03 02:57:23 +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 9f9728dab5 Made it so a null character causes EOF. This shouldn't really be necessary but maybe it makes it easier for some implementations.
git-svn-id: http://picoc.googlecode.com/svn/trunk@317 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-06-02 06:40:47 +00:00
zik.saleeba 022e09a7a6 Fixed a bug which was causing decimal constants less than zero to be interpreted as octal
git-svn-id: http://picoc.googlecode.com/svn/trunk@308 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:40:45 +00:00
zik.saleeba 4bc228c439 Fixed bogus references to native math library
git-svn-id: http://picoc.googlecode.com/svn/trunk@306 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-29 00:21:58 +00:00
zik.saleeba da2cd4805d Fixed an annoying bug which looked like a floating point issue but was in fact a string lexer issue.
git-svn-id: http://picoc.googlecode.com/svn/trunk@291 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 03:23:41 +00:00
zik.saleeba 6015fc5694 Fixed return of floating point tokens
git-svn-id: http://picoc.googlecode.com/svn/trunk@289 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-27 00:06:09 +00:00
zik.saleeba 5cece5090c Fixed a painful bug which was causing numbers to be corrupted on
the surveyor architecture. Why this didn't cause a problem on x86
I'll never know.


git-svn-id: http://picoc.googlecode.com/svn/trunk@281 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-16 12:51:55 +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 bd9cb90e02 Added the beginnings of flying fox platform support.
Removed some annoying debug.
Made it easier to compile unmodified on non-UNIX systems.


git-svn-id: http://picoc.googlecode.com/svn/trunk@274 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-05-04 12:02:16 +00:00
zik.saleeba 4ea76ea5b3 Changed dereferencing to handle arrays correctly.
git-svn-id: http://picoc.googlecode.com/svn/trunk@269 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-04-26 03:26:04 +00:00
zik.saleeba 95f2b3e193 Characters are now actually stored as char and coerced to other types when necessary.
Parameters are passed as the requested types and coerced where appropriate.
Assignments are now a function rather than a macro.
Cleaned up some comments in lex.c.
Small valued integer constants are passed as char constants to save space.


git-svn-id: http://picoc.googlecode.com/svn/trunk@262 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-04-22 12:06:58 +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 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 207549bf17 Reorganised platform/library stuff for better separation between
platforms.
Removed unnecessary union in pointers.


git-svn-id: http://picoc.googlecode.com/svn/trunk@203 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-15 07:07:21 +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 0523bd570d String literal array values are now shared and deallocated cleanly
git-svn-id: http://picoc.googlecode.com/svn/trunk@197 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-11 22:28:42 +00:00
zik.saleeba b8aedfe050 Fixed bugs in LexCopyTokens() which were affecting multi-line function definitions in interactive mode
git-svn-id: http://picoc.googlecode.com/svn/trunk@183 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-10 02:01:12 +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 878e545b20 Hexadecimal, octal and binary integer literals added
git-svn-id: http://picoc.googlecode.com/svn/trunk@165 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-08 01:09:42 +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 9780c54403 LexCopyTokens() now handles multi-line copies in preparation for interactive mode.
git-svn-id: http://picoc.googlecode.com/svn/trunk@163 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-07 11:08:00 +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 a3ab81ca23 Starting to code the new expression system
git-svn-id: http://picoc.googlecode.com/svn/trunk@148 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-03-03 10:53:45 +00:00
zik.saleeba 3c24084d94 Fixed an insidious bug in table lookups
git-svn-id: http://picoc.googlecode.com/svn/trunk@133 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-28 22:13:55 +00:00
zik.saleeba d6c73f42d4 Fixed lexer issue temporarily
Diked out failing pointer test case for now
Added platform return value example


git-svn-id: http://picoc.googlecode.com/svn/trunk@127 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-28 19:57:03 +00:00
zik.saleeba 84661d245c Reverted broken lexer
git-svn-id: http://picoc.googlecode.com/svn/trunk@126 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-28 19:48:01 +00:00
zik.saleeba b6b75396dd Added all remaining operators with a view to completing expression evaluation
git-svn-id: http://picoc.googlecode.com/svn/trunk@124 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-28 19:30:48 +00:00
zik.saleeba 73d91b6202 Change to add extra lvalue information to values
git-svn-id: http://picoc.googlecode.com/svn/trunk@117 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-26 09:56:22 +00:00
zik.saleeba 20fb2407ef Big reorganisation to make it easier to port to different targets
git-svn-id: http://picoc.googlecode.com/svn/trunk@110 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-24 11:16:37 +00:00
zik.saleeba 37c2364eff Character constants now work
git-svn-id: http://picoc.googlecode.com/svn/trunk@102 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-24 01:01:02 +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 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 2ac131247b Fixed a lexer bug in memory allocation
git-svn-id: http://picoc.googlecode.com/svn/trunk@96 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-20 09:46:46 +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 834a6daca6 Added comment
git-svn-id: http://picoc.googlecode.com/svn/trunk@86 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-19 04:55:52 +00:00
zik.saleeba f45882e7e2 Now escaping character and string constants correctly
git-svn-id: http://picoc.googlecode.com/svn/trunk@85 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-19 04:34:36 +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 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 36ce6f3b80 Fixed line numbering in error messages
git-svn-id: http://picoc.googlecode.com/svn/trunk@75 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-12 09:34:16 +00:00