Search in sources :

Example 1 with LineParser

use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.LineParser in project linuxtools by eclipse.

the class SystemTapScriptGraphOptionsTab method createDatasetParsers.

/**
 * Creates a list of parsers, one for each regular expression created, that will be used
 * to parse the output of a running script.
 * @param configuration The desired run configuration.
 * @return A list of parsers.
 */
public static List<IDataSetParser> createDatasetParsers(ILaunchConfiguration configuration) {
    try {
        int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
        ArrayList<IDataSetParser> parsers = new ArrayList<>(numberOfRegexs);
        for (int r = 0; r < numberOfRegexs; r++) {
            // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            parsers.add(new LineParser("^" + configuration.getAttribute(REGULAR_EXPRESSION + r, "") + "$"));
        }
        return parsers;
    } catch (CoreException e) {
        ExceptionErrorDialog.openError(Messages.SystemTapScriptGraphOptionsTab_cantInitializeTab, e);
    }
    return null;
}
Also used : IDataSetParser(org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataSetParser) CoreException(org.eclipse.core.runtime.CoreException) LineParser(org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.LineParser) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 CoreException (org.eclipse.core.runtime.CoreException)1 IDataSetParser (org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataSetParser)1 LineParser (org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.LineParser)1