use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class GeneralOptionsSubPage method createDiskFullActionNode.
private void createDiskFullActionNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry, final String value) {
logentry.setDiskFullActionRoot(new ParserRuleContext());
logentry.setDiskFullAction(new AddedParseTree(value));
createNode(lte, logentry, value, "DiskFullAction", logentry.getDiskFullActionRoot(), logentry.getDiskFullAction());
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class GeneralOptionsSubPage method createMatchingHintsNode.
private void createMatchingHintsNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry, final String value) {
logentry.setMatchingHintsRoot(new ParserRuleContext());
logentry.setMatchingHints(new AddedParseTree(value));
createNode(lte, logentry, value, "MatchingHints", logentry.getMatchingHintsRoot(), logentry.getMatchingHints());
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class GeneralOptionsSubPage method createNode.
private void createNode(final LoggingSectionHandler.LoggerTreeElement aLte, final LogParamEntry aLogEntry, final String aValue, final String aNodeText, final ParseTree aRoot, final ParseTree aData) {
ConfigTreeNodeUtilities.addChild(loggingSectionHandler.getLastSectionRoot(), aRoot);
final StringBuilder name = new StringBuilder();
aLte.writeNamePrefix(name);
name.append(aNodeText + " := ");
ConfigTreeNodeUtilities.addChild(aRoot, new AddedParseTree("\n"));
ConfigTreeNodeUtilities.addChild(aRoot, new AddedParseTree(name.toString()));
ConfigTreeNodeUtilities.addChild(aRoot, aData);
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class LoggingBitsSubPage method createConsoleMaskRootNode.
private void createConsoleMaskRootNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry) {
ParseTree consoleMaskRoot = new ParserRuleContext();
logentry.setConsoleMaskRoot(consoleMaskRoot);
ConfigTreeNodeUtilities.addChild(consoleMaskRoot, new AddedParseTree("\n"));
StringBuilder name = new StringBuilder();
lte.writeNamePrefix(name);
name.append("ConsoleMask := ");
ParseTree node = new AddedParseTree(name.toString());
ConfigTreeNodeUtilities.addChild(consoleMaskRoot, node);
ParseTree consoleMask = new ParserRuleContext();
logentry.setConsoleMask(consoleMask);
ConfigTreeNodeUtilities.addChild(consoleMaskRoot, consoleMask);
ConfigTreeNodeUtilities.addChild(loggingSectionHandler.getLastSectionRoot(), consoleMaskRoot);
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class ModuleParameterTransfer method nativeToJava.
@Override
protected ModuleParameter[] nativeToJava(final TransferData transferData) {
byte[] bytes = (byte[]) super.nativeToJava(transferData);
DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes));
try {
int n = in.readInt();
ModuleParameter[] items = new ModuleParameter[n];
for (int i = 0; i < n; i++) {
ModuleParameter newModuleParameter = new ModuleParameterSectionHandler.ModuleParameter();
final ParseTree root = new ParserRuleContext();
newModuleParameter.setRoot(root);
// module name part
final String hiddenBeforeModuleName = in.readUTF();
final String moduleName = in.readUTF();
final String hiddenBeforeSeparator = in.readUTF();
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("\n"));
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(hiddenBeforeModuleName));
newModuleParameter.setModuleName(new AddedParseTree(moduleName));
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(hiddenBeforeSeparator));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getModuleName());
final boolean isModuleNameEmpty = moduleName == null || moduleName.isEmpty();
newModuleParameter.setSeparator(new AddedParseTree(isModuleNameEmpty ? "" : "."));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getSeparator());
// parameter name part
final String hiddenBeforeParameterName = in.readUTF();
final String parameterName = in.readUTF();
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(hiddenBeforeParameterName));
newModuleParameter.setParameterName(new AddedParseTree(parameterName));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getParameterName());
// the := sign and the hidden stuff before it
final String hiddenBeforeOperator = in.readUTF();
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(hiddenBeforeOperator));
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(" := "));
// the value part
final String hiddenBeforeValue = in.readUTF();
final String value = in.readUTF();
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(hiddenBeforeValue));
newModuleParameter.setValue(new AddedParseTree(value));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getValue());
// put it under the root node
items[i] = newModuleParameter;
}
return items;
} catch (IOException e) {
ErrorReporter.logExceptionStackTrace(e);
return new ModuleParameter[] {};
}
}
Aggregations