public void convert() throws CompilationFailedException {
        if (this.phase == Phases.PARSING && this.phaseComplete) {
            gotoPhase(Phases.CONVERSION);
        }

        if (this.phase != Phases.CONVERSION) {
            throw new GroovyBugError("SourceUnit not ready for convert()");
        }

        //
        // Build the AST

        try {
            this.ast = parserPlugin.buildAST(this, this.classLoader, this.cst);
            this.ast.setDescription(this.name);
        } catch (SyntaxException e) {
            if (this.ast == null) {
                // Create a dummy ModuleNode to represent a failed parse - in case a later phase attempts to use the ast
                this.ast = new ModuleNode(this);
            }
            getErrorCollector().addError(new SyntaxErrorMessage(e, this));
        }

        String property = (String) AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                return System.getProperty("groovy.ast");
            }
        });

        if ("xml".equals(property)) {
            saveAsXML(name, ast);
        }
    }
public void convert ( ) throws CompilationFailedException { if ( this . phase == Phases . PARSING && this . phaseComplete ) { gotoPhase ( Phases . CONVERSION ) ; } if ( this . phase != Phases . CONVERSION ) { throw new GroovyBugError ( "SourceUnit not ready for convert()" ) ; } try { this . ast = parserPlugin . buildAST ( this , this . classLoader , this . cst ) ; this . ast . setDescription ( this . name ) ; } catch ( SyntaxException e ) { if ( this . ast == null ) { this . ast = new ModuleNode ( this ) ; } getErrorCollector ( ) . addError ( new SyntaxErrorMessage ( e , this ) ) ; } String property = ( String ) AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { return System . getProperty ( "groovy.ast" ) ; } } ) ; if ( "xml" . equals ( property ) ) { saveAsXML ( name , ast ) ; } }
Generates an AST from the CST.  You can retrieve it with getAST().