ANTAREX API

Clava API

LARA API

LARA Common Language API

(.js)
laraImport("clava.util.FileIterator");

(.lara)
import clava.util.FileIterator;

FileIterator

Constructor

FileIterator

new FileIterator(srcFoldername, [sourceExt = ["c", "cpp"]], [headerExt = ["h", "hpp"]])

Given a folder, collects sources in that folder, parses and returns one each time next() is called.

Pushes an empty Clava AST. Parsed files are added one at a time, and the AST contains at most one file at any given time.

Parameters

srcFoldername: string - name of the folder with the source files to iterate.
sourceExt: string[] - extensions of the source files. (optional)
headerExt: string[] - extensions of the header files. (optional)

Instance Members

hasNext

hasNext()

Returns

boolean - true if there are still files to iterate over, false otherwise.

next

next()

Returns

any - $file join point, if there are still files to iterate over, or undefined otherwise