No matching definitions.

scscm/codegen

src/scscm/codegen.tur
defn

generate

(generate [node : int])

emit sclang text for a single AST node.

nodeAST node handle (expanded by scscm/expander)

Heap-allocated :cstr of the sclang expression. Names bound by enclosing forms are those in the current scope; generate-all resets it.

(generate my-ast-node)  ; => "foo_bar(1, 2)"

Since: SC2

defn

generate-all

(generate-all [nodes : int])

emit a sclang program for a top-level cons list of nodes.

nodescons list of AST node handles (expanded)

Heap-allocated :cstr: one statement per line, each ending in ";". Top-level var/defn names are declared up front (see the module header).

(generate-all top-level-nodes)  ; => "var x = 1;\nx.postln;\n"

Since: SC2

Internal definitions
scscm-sym-escape-- map a scscm identifier to a sclang identifier.
scscm-concat-- concatenate two strings into a fresh buffer.
scscm-cat3-- concatenate three strings.
scscm-join-- join a cons list of strings with a separator.
scscm-num-text-- a number literal as sclang accepts it (no unary +).
scscm-kw-name-- strip the leading colon of a keyword.
scscm-ident?-- true when s is a plain sclang identifier.
scscm-sym-quoted-- 'text' with quotes and backslashes escaped.
scscm-symbol-literal
scscm-upper-or-dotted?-- a class name (Synth) or Class.method (SinOsc.ar).
scscm-is-binary-op?
scscm-sclang-op
scscm-scope-op
scscm-scope-reset
scscm-scope-push
scscm-scope-mark
scscm-scope-pop
scscm-in-scope?
scscm-in-scope-since?
scscm-kind?
scscm-head-name
scscm-form?
scscm-decl?
scscm-decl-name
scscm-operator-expr?
scscm-flatten
scscm-flatten-cons
scscm-drop-empty
scscm-lead-count
scscm-declare
scscm-drop
scscm-decl-value
scscm-gen-lead
scscm-gen-rest
scscm-gen-stmt-list
scscm-declare-after
scscm-take
scscm-declares?
scscm-names-has?
scscm-hoist-names
scscm-gen-body
scscm-any-decl?
scscm-gen-operand
scscm-gen-binop-loop
scscm-gen-binop
scscm-dict-kw
scscm-dict-pairs
scscm-dict-key
scscm-gen-dict
scscm-gen-args-loop
scscm-gen-args
scscm-controls-callee?
scscm-controls-method?
scscm-gen-send
scscm-gen-dot
scscm-gen-dotdot
scscm-gen-params
scscm-join-params
scscm-gen-fn
scscm-gen-branch
scscm-gen-if
scscm-let-pairs?
scscm-let-collect
scscm-push-all
scscm-gen-let
scscm-gen-do-expr
scscm-gen-set
scscm-gen-literal
scscm-literal-elems
scscm-gen-quote
scscm-gen-call
scscm-gen-list-sym
scscm-gen-list
scscm-terminate