Search in sources :

Example 31 with AddedParseTree

use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.

the class GeneralOptionsSubPage method createTimeStampFormatNode.

private void createTimeStampFormatNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry, final String value) {
    logentry.setTimestampFormatRoot(new ParserRuleContext());
    logentry.setTimestampFormat(new AddedParseTree(value));
    createNode(lte, logentry, value, "TimeStampFormat", logentry.getTimestampFormatRoot(), logentry.getTimestampFormat());
}
Also used : ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree)

Example 32 with AddedParseTree

use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.

the class GeneralOptionsSubPage method createLogEventTypesNode.

private void createLogEventTypesNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry, final String value) {
    logentry.setLogeventTypesRoot(new ParserRuleContext());
    logentry.setLogeventTypes(new AddedParseTree(value));
    createNode(lte, logentry, value, "LogEventTypes", logentry.getLogeventTypesRoot(), logentry.getLogeventTypes());
}
Also used : ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree)

Example 33 with AddedParseTree

use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.

the class GeneralOptionsSubPage method createPluginSpecificParamNode.

private PluginSpecificParam createPluginSpecificParamNode(final String param, final String value) {
    StringBuilder name = new StringBuilder();
    loggingPage.getSelectedTreeElement().writeNamePrefix(name);
    name.append(param);
    name.append(" := ");
    final ParseTree keyAST = new AddedParseTree(name.toString());
    final ParseTree valueAST = new AddedParseTree(value);
    final ParseTree root = new ParserRuleContext();
    ConfigTreeNodeUtilities.addChild(loggingSectionHandler.getLastSectionRoot(), root);
    ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("\n"));
    ConfigTreeNodeUtilities.addChild(root, keyAST);
    ConfigTreeNodeUtilities.addChild(root, valueAST);
    PluginSpecificParam psp = new PluginSpecificParam(root, keyAST, valueAST, param);
    selectedLogEntry.getPluginSpecificParam().add(psp);
    return psp;
}
Also used : ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) PluginSpecificParam(org.eclipse.titan.common.parsers.cfg.indices.LoggingSectionHandler.PluginSpecificParam) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) ParseTree(org.antlr.v4.runtime.tree.ParseTree)

Example 34 with AddedParseTree

use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.

the class LoggingBitsSubPage method addLoggingBit.

private void addLoggingBit(final Map<LoggingBit, ParseTree> bitMask, final ParseTree bitmaskRoot, final LoggingBit bit) {
    ParseTree newBit = new AddedParseTree(bit.getName());
    bitMask.put(bit, newBit);
    if (bitMask.keySet().size() > 1) {
        ParseTree separator = new AddedParseTree("|");
        ConfigTreeNodeUtilities.addChild(bitmaskRoot, separator);
    }
    ConfigTreeNodeUtilities.addChild(bitmaskRoot, newBit);
}
Also used : AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) ParseTree(org.antlr.v4.runtime.tree.ParseTree)

Example 35 with AddedParseTree

use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.

the class LoggingBitsSubPage method createFileMaskRootNode.

private void createFileMaskRootNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry) {
    ParseTree fileMaskRoot = new ParserRuleContext();
    logentry.setFileMaskRoot(fileMaskRoot);
    ConfigTreeNodeUtilities.addChild(fileMaskRoot, new AddedParseTree("\n"));
    StringBuilder name = new StringBuilder();
    lte.writeNamePrefix(name);
    name.append("FileMask := ");
    ParseTree node = new AddedParseTree(name.toString());
    ConfigTreeNodeUtilities.addChild(fileMaskRoot, node);
    ParseTree fileMask = new ParserRuleContext();
    logentry.setFileMask(fileMask);
    ConfigTreeNodeUtilities.addChild(fileMaskRoot, fileMask);
    ConfigTreeNodeUtilities.addChild(loggingSectionHandler.getLastSectionRoot(), fileMaskRoot);
}
Also used : ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) ParseTree(org.antlr.v4.runtime.tree.ParseTree)

Aggregations

AddedParseTree (org.eclipse.titan.common.parsers.AddedParseTree)45 ParserRuleContext (org.antlr.v4.runtime.ParserRuleContext)41 ParseTree (org.antlr.v4.runtime.tree.ParseTree)32 ByteArrayInputStream (java.io.ByteArrayInputStream)6 DataInputStream (java.io.DataInputStream)6 IOException (java.io.IOException)6 TerminalNodeImpl (org.antlr.v4.runtime.tree.TerminalNodeImpl)3 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Composite (org.eclipse.swt.widgets.Composite)3 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)3 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)3 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)3 Section (org.eclipse.ui.forms.widgets.Section)3 Token (org.antlr.v4.runtime.Token)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 Component (org.eclipse.titan.common.parsers.cfg.indices.ComponentSectionHandler.Component)2 Definition (org.eclipse.titan.common.parsers.cfg.indices.DefineSectionHandler.Definition)2 ExecuteItem (org.eclipse.titan.common.parsers.cfg.indices.ExecuteSectionHandler.ExecuteItem)2