Commit Graph

6 Commits (3310241a94e139827362c88daba5e0d1c70c30fd)

Author SHA1 Message Date
Mike Gerwitz 3310241a94
birth: AST generation
Just about ready for that sloppy code generation!

* build-aux/bootstrap/birth.scm: Update file header documentation.
  Add some whitespace between existing procedures.
  Invoke `parse-lisp' as the program in place of `lex', producing an AST as
    output to the console.
  (cadddr): Add procedure.
  (token-{type,lexeme,value,pos}): Add procedures.
  (parse-lisp): Add procedure (contains other procedures).
* build-aux/bootstrap/libprebirth.js
  ($$append): Add function (append).
  ($$$_$): Correct implementation (-).
  ($$zero$7$): Add predicate (zero?).
  ($$fold): Add function (fold).
* build-aux/bootstrap/prebirth.js (parseLisp): Lowercase some errors.
  (Compiler): Update class docblock.
  (fnmap)[labmda]: Add `lambda' form.
2017-09-02 01:30:13 -04:00
Mike Gerwitz b58bbe3949
prebirth: Add `-' to libprebirth
* build-aux/bootstrap/libprebirth.js ($$$_$): Add function.
2017-08-31 12:43:42 -04:00
Mike Gerwitz 41bf925b4e
prebirth: Add `string-append' to libprebirth
* build-aux/bootstrap/libprebirth.js ($$string$_$append): Add function.
2017-08-31 12:42:25 -04:00
Mike Gerwitz f626891e75
prebirth: More substantial libprebirth
This is a decent start.

* build-aux/bootstrap/libprebirth.js: Add a lot of stuff.  Go look for
  yourself.
2017-08-31 00:47:57 -04:00
Mike Gerwitz 3c5089417c
prebirth: Globally unique functions
This was implicit in the `define-block' implementation because of the
conversion from `<foo>' to `$foo$', but that's no longer the case.

This is just a simple, temporary implementation, so don't be alarmed.

* build-aux/bootstrap/libprebirth.js: Updated header documentation to
    mention `$$' prefix.
  ($$js$console): Renamed from `js$console'.
* build-aux/bootstrap/prebirth.js
  (_idFromName): Add `global' parameter to add `$$' prefix to generated
    identifiers.
  (_cdfn, _sexpToEs): Use it.
2017-08-28 23:42:19 -04:00
Mike Gerwitz 19642e59d9
prebirth: Prepend libprebirth to output
* build-aux/bootstrap/libprebirth.js: Add file.
* build-aux/bootstrap/prebirth.js: Prepend `libprebirth.js' contents to
  output.
2017-08-28 01:22:51 -04:00