Files
memgraph/src/lisp/package.lisp
Lovro Lugovic 0b2240e6e4 LCP: Split up PROCESS-FILE
Summary:
Split up `process-file` so that looking at the generated code for an LCP form is
easier from the REPL.

`process-lcp`, `generate-hpp` and `generate-cpp` now perform the generation of
C++ code, but take a list of "C++ elements" (the results of LCP forms) as input
and write their output to streams. They do no reading/evaluating of LCP forms of
their own.

`read-lcp` and `read-lcp-file` are used to read and evaluate a stream of LCP
forms. The latter is a specialized version for file streams which also reports
the position of the form within the file when an error happens.

`process-lcp-string` and `process-lcp-file` are convenient wrappers around the
main functionality that take a string (file) and output to strings (files).
Using `read-lcp` and `read-lcp-file` they process LCP forms and pass them off to
`process-lcp` for code generation.

Reviewers: mtomic, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2097
2019-06-12 09:38:41 +02:00

32 lines
969 B
Common Lisp

(defpackage #:lcp
(:use #:cl)
(:export #:define-class
#:define-struct
#:define-enum
#:define-rpc
#:cpp-list
#:in-impl
#:namespace
#:pop-namespace
#:process-lcp-file
#:lcp-syntax))
(defpackage #:lcp.slk
(:use #:cl)
(:export #:slk-error
#:save-function-declaration-for-class
#:save-function-definition-for-class
#:construct-and-load-function-declaration-for-class
#:construct-and-load-function-definition-for-class
#:load-function-declaration-for-class
#:load-function-definition-for-class
#:save-function-declaration-for-enum
#:save-function-definition-for-enum
#:load-function-declaration-for-enum
#:load-function-definition-for-enum))
(defpackage #:lcp.clone
(:use #:cl)
(:export #:clone-error
#:clone-function-definition-for-class))