Liking cljdoc? Tell your friends :D

clojure.jvm.tools.analyzer

Interface to Compiler's analyze. Entry point analyze-path and analyze-one

Interface to Compiler's analyze.
Entry point `analyze-path` and `analyze-one`
raw docstring

*eval-ast*clj

If true, evaluate the output AST before returning. Otherwise, AST is unevaluated. Defaults to true.

If true, evaluate the output AST before returning.
Otherwise, AST is unevaluated. Defaults to true.
sourceraw docstring

AnalysisToMapcljprotocol

analysis->mapclj

(analysis->map aobj env opt)

Recursively converts the output of the Compiler's analysis to a map. Takes a map of options:

  • :children when true, include a :children key with all child expressions of each node
  • :java-obj when true, include a :java-obj key with the node's corresponding Java object
Recursively converts the output of the Compiler's analysis to a map. Takes
a map of options:
- :children
  when true, include a :children key with all child expressions of each node
- :java-obj
  when true, include a :java-obj key with the node's corresponding Java object
source

analyze-fileclj

(analyze-file source-path
              &
              {:keys [reader opt]
               :or {reader (LineNumberingPushbackReader.
                             (io/reader (io/resource source-path)))}})

Takes a file path and optionally a pushback reader. Returns a vector of maps representing the ASTs of the forms in the target file.

Options:

  • :reader a pushback reader to use to read the namespace forms
  • :opt a map of analyzer options
    • :children when true, include a :children key with all child expressions of each node
    • :java-obj when true, include a :java-obj key with the node's corresponding Java object

eg. (analyze-file "my/ns.clj")

Takes a file path and optionally a pushback reader.
Returns a vector of maps representing the ASTs of the forms
in the target file.

Options:
- :reader  a pushback reader to use to read the namespace forms
- :opt     a map of analyzer options
  - :children
    when true, include a :children key with all child expressions of each node
  - :java-obj
    when true, include a :java-obj key with the node's corresponding Java object

eg. (analyze-file "my/ns.clj")
sourceraw docstring

analyze-formclj

(analyze-form form)
(analyze-form form opt)
source

analyze-form-in-nsclj

(analyze-form-in-ns nsym form)
(analyze-form-in-ns nsym form opt)
source

analyze-nsclj

(analyze-ns source-nsym
            &
            {:keys [reader opt] :or {reader (pb-reader-for-ns source-nsym)}})

Takes a LineNumberingPushbackReader and a namespace symbol. Returns a vector of maps, with keys :op, :env. If expressions have children, will have :children entry.

Options:

  • :reader a pushback reader to use to read the namespace forms
  • :opt a map of analyzer options
    • :children when true, include a :children key with all child expressions of each node
    • :java-obj when true, include a :java-obj key with the node's corresponding Java object

eg. (analyze-ns 'my-ns :opt {:children true} :reader (pb-reader-for-ns 'my.ns))

Takes a LineNumberingPushbackReader and a namespace symbol.
Returns a vector of maps, with keys :op, :env. If expressions
have children, will have :children entry.

Options:
- :reader  a pushback reader to use to read the namespace forms
- :opt     a map of analyzer options
  - :children
    when true, include a :children key with all child expressions of each node
  - :java-obj
    when true, include a :java-obj key with the node's corresponding Java object

eg. (analyze-ns 'my-ns :opt {:children true} :reader (pb-reader-for-ns 'my.ns))
sourceraw docstring

analyze-oneclj

(analyze-one env form)
(analyze-one env form opt)

Analyze a single form

Analyze a single form
sourceraw docstring

astcljmacro

(ast form)
(ast form opt)

Returns the abstract syntax tree representation of the given form, evaluated in the current namespace

Returns the abstract syntax tree representation of the given form,
evaluated in the current namespace
sourceraw docstring

ast-in-nscljmacro

(ast-in-ns nsym form)
(ast-in-ns nsym form opt)

Returns the abstract syntax tree representation of the given form, evaluated in the given namespace

Returns the abstract syntax tree representation of the given form,
evaluated in the given namespace
sourceraw docstring

childrenclj

(children expr)

Returns a lazy sequence of the immediate children of the expr in order of evaluation, where defined.

Returns a lazy sequence of the immediate children of the expr in
order of evaluation, where defined.
sourceraw docstring

fieldcljmacro

(field class-obj field)
(field class-obj field obj)

Call a private field, must be known at compile time. Throws an error if field is already publicly accessible.

Call a private field, must be known at compile time. Throws an error
if field is already publicly accessible.
sourceraw docstring

forms-seqclj

(forms-seq rdr)

Lazy seq of forms in a Clojure or ClojureScript file.

Lazy seq of forms in a Clojure or ClojureScript file.
sourceraw docstring

keyword->Contextclj

(keyword->Context k)
source

literal-dispatchcljmacro

(literal-dispatch disp-class op-keyword)
source

macroexpandclj

(macroexpand f)

Fully macroexpand a form.

Fully macroexpand a form.
sourceraw docstring

pb-reader-for-nsclj

(pb-reader-for-ns ns-sym)

Returns a LineNumberingPushbackReader for namespace ns-sym

Returns a LineNumberingPushbackReader for namespace ns-sym
sourceraw docstring

uri-for-nsclj

(uri-for-ns ns-sym)

Returns a URI representing the namespace. Throws an exception if URI not found.

Returns a URI representing the namespace. Throws an
exception if URI not found.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close