public List < CobolDataItem > emitModel ( final CommonTree ast ) throws RecognizerException { List < CobolDataItem > cobolDataItems = new ArrayList < CobolDataItem > ( ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( "4. Emitting Model from AST: {}" , ( ( ast == null ) ? "null" : ast . toStringTree ( ) ) ) ; } if ( ast == null ) { return cobolDataItems ; } try { TreeNodeStream nodes = new CommonTreeNodeStream ( ast ) ; CobolStructureEmitter emitter = new CobolStructureEmitterImpl ( nodes , getErrorHandler ( ) ) ; emitter . cobdata ( cobolDataItems ) ; return cobolDataItems ; } catch ( RecognitionException e ) { throw new RecognizerException ( e ) ; } }
Generates a model from an Abstract Syntax Tree .