API for clojure.tools.analyzer.jvm - JVM-specific passes for tools.analyzer 0.1.0 (in development)


Full namespace name: clojure.tools.analyzer.jvm

Overview

Analyzer for clojure code, extends tools.analyzer with JVM specific passes/forms

Public Variables and Functions



analyze

function
Usage: (analyze form)
       (analyze form env)
Returns an AST for the form that's compatible with what tools.emitter.jvm requires.

Binds tools.analyzer/{macroexpand-1,create-var,parse} to
tools.analyzer.jvm/{macroexpand-1,create-var,parse} and calls
tools.analyzer/analyzer on form.

Calls `run-passes` on the AST.
Source


analyze+eval

function
Usage: (analyze+eval form)
       (analyze+eval form env)
Like analyze but evals the form after the analysis.
Useful when analyzing whole files/namespaces.
Source


create-var

function
Usage: (create-var sym {:keys [ns]})
Creates a Var for sym and returns it.
The Var gets interned in the env namespace.
Source


empty-env

function
Usage: (empty-env)
Returns an empty env map
Source


macroexpand-1

function
Usage: (macroexpand-1 form env)
If form represents a macro form or an inlineable function,
returns its expansion, else returns form.
Source


parse

multimethod
No usage documentation available
Extension to tools.analyzer/-parse for JVM special forms
Source


run-passes

function
Usage: (run-passes ast)
Applies the following passes in the correct order to the AST:
* uniquify
* add-binding-atom
* cleanup
* source-info
* elide-meta
* warn-earmuff
* collect
* jvm.box
* jvm.constant-lifter
* jvm.annotate-branch
* jvm.annotate-loops
* jvm.annotate-class-id
* jvm.annotate-internal-name
* jvm.annotate-methods
* jvm.fix-case-test
* jvm.clear-locals
* jvm.classify-invoke
* jvm.validate
* jvm.infer-tag
* jvm.annotate-tag
* jvm.validate-loop-locals
* jvm.analyze-host-expr
Source


specials

var

    
Set of the special forms for clojure in the JVM
Source

clojure.tools.analyzer.jvm.utils





Public Variables and Functions



box

function
Usage: (box c)
If the argument is a primitive Class, returns its boxed equivalent,
otherwise returns the argument
Source


convertible?

function
Usage: (convertible? c1 c2)
Returns true if it's possible to convert from c1 to c2
Source


maybe-class

var

    
Takes a Symbol, String or Class and tires to resolve to a matching Class
Source


numeric?

function
Usage: (numeric? c)
Returns true if the given class is numeric
Source


prim-or-obj

function
Usage: (prim-or-obj tag)
If the given Class is a primitive, returns that Class, otherwise returns Object
Source


primitive?

var

    
Returns non-nil if the argument represents a primitive Class other than Void
Source


subsumes?

function
Usage: (subsumes? c1 c2)
Returns true if c2 is subsumed by c1
Source


try-best-match

function
Usage: (try-best-match tags methods)
Given a vector of arg tags and a collection of methods, tries to return the
subset of methods that match best the given tags
Source


unbox

function
Usage: (unbox c)
If the argument is a Class with a primitive equivalent, returns that,
otherwise returns the argument
Source


wider-primitive

function
Usage: (wider-primitive from to)
Given two numeric primitive Classes, returns the wider one
Source


wider-tag

function
Usage: (wider-tag tags)
Given a collection of Classes returns the wider one
Source


wider-tag*

function
Usage: (wider-tag* from to)
Given two Classes returns the wider one
Source


wider-than

var

    
If the argument is a numeric primitive Class, returns a set of primitive Classes
that are narrower than the given one
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.