Commit Graph

57 Commits (f2741b34a4b82600f7965cfa0f6eae6d4f4ffe24)

Author SHA1 Message Date
John Benediktsson f2741b34a4 Eliminate duplicate syntax for stack effects "(" no longer drops and is identical to the old "((", which is now removed. 2011-10-18 13:19:39 -07:00
John Benediktsson eb55f8575c Cleanup more lint warnings. 2011-10-14 12:31:46 -07:00
John Benediktsson f419934d6a Cleanup lint warnings. 2011-10-14 11:47:24 -07:00
Doug Coleman 94f3ca3b8c Remove all non-core uses of (scan-token)
Add scan-datum
Add scan-number
Document more words
Fixes #225.
2011-10-02 12:00:08 -07:00
Doug Coleman 300138eb4d Refactor the lexer/parser to expose friendlier words for scanning tokens. The preferred top-level words now throw an exception on EOF.
CREATE -> scan-new
CREATE-CLASS -> scan-new-class
CREATE-WORD -> scan-new-word
CREATE-GENERIC -> scan-new-generic
scan -> (scan-token)
scan-token now throws on eof
(scan-word) returns word/number/f
scan-word now throws on eof
scan-word-name expects a non-number
Fixes #183.
Fixes #209.
2011-09-29 11:28:28 -07:00
Joe Groff 3e8db288f6 alien: merge enum improvements from Blei/gtk-image-loader 2011-08-27 13:48:30 -07:00
Erik Charlebois 94064b115e Create a setter for C-GLOBAL words 2011-05-23 23:36:14 -04:00
Doug Coleman 784c79a8f5 Fix typo ohno 2010-09-29 17:29:28 -05:00
Doug Coleman 795fa32a6d Use create-class-in to get redefinition errors with enums 2010-09-29 16:24:25 -05:00
Slava Pestov 5efc763629 alien.parser: make int[3]* parse, make int[3][4 not parse 2010-08-15 02:37:17 -07:00
Slava Pestov af977e1f0c alien.parser: array types where the base type was a pointer didn't parse (reported by Dmitry Shubin) 2010-08-15 02:32:12 -07:00
Slava Pestov e935681743 Add a scan-token word which is like scan, except throws an error on EOF; document scan-object word; mention that scan-token/scan-object are preferred over scan/scan-word 2010-07-06 16:20:08 -04:00
Slava Pestov b8ec5c6176 Stack allocation improvements
- New with-out-parameters combinator
- Inhibit tail call optimization in frames with local allocation, to ensure that passing a stack allocated value to the last word in the quotation works
- local allocations are now aligned properly
- spill slots are now aligned properly aligned in frames which have parameter and local allocation areas
2010-05-22 02:37:00 -04:00
Slava Pestov ae24eb8f97 alien.c-types: cleanup 2010-05-04 19:33:55 -04:00
Erik Charlebois d44e470416 Remove ENUM: f and replace uses with CONSTANTs.
Fix bootstrap and load-all errors from enum classes.
2010-04-19 20:08:40 -07:00
Joe Groff e28882bf59 add alien.enums vocab with enum-c-types that convert between symbols and integer values in the FFI. update ENUM: to define symbolic enums, and take an optional base type 2010-04-19 20:07:18 -07:00
Joe Groff ff0c2c66f5 alien.parser, alien.syntax: send ENUM: body to parse-enum 2010-04-19 20:07:17 -07:00
Joe Groff f2b158ca10 alien.parser: have define-enum handle the case when the enum name is f 2010-04-19 20:07:17 -07:00
Joe Groff e84e18f2ca alien.parser, alien.syntax: refactor ENUM: to separate parsing from definition 2010-04-19 20:07:17 -07:00
Joe Groff 69a6dcd8c0 prettyprint FUNCTION-ALIAS: definitions 2010-04-14 12:40:10 -07:00
Joe Groff e95edb1c47 alien.syntax: FUNCTION-ALIAS: syntax to define a C function binding with a different Factor name 2010-04-14 12:06:45 -07:00
Slava Pestov baa04649ef Move non-parsing words out of alien.syntax, and use a symbol instead of a string variable to store the current library in alien.parser 2010-04-12 18:09:26 -05:00
Erik Charlebois 9c2276b762 Change C-ENUM: to always take a type. Use f for anonymous enums. Update all uses. 2010-04-09 23:48:22 -07:00
Slava Pestov 747ddf5173 debugger: Untangle some dodgy dependencies that were loading locals before prettyprint, resulting in locals.prettyprint not being loaded 2010-03-17 19:19:43 +13:00
Joe Groff 92af7cc3d2 cut commas off of FUNCTION: parameter names in stack effects again 2010-02-28 19:29:53 -08:00
Joe Groff 904f30f454 alien.parser: refactor FUNCTION: parsing to read from the source incrementally. parse errors in FUNCTION: should now correspond to their location within the definition 2010-02-28 16:20:45 -08:00
Joe Groff e49dcf2c83 "pointer-c-type" word-prop hack is now unnecessary since all pointer types behave uniformly now 2010-02-23 12:07:55 -08:00
Joe Groff 760effdfac have TYPEDEF:, STRUCT: etc. throw an error if you try to define a c type name ending with asterisk 2010-02-23 10:16:18 -08:00
Joe Groff 9015711322 alien.parser: properly generate return type name for FUNCTION: stack effects 2010-02-22 11:25:01 -08:00
Joe Groff b435b2b84b Merge branch 'master' into new-alien-pointers
Conflicts:
	basis/alien/c-types/c-types.factor
	basis/stack-checker/dependencies/dependencies.factor
2010-02-22 10:32:59 -08:00
Slava Pestov 316b831208 alien: some code cleanups and fixes 2010-02-23 01:28:56 +13:00
Slava Pestov 33f3fee57d alien.c-types: remove void? word 2010-02-22 21:31:41 +13:00
Joe Groff a77edb8156 Merge branch 'master' of git://factorcode.org/git/factor into new-alien-pointers 2010-02-21 23:14:08 -08:00
Joe Groff e15784ed94 alien.parser: favor parsing "foo*" as pointer-to-foo now 2010-02-21 21:06:00 -08:00
Joe Groff 77ea9f1160 more implementation of pointer c-types. make it so that { char* binary } acts like a real pointer to char instead of stringifying, and add byte* typedef for { char* binary } 2010-02-21 20:58:21 -08:00
Joe Groff 64e6f08b59 use a "pointer" wrapper tuple to indicate pointer types instead of the current slipshod approach 2010-02-21 16:27:36 -08:00
Erik Charlebois 9adbbc8f98 The return values in the stack effects of FUNCTION: words were c-types rather than strings. This was causing scaffold-help to fail on vocabularies with FUNCTION:. 2010-02-20 03:02:56 -08:00
Joe Groff 22a9be5ea5 update existing code to use :> ( ) when possible 2009-10-28 16:11:33 -05:00
Slava Pestov d55217b34a alien.c-types: c-type no longer calls parser at runtime, tools.deploy.shaker now strips out runtime specialized array code generation 2009-10-16 23:50:17 -05:00
Joe Groff c312779f39 hurr 2009-10-16 16:39:33 -05:00
Joe Groff 67800284fb tweak parse-c-type so data-map can parse non-c-types 2009-10-16 16:10:09 -05:00
Slava Pestov a92e435799 alien.parser: fix behavior with restarts, reported by mnestic 2009-10-09 04:25:25 -05:00
Joe Groff 24c2a7fa8f refactor so that generalizations reuses the stub versions of nsequence, firstn, and n*quot needed by memoize 2009-10-08 12:55:52 -05:00
Joe Groff 5ab16ba62a change CALLBACK: to use the ABI of the current LIBRARY: and get rid of STDCALL-CALLBACK: 2009-09-28 19:27:28 -05:00
Joe Groff 5e3e8f97f4 redefine C-TYPE: to forward declare opaque C types; make C type definition and redefinition a little more robust 2009-09-27 22:12:00 -05:00
Joe Groff 1f606a4873 disable parsing of string c-types 2009-09-27 16:06:13 -05:00
Joe Groff 77d10178db add CALLBACK: syntax that defines a typedef and an alien-callback constructor word for function pointer types. update some code in iokit.hid and windows.dinput to use CALLBACK: instead of TYPEDEF:/word pairs 2009-09-21 11:59:41 -05:00
Joe Groff 52ba3f3a24 allow word c-types and definitions to coexist 2009-09-16 17:18:19 -05:00
Joe Groff 65ac206648 fix alien-function-word predicate 2009-09-16 14:17:13 -05:00
Joe Groff bba4d3ac8a prettyprinting for FUNCTION: definitions 2009-09-15 22:39:25 -05:00