Search in sources :

Example 1 with GroupSectionHandler

use of org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler in project titan.EclipsePlug-ins by eclipse.

the class GroupsSubPage method createNewGroup.

private Group createNewGroup() {
    if (groupSectionHandler == null) {
        return null;
    }
    final Group newGroup = new GroupSectionHandler.Group();
    final ParseTree root = new ParserRuleContext();
    newGroup.setRoot(root);
    final ParseTree groupName = new AddedParseTree("group_name");
    final ParseTree item = new AddedParseTree("item");
    newGroup.setGroupName(groupName);
    newGroup.setGroupItems(new ArrayList<GroupItem>());
    newGroup.getGroupItems().add(new GroupSectionHandler.GroupItem(item));
    ConfigTreeNodeUtilities.addChild(root, ConfigTreeNodeUtilities.createHiddenTokenNode("\n"));
    ConfigTreeNodeUtilities.addChild(root, groupName);
    ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(" := "));
    ConfigTreeNodeUtilities.addChild(root, item);
    return newGroup;
}
Also used : Group(org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler.Group) ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) GroupSectionHandler(org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler) GroupItem(org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler.GroupItem) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) AddedParseTree(org.eclipse.titan.common.parsers.AddedParseTree) ParseTree(org.antlr.v4.runtime.tree.ParseTree) GroupItem(org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler.GroupItem)

Aggregations

ParserRuleContext (org.antlr.v4.runtime.ParserRuleContext)1 ParseTree (org.antlr.v4.runtime.tree.ParseTree)1 AddedParseTree (org.eclipse.titan.common.parsers.AddedParseTree)1 GroupSectionHandler (org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler)1 Group (org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler.Group)1 GroupItem (org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler.GroupItem)1