Commit graph

36 commits

Author SHA1 Message Date
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
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 70cc4eae49 Fixed lexer EOF handling when whitespace at end of file
git-svn-id: http://picoc.googlecode.com/svn/trunk@63 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-03 11:09:07 +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 d95e7debf8 Fixed off-by-one error in LexGetToken()
git-svn-id: http://picoc.googlecode.com/svn/trunk@59 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-03 00:43:13 +00:00
zik.saleeba 11fd7f0f16 Fixed handling of interactive input at EOF
git-svn-id: http://picoc.googlecode.com/svn/trunk@58 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-03 00:23:13 +00:00
zik.saleeba 5b1d4a611f More compact storage of lex token values
git-svn-id: http://picoc.googlecode.com/svn/trunk@57 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-03 00:13:50 +00:00
zik.saleeba 44117cde04 Fixed fallthrough problem in lexer
git-svn-id: http://picoc.googlecode.com/svn/trunk@56 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-02 23:45:34 +00:00
zik.saleeba b0c3f9d63d Uninitialised memory bug fixed
git-svn-id: http://picoc.googlecode.com/svn/trunk@52 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-02 22:33:07 +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 0c0ac9b332 Lexer now supports interactive input.
Lexer now pre-scans the source and returns a buffer of tokens.
Heap can provide unallocated memory for a temporary buffer.

git-svn-id: http://picoc.googlecode.com/svn/trunk@46 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-02-02 04:53:45 +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 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 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 ef8969d975 Added lexer token caching for improved performance
git-svn-id: http://picoc.googlecode.com/svn/trunk@29 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-01-05 04:52:33 +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 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 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 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 ead3f08671 Updated hello.c to current syntax.
Fixed a bug in string constant handling.


git-svn-id: http://picoc.googlecode.com/svn/trunk@11 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-12-19 04:24:55 +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 5ddfcfd14a Completed lexer.
Removed dependence on strtol()

git-svn-id: http://picoc.googlecode.com/svn/trunk@7 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-10-15 02:09:47 +00:00
zik.saleeba d89cc62990 More lexiness
git-svn-id: http://picoc.googlecode.com/svn/trunk@6 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-10-14 11:46:42 +00:00
zik.saleeba b5f685e744 Now compiles cleanly
git-svn-id: http://picoc.googlecode.com/svn/trunk@3 21eae674-98b7-11dd-bd71-f92a316d2d60
2008-10-13 10:53:25 +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