Commit 85ae20be authored by earplov's avatar earplov
Browse files

code cleanup


Signed-off-by: default avatarearplov <arpad.lovassy@ericsson.com>
parent 30be7332
...@@ -11,7 +11,6 @@ import java.util.ArrayList; ...@@ -11,7 +11,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.antlr.v4.runtime.CommonToken; import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.WritableToken; import org.antlr.v4.runtime.WritableToken;
...@@ -288,28 +287,4 @@ public final class ConfigTreeNodeUtilities { ...@@ -288,28 +287,4 @@ public final class ConfigTreeNodeUtilities {
public static TerminalNodeImpl createHiddenTokenNode( final String aText ) { public static TerminalNodeImpl createHiddenTokenNode( final String aText ) {
return new TerminalNodeImpl( new CommonToken( 0, aText ) ); return new TerminalNodeImpl( new CommonToken( 0, aText ) );
} }
//TODO: remove, call directly
/**
* Builds parse tree text including hidden tokens (also before the rule)
* @param aParseTreeRoot root of the parse tree to print
* @param aTokens token list from the lexer (all, hidden and not hidden also)
* @return output parse tree text
*/
public static String toStringWithHiddenBefore( final ParseTree aParseTreeRoot,
final List<Token> aTokens ) {
return CfgParseTreePrinter.toStringWithHidden( aParseTreeRoot, aTokens, true );
}
//TODO: remove, call directly
/**
* Builds parse tree text including hidden tokens (but not before the rule)
* @param aParseTreeRoot root of the parse tree to print
* @param aTokens token list from the lexer (all, hidden and not hidden also)
* @return output parse tree text
*/
public static String toStringWithHidden( final ParseTree aParseTreeRoot,
final List<Token> aTokens ) {
return CfgParseTreePrinter.toStringWithHidden( aParseTreeRoot, aTokens, false );
}
} }
...@@ -20,7 +20,7 @@ import org.eclipse.jface.dialogs.ErrorDialog; ...@@ -20,7 +20,7 @@ import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.logging.ErrorReporter;
import org.eclipse.titan.common.parsers.cfg.CfgAnalyzer; import org.eclipse.titan.common.parsers.cfg.CfgAnalyzer;
import org.eclipse.titan.common.parsers.cfg.ConfigTreeNodeUtilities; import org.eclipse.titan.common.parsers.cfg.CfgParseTreePrinter;
import org.eclipse.titan.designer.editors.configeditor.pages.compgroupmc.ComponentsGroupsMCPage; import org.eclipse.titan.designer.editors.configeditor.pages.compgroupmc.ComponentsGroupsMCPage;
import org.eclipse.titan.designer.editors.configeditor.pages.execute.ExecuteExternalcommandsPage; import org.eclipse.titan.designer.editors.configeditor.pages.execute.ExecuteExternalcommandsPage;
import org.eclipse.titan.designer.editors.configeditor.pages.include.IncludeDefinePage; import org.eclipse.titan.designer.editors.configeditor.pages.include.IncludeDefinePage;
...@@ -237,7 +237,7 @@ public final class ConfigEditor extends FormEditor implements IResourceChangeLis ...@@ -237,7 +237,7 @@ public final class ConfigEditor extends FormEditor implements IResourceChangeLis
private void updateTextualPage() { private void updateTextualPage() {
if (mParseTreeRoot != null && mTokens != null) { if (mParseTreeRoot != null && mTokens != null) {
String original = editor.getDocument().get(); String original = editor.getDocument().get();
String content = ConfigTreeNodeUtilities.toStringWithHiddenBefore( mParseTreeRoot, mTokens ); String content = CfgParseTreePrinter.toStringWithHidden( mParseTreeRoot, mTokens, true );
if (!content.equals(original)) { if (!content.equals(original)) {
editor.getDocument().set(content); editor.getDocument().set(content);
......
...@@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.TableColumn; ...@@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import org.eclipse.titan.common.parsers.AddedParseTree; import org.eclipse.titan.common.parsers.AddedParseTree;
import org.eclipse.titan.common.parsers.cfg.CfgParseTreePrinter;
import org.eclipse.titan.common.parsers.cfg.ConfigTreeNodeUtilities; import org.eclipse.titan.common.parsers.cfg.ConfigTreeNodeUtilities;
import org.eclipse.titan.common.parsers.cfg.indices.ModuleParameterSectionHandler; import org.eclipse.titan.common.parsers.cfg.indices.ModuleParameterSectionHandler;
import org.eclipse.titan.common.parsers.cfg.indices.ModuleParameterSectionHandler.ModuleParameter; import org.eclipse.titan.common.parsers.cfg.indices.ModuleParameterSectionHandler.ModuleParameter;
...@@ -239,8 +240,8 @@ public final class ModuleParameterSectionPage extends FormPage { ...@@ -239,8 +240,8 @@ public final class ModuleParameterSectionPage extends FormPage {
ModuleParameter moduleParameter = (ModuleParameter) selection.getFirstElement(); ModuleParameter moduleParameter = (ModuleParameter) selection.getFirstElement();
if (moduleParameter != null) { if (moduleParameter != null) {
if (moduleParameter.getValue() != null) { if (moduleParameter.getValue() != null) {
final String moduleParamValueText = ConfigTreeNodeUtilities.toStringWithHidden( final String moduleParamValueText = CfgParseTreePrinter.toStringWithHidden(
moduleParameter.getValue(), editor.getTokens() ); moduleParameter.getValue(), editor.getTokens(), false );
parameterValueText.setText( moduleParamValueText ); parameterValueText.setText( moduleParamValueText );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment