diff --git a/Eclipse_Designer_userguide.doc b/Eclipse_Designer_userguide.doc index 5cec2bf02e6cd1663ab2d91f6a1b1f850475ba3e..516788cda8d7a95eb1b8dee685d997cf0b57fffe 100755 Binary files a/Eclipse_Designer_userguide.doc and b/Eclipse_Designer_userguide.doc differ diff --git a/TITAN_Designer_feature/feature.xml b/TITAN_Designer_feature/feature.xml index 21383b82d9279476a59230d5360dc6990bd49f17..180d0d15a8d5d6ea6e8e4a745c3d54c24debff5a 100755 --- a/TITAN_Designer_feature/feature.xml +++ b/TITAN_Designer_feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -10,37 +10,44 @@ <feature id="TITAN_Designer" label="TITAN_Designer_Feature" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" provider-name="Eclipse Titan Project"> <description url="http://ttcn.ericsson.se/download/update_site/releasenotes.pdf"> - CRL 113 200/5 R4C (5.4.pl2) version of the TITAN Designer plug-in. + CRL 113 200/5 R4D (5.4.pl3) version of the TITAN Designer plug-in. </description> <copyright> /******************************************************************************* -* Copyright (c) 2000-2015 Ericsson Telecom AB +* Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 +* are made available under the terms of the Eclipse Public License +v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: -* Zoltan Janos Szabo (Ericsson) - initial architecture design and implementation +* Zoltan Janos Szabo (Ericsson) - initial architecture design +and implementation * Roland Gecse (Ericsson) - initial architecture design -* Akos Cserveni (Ericsson) - Basic AST in compiler, semantic checking +* Akos Cserveni (Ericsson) - Basic AST in compiler, semantic +checking * Gabor Szalai (Ericsson) – RAW and TEXT codecs -* Matyas Forstner (Ericsson) - ASN.1 extension of the compiler and BER/CER/DER codecs -* Kristof Szabados (Ericsson) - Eclipse Designer, Executor, Titanium UIs +* Matyas Forstner (Ericsson) - ASN.1 extension of the compiler +and BER/CER/DER codecs +* Kristof Szabados (Ericsson) - Eclipse Designer, Executor, +Titanium UIs * Szabolcs Beres (Ericsson) - Eclipse LogViewer -* Ferenc Kovacs (Ericsson) – log interfaces, big number support, subtype checking +* Ferenc Kovacs (Ericsson) – log interfaces, big number support, +subtype checking * Csaba Raduly (Ericsson) – ASN.1 additions, XML encoder/decoder -* Adam Delic (Ericsson) – template restrictions, try and catch, support of pre-processor directives in Eclipse +* Adam Delic (Ericsson) – template restrictions, try and +catch, support of pre-processor directives in Eclipse * Krisztian Pandi (Ericsson) – import of imports * Peter Dimitrov (Ericsson)- maintenance * Balazs Andor Zalanyi (Ericsson) – code splitting * Gabor Szalai (Ericsson) – RAW encoding/decoding -* Jeno Attila Balasko (Ericsson) – tests +* Jeno Attila Balasko (Ericsson) – tests, maintenance * Csaba Feher (Ericsson) – epoll support * Tamas Buti (Ericsson)- maintenance * Szabolcs Beres (Ericsson) - Eclipse LogViever @@ -155,21 +162,21 @@ This Agreement is governed by the laws of the State of New York and the intellec id="org.eclipse.titan.designer" download-size="3841" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.help" download-size="10546" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.common" download-size="532" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> </feature> diff --git a/TITAN_Executor_feature/feature.xml b/TITAN_Executor_feature/feature.xml index f2f0c88d0fa8c017b1f19781e36842162bb51b0a..aff1d5b084ba97fe1c12137086b3a7d2c0ea1e26 100755 --- a/TITAN_Executor_feature/feature.xml +++ b/TITAN_Executor_feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -10,17 +10,17 @@ <feature id="TITAN_Executor" label="TITAN_Executor_Feature" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" provider-name="Eclipse Titan Project"> <description url="http://ttcn.ericsson.se/download/update_site/releasenotes.pdf"> - CRL 113 200/5 R4C (5.4.pl2) version of the TITAN Executor + CRL 113 200/5 R4D (5.4.pl3) version of the TITAN Executor plug-in. </description> <copyright> /******************************************************************************* -* Copyright (c) 2000-2015 Ericsson Telecom AB +* Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -138,6 +138,7 @@ This Agreement is governed by the laws of the State of New York and the intellec </url> <requires> + <import feature="TITAN_Designer" version="5.4.3" match="greaterOrEqual"/> <import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.debug.core"/> @@ -149,28 +150,27 @@ This Agreement is governed by the laws of the State of New York and the intellec <import plugin="org.eclipse.core.expressions"/> <import plugin="org.eclipse.core.filesystem"/> <import plugin="org.eclipse.ui.ide"/> - <import feature="TITAN_Designer" version="5.4.2" match="greaterOrEqual"/> </requires> <plugin id="org.eclipse.titan.executor" download-size="720" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.help" download-size="10546" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.common" download-size="532" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> </feature> diff --git a/TITAN_Log_Viewer_Feature/TITAN_Log_Viewer_Feature.iml b/TITAN_Log_Viewer_Feature/TITAN_Log_Viewer_Feature.iml index a3ad0437df739bb2d99d5dcd39c6389a957305db..529092389ca85fe072ff6fbda59c3984a8792475 100644 --- a/TITAN_Log_Viewer_Feature/TITAN_Log_Viewer_Feature.iml +++ b/TITAN_Log_Viewer_Feature/TITAN_Log_Viewer_Feature.iml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 diff --git a/TITAN_Log_Viewer_Feature/feature.xml b/TITAN_Log_Viewer_Feature/feature.xml index 8f5ddb9bc287247509f3a27f31f0a7c9938b7609..dd2e72fc478340831b4e4f602d43a4dc2a7f3063 100755 --- a/TITAN_Log_Viewer_Feature/feature.xml +++ b/TITAN_Log_Viewer_Feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -10,16 +10,16 @@ <feature id="TITAN_Log_Viewer" label="TITAN Log Viewer" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" provider-name="Eclipse Titan Project"> <description url="http://ttcn.ericsson.se/download/update_site/releasenotes.pdf"> - CRL 113 200/5 R4C (5.4.pl2) version of the TITAN Log Viewer plug-in. + CRL 113 200/5 R4D (5.4.pl3) version of the TITAN Log Viewer plug-in. </description> <copyright> /******************************************************************************* -* Copyright (c) 2000-2015 Ericsson Telecom AB +* Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -144,20 +144,20 @@ This Agreement is governed by the laws of the State of New York and the intellec id="org.eclipse.titan.log.viewer" download-size="0" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.common" download-size="0" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.help" download-size="0" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100"/> + version="5.4.3.CRL_113_200_5_R4D_20160301-1100"/> </feature> diff --git a/Titanium_feature/Titanium_feature.iml b/Titanium_feature/Titanium_feature.iml index a3ad0437df739bb2d99d5dcd39c6389a957305db..529092389ca85fe072ff6fbda59c3984a8792475 100644 --- a/Titanium_feature/Titanium_feature.iml +++ b/Titanium_feature/Titanium_feature.iml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 diff --git a/Titanium_feature/feature.xml b/Titanium_feature/feature.xml index 5bb3b849575fca0cef79aa9523bd5bb289a0fb57..8d922985586c8f99c010e963d0d98106e2ec9070 100755 --- a/Titanium_feature/feature.xml +++ b/Titanium_feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -10,17 +10,17 @@ <feature id="Titanium" label="Titanium_Feature" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" provider-name="Eclipse Titan Project"> <description url="http://ttcn.ericsson.se/download/update_site/releasenotes.pdf"> - CRL 113 200/5 R4C (5.4.pl2) version of the Titanium + CRL 113 200/5 R4D (5.4.pl3) version of the Titanium plug-in. </description> <copyright> /******************************************************************************* -* Copyright (c) 2000-2015 Ericsson Telecom AB +* Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -167,28 +167,28 @@ This Agreement is governed by the laws of the State of New York and the intellec id="org.eclipse.titanium" download-size="3841" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.designer" download-size="5894" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.help" download-size="10546" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> <plugin id="org.eclipse.titan.common" download-size="532" install-size="0" - version="5.4.2.CRL_113_200_5_R4C_20160105-1100" + version="5.4.3.CRL_113_200_5_R4D_20160301-1100" unpack="false"/> </feature> diff --git a/automatic_build/build_config.xml b/automatic_build/build_config.xml index 42d0c096f77525af1f26e225552d4074e69e5dbf..414e12fffcb309f8d6fcd60632e90a72d31c7dab 100644 --- a/automatic_build/build_config.xml +++ b/automatic_build/build_config.xml @@ -10,7 +10,7 @@ <project basedir="." name="config"> <!-- The qualifier of the features --> - <property name="version" value="5.4.2.CRL_113_200_5_R4C"/> + <property name="version" value="5.4.3.CRL_113_200_5_R4D"/> <tstamp/> <property name="timestamp" value="${DSTAMP}-${TSTAMP}"/> <property name="version.qualifier" value="${version}_${timestamp}"/> diff --git a/org.eclipse.titan.common/META-INF/MANIFEST.MF b/org.eclipse.titan.common/META-INF/MANIFEST.MF index 8dde50182d69a838f4c2e39daf191c58dcd55889..748a4c5bac4fd0746415da3c6cf8a303e1d0a679 100755 --- a/org.eclipse.titan.common/META-INF/MANIFEST.MF +++ b/org.eclipse.titan.common/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Created-By: 23.6-b04 (Oracle Corporation) Bundle-ManifestVersion: 2 Bundle-Name: Common TITAN on Eclipse Plug-in Bundle-SymbolicName: org.eclipse.titan.common;singleton:=true -Bundle-Version: 5.4.2.CRL_113_200_5_R4C_20160105-1100 +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 Bundle-Activator: org.eclipse.titan.common.Activator Bundle-Vendor: Eclipse Titan Project Require-Bundle: org.eclipse.ui, diff --git a/org.eclipse.titan.common/plugin.xml b/org.eclipse.titan.common/plugin.xml index 4ae6ae18e6f4ec3e563e778cc08eb64e8003c320..bd9abda91b4b8ad5a6fb2facab81ba6bb152faf7 100644 --- a/org.eclipse.titan.common/plugin.xml +++ b/org.eclipse.titan.common/plugin.xml @@ -1,75 +1,64 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html --> -<?eclipse version="3.2"?> +<?eclipse version="4.4"?> <plugin> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.common.actions.FormatLog" - id="org.eclipse.titan.common.actions.FormatLog" - name="FormatLog"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.common.actions.MergeLog" - id="org.eclipse.titan.common.actions.MergeLog" - name="FormatLog"/></extension> - <extension - point="org.eclipse.ui.menus"> - <menuContribution - locationURI="popup:org.eclipse.ui.popup.any?after=additions"> - <menu - label="Titan log"> - <command - commandId="org.eclipse.titan.common.actions.FormatLog" - label="Format log"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IResource"> - <test property="org.eclipse.core.resources.name" value="*.log"/> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titan.common.actions.MergeLog" - label="Merge log"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IResource"> - <test property="org.eclipse.core.resources.name" value="*.log"/> - </adapt> - </iterate> - </with> - </visibleWhen> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.common.actions.FormatLog" + id="org.eclipse.titan.common.actions.FormatLog" name="FormatLog" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.common.actions.MergeLog" + id="org.eclipse.titan.common.actions.MergeLog" name="FormatLog" /> + </extension> + <extension point="org.eclipse.ui.menus"> + <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions"> + <menu label="Titan log"> + <command commandId="org.eclipse.titan.common.actions.FormatLog" + label="Format log"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IResource"> + <test property="org.eclipse.core.resources.name" + value="*.log" /> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command commandId="org.eclipse.titan.common.actions.MergeLog" + label="Merge log"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IResource"> + <test property="org.eclipse.core.resources.name" + value="*.log" /> + </adapt> + </iterate> + </with> + </visibleWhen> - </command> - </menu> + </command> + </menu> </menuContribution> - </extension> + </extension> - <extension - point="org.eclipse.core.runtime.preferences"> - <initializer class="org.eclipse.titan.common.preferences.PreferenceInitializer"/> + <extension point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.titan.common.preferences.PreferenceInitializer" /> </extension> <extension point="org.eclipse.ui.preferencePages"> <page id="org.eclipse.titan.common.preferences.pages.TITANCommonPreferencePage" class="org.eclipse.titan.common.preferences.pages.TITANCommonPreferencePage" - name="TITAN Common Preferences"/> + name="TITAN Common Preferences" /> </extension> </plugin> diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/actions/MergeLog.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/actions/MergeLog.java index d23487382391289a95b220c23c080dc674de0b30..478944ef2feffcab00c70790ca3188e2549f201c 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/actions/MergeLog.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/actions/MergeLog.java @@ -36,7 +36,6 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.Activator; import org.eclipse.titan.common.graphics.ImageCache; import org.eclipse.titan.common.log.merge.LogMerger; @@ -123,7 +122,7 @@ public final class MergeLog extends AbstractHandler implements IWorkbenchWindowA * target of the merge. */ private void displayOutputSelectionDialog() { - final FileDialog dialog = new FileDialog(new Shell(Display.getDefault()), SWT.SAVE); + final FileDialog dialog = new FileDialog(null, SWT.SAVE); if (staticOutput != null) { dialog.setFileName(staticOutput.getName()); dialog.setFilterPath(staticOutput.getParent()); @@ -212,7 +211,7 @@ public final class MergeLog extends AbstractHandler implements IWorkbenchWindowA "Overwrite" }; MessageDialogWithToggle msgDialog = new MessageDialogWithToggle( - new Shell(Display.getDefault()), + null, "File already exists", null, "An error occured during log file merging. The file '" diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/logging/ErrorReporter.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/logging/ErrorReporter.java index 9c4e55ddd34733d50ff6fbde0358d9062bffaeeb..3db9dd02185e486555d7987c0b13989bfed88c21 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/logging/ErrorReporter.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/logging/ErrorReporter.java @@ -13,7 +13,6 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.product.ProductConstants; import org.eclipse.ui.IEditorPart; @@ -170,7 +169,7 @@ public final class ErrorReporter { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), title, message); //$NON-NLS-1$ + MessageDialog.openError(null, title, message); //$NON-NLS-1$ } }); } @@ -184,7 +183,7 @@ public final class ErrorReporter { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openWarning(new Shell(Display.getDefault()), title, message); + MessageDialog.openWarning(null, title, message); } }); } diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/LocationAST.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/LocationAST.java index 2ef4dd360a4f4fed6f457ec42138ee1c760941fb..ae861a67d0d6ab616a6e076da6e60d0b4c0de6a4 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/LocationAST.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/LocationAST.java @@ -46,8 +46,7 @@ public class LocationAST { sb.append("" + mRule.stop + ", "); sb.append("" + mRule.getChildCount() + ", " ); sb.append(mRule.getText() + "}" ); - } - else { + } else { sb.append("null"); } sb.append(", " ); diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/TitanListener.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/TitanListener.java index 9803a1adccd65875bffa3074751fcb7fbb2eaac4..7cb46db97851c356d1fc953b664003304b67cfbc 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/TitanListener.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/TitanListener.java @@ -23,7 +23,7 @@ public class TitanListener extends BaseErrorListener { public TitanListener() { this.errorsStored = new ArrayList<SyntacticErrorStorage>(); } - public TitanListener(ArrayList<SyntacticErrorStorage> storage) { + public TitanListener(List<SyntacticErrorStorage> storage) { this.errorsStored = storage; } diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CFGNumber.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CFGNumber.java index 8a455acadfdad692bf47fa23613f5116564cf14d..c0191a0a7fb2665d9e9fc0c7e338e6412e08cdfb 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CFGNumber.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CFGNumber.java @@ -11,13 +11,18 @@ import java.math.BigInteger; /** * @author Kristof Szabados - * */ + * @author Arpad Lovassy + */ public final class CFGNumber { private static final String DIV_BY_ZERO = "Division by zero"; private boolean isFloatNumber; private float floatNumber; private BigInteger intNumber; + /** + * Constructor + * @param text the string representation of the number. The constructor will decide if it will be stored as float or integer + */ public CFGNumber(final String text) { try { floatNumber = Float.parseFloat(text); @@ -33,6 +38,9 @@ public final class CFGNumber { return isFloatNumber; } + /** + * @return this + num + */ public void add(final CFGNumber num) { if (isFloatNumber) { if (num.isFloatNumber) { @@ -50,6 +58,29 @@ public final class CFGNumber { } } + /** + * @return this - num + */ + public void sub(final CFGNumber num) { + if (isFloatNumber) { + if (num.isFloatNumber) { + floatNumber -= num.floatNumber; + } else { + floatNumber -= num.intNumber.floatValue(); + } + } else { + if (num.isFloatNumber) { + isFloatNumber = true; + floatNumber = intNumber.floatValue() - num.floatNumber; + } else { + intNumber = intNumber.subtract(num.intNumber); + } + } + } + + /** + * @return this * num + */ public void mul(final int num) { if (isFloatNumber) { floatNumber *= num; @@ -58,6 +89,9 @@ public final class CFGNumber { } } + /** + * @return this * num + */ public void mul(final CFGNumber num) { if (isFloatNumber) { if (num.isFloatNumber) { @@ -75,6 +109,10 @@ public final class CFGNumber { } } + /** + * @return this / num + * @throws ArithmeticException if num == 0 + */ public void div(final CFGNumber num) throws ArithmeticException { if (isFloatNumber) { if (num.isFloatNumber) { @@ -108,7 +146,7 @@ public final class CFGNumber { public String toString() { if (isFloatNumber) { // "Infinity" is not a valid value in a configuration file. - if ((floatNumber == Float.NEGATIVE_INFINITY) || (floatNumber == Float.POSITIVE_INFINITY)) { + if (Float.isInfinite(floatNumber)) { return "0.0"; } return Float.toString(floatNumber); @@ -116,4 +154,26 @@ public final class CFGNumber { return intNumber.toString(); } + + /** + * @return float value of the number + */ + public Double getValue() { + if ( isFloatNumber ) { + return new Double( floatNumber ); + } else { + return intNumber.doubleValue(); + } + } + + /** + * @return integer value, or null if number is float + */ + public Integer getIntegerValue() { + if ( isFloatNumber ) { + return null; + } else { + return intNumber.intValue(); + } + } } diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgAnalyzer.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgAnalyzer.java index ea36737a5dc61a2ccf493c70a2399b16e89cd0ed..be798adc4d7a6c82bdc688a850f7fe6bea3c507c 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgAnalyzer.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgAnalyzer.java @@ -66,6 +66,11 @@ public final class CfgAnalyzer { private LoggingSectionHandler loggingSectionHandler = null; private ParserRuleContext mParseTreeRoot = null; private String mLogFileName = null; + private Integer mTcpPort = null; + private String mLocalAddress = null; + private Double mKillTimer = null; + private Integer mNumHcs = null; + private Boolean mUnixDomainSocket = null; public List<TITANMarker> getWarnings() { return warnings; @@ -83,6 +88,26 @@ public final class CfgAnalyzer { return mLogFileName; } + public Integer getTcpPort() { + return mTcpPort; + } + + public String getLocalAddress() { + return mLocalAddress; + } + + public Double getKillTimer() { + return mKillTimer; + } + + public Integer getNumHcs() { + return mNumHcs; + } + + public Boolean isUnixDomainSocketEnabled() { + return mUnixDomainSocket; + } + public Map<String, CfgDefinitionInformation> getDefinitions(){ return definitions; } @@ -146,11 +171,9 @@ public final class CfgAnalyzer { public List<SyntacticErrorStorage> getErrorStorage() { if (!lexerListener.getErrorsStored().isEmpty() && parserListener.getErrorsStored().isEmpty()) { return lexerListener.getErrorsStored(); - } - else if (lexerListener.getErrorsStored().isEmpty() && !parserListener.getErrorsStored().isEmpty()) { + } else if (lexerListener.getErrorsStored().isEmpty() && !parserListener.getErrorsStored().isEmpty()) { return parserListener.getErrorsStored(); - } - else if (!lexerListener.getErrorsStored().isEmpty() && !parserListener.getErrorsStored().isEmpty()) { + } else if (!lexerListener.getErrorsStored().isEmpty() && !parserListener.getErrorsStored().isEmpty()) { if (lexerListener.addAll(parserListener.getErrorsStored())) { return lexerListener.getErrorsStored(); } @@ -186,8 +209,7 @@ public final class CfgAnalyzer { Reader reader = null; if (null != code) { reader = new StringReader(code); - } - else if (null != file) { + } else if (null != file) { try { reader = new BufferedReader(new InputStreamReader(file.getContents(), StandardCharsets.UTF8)); } catch (CoreException e) { @@ -217,7 +239,8 @@ public final class CfgAnalyzer { //TODO: implement: fill rootInterval if needed definitions = parser.getDefinitions(); - mExecuteElements = parser.getExecuteElements(); + final CfgParseResult cfgParseResult = parser.getCfgParseResult(); + mExecuteElements = cfgParseResult.getExecuteElements(); includeFiles = parser.getIncludeFiles(); // fill handlers @@ -233,8 +256,12 @@ public final class CfgAnalyzer { defineSectionHandler = parser.getDefineSectionHandler(); loggingSectionHandler = parser.getLoggingSectionHandler(); - logFileNameDefined = parser.isLogFileDefined(); - mLogFileName = parser.getLogFileName(); + logFileNameDefined = cfgParseResult.isLogFileDefined(); + mLogFileName = cfgParseResult.getLogFileName(); + mTcpPort = cfgParseResult.getTcpPort(); + mLocalAddress = cfgParseResult.getLocalAddress(); + mKillTimer = cfgParseResult.getKillTimer(); + mNumHcs = cfgParseResult.getNumHcs(); + mUnixDomainSocket = cfgParseResult.isUnixDomainSocket(); } - } diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParseResult.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParseResult.java index cbd5a1ee0b93bee9f092a100cf2e9fabbfac6262..e507e904d329ec42618211fab4e7e11cada4b1c6 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParseResult.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParseResult.java @@ -27,21 +27,58 @@ public class CfgParseResult { private List<String> mIncludeFiles = new ArrayList<String>(); + /** + * true if and only if LogFile parameter is defined in [LOGGING] section + */ private boolean mLogFileDefined = false; + /** + * Format string of the log file. <br> + * This value is read from the [LOGGING] section with this parameter: + * <pre> + * LogFile := "<log_file_name>" + * </pre> + * where log_file_name is a relative file name to the bin/ directory of the TTCN-3 project, + * it must contain "%n" (node), which will be for example "hc" or "mtc". <br> + * Example: + * <pre> + * LogFile := "../log/MyExample-%n.log" + * </pre> + * This will create the following log files if there is 1 HC: <br> + * <project_dir>/log/MyExample-hc.log <br> + * <project_dir>/log/MyExample-mtc.log + */ + private String mLogFileName = null; + private Integer mTcpPort = null; private String mLocalAddress = null; + /** + * Setting for kill timer (in seconds). + * The executing process is killed, if there is no answer form the Main Controller. <br> + * NOTE: this value has effect only for the Titan Eclipse Executor plug-in, works only in JNI Executor mode <br> + * This value is read from the [MAIN_CONTROLLER] section with this parameter: + * <pre> + * KillTimer := <float>; + * </pre> + */ private Double mKillTimer = null; + /** + * Number of Host Controllers. <br> + * This value is read from the [MAIN_CONTROLLER] section with this parameter: + * <pre> + * NumHCs := <integer>; + * </pre> + */ private Integer mNumHcs = null; private Boolean mUnixDomainSocket = null; private Map<String, String> mComponents = new HashMap<String, String>(); - private Map<String , String[]> mGroups = new HashMap<String, String[]>(); + private Map<String, String[]> mGroups = new HashMap<String, String[]>(); private List<String> mExecuteElements = new ArrayList<String>(); @@ -77,6 +114,14 @@ public class CfgParseResult { this.mLogFileDefined = aLogFileDefined; } + public String getLogFileName() { + return mLogFileName; + } + + public void setLogFileName(String aLogFileName) { + this.mLogFileName = aLogFileName; + } + public Integer getTcpPort() { return mTcpPort; } @@ -109,7 +154,7 @@ public class CfgParseResult { this.mNumHcs = aNumHcs; } - public Boolean getUnixDomainSocket() { + public Boolean isUnixDomainSocket() { return mUnixDomainSocket; } diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParser.g4 b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParser.g4 index 593f49ac8fd4684c3d08c2305a6210abbcd51f8d..2fbd0b53dbd566b55889842cdfec4c7c7ac87812 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParser.g4 +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParser.g4 @@ -22,6 +22,16 @@ import java.util.Map; } @members{ + // format strings for error messages if definition (macro or environment variable) cannot be resolved + // %s : definition + private static final String DEFINITION_NOT_FOUND_STRING = "Could not resolve definition: %s using \"\" as a replacement."; + private static final String DEFINITION_NOT_FOUND_BSTR = "Could not resolve definition: %s using ''B as a replacement."; + private static final String DEFINITION_NOT_FOUND_HSTR = "Could not resolve definition: %s using ''H as a replacement."; + private static final String DEFINITION_NOT_FOUND_OSTR = "Could not resolve definition: %s using ''O as a replacement."; + private static final String DEFINITION_NOT_FOUND_INT = "Could not resolve integer definition: %s using 0 as replacement."; + private static final String DEFINITION_NOT_FOUND_FLOAT = "No macro or environmental variable defined %s could be found, using 0.0 as a replacement value."; + private static final String DEFINITION_NOT_FOUND_BOOLEAN = "Could not resolve definition: %s using \"true\" as a replacement."; + private List<TITANMarker> mWarnings = new ArrayList<TITANMarker>(); private List<ISection> mSections = new ArrayList<ISection>(); @@ -32,20 +42,10 @@ import java.util.Map; private IFile mActualFile = null; - private boolean mLogFileDefined = false; - - private String mLogFileName = null; - private Map<String, String> mEnvVariables; - private Integer mTcpPort = null; - private String mLocalAddress = null; - private Double mKillTimer = null; - private Integer mNumHcs = null; - private Boolean mUnixDomainSocket = null; - private Map<String, String> mComponents = new HashMap<String, String>(); - private Map<String , String[]> mGroups = new HashMap<String, String[]>(); - private List<String> mExecuteElements = new ArrayList<String>(); + private CfgParseResult mCfgParseResult = new CfgParseResult(); + private int mLine = 1; private int mOffset = 0; @@ -89,44 +89,8 @@ import java.util.Map; mActualFile = file; } - public boolean isLogFileDefined() { - return mLogFileDefined; - } - - public String getLogFileName() { - return mLogFileName; - } - - public Integer getTcpPort() { - return mTcpPort; - } - - public String getLocalAddress() { - return mLocalAddress; - } - - public Double getKillTimer() { - return mKillTimer; - } - - public Integer getNumHcs() { - return mNumHcs; - } - - public Boolean isUnixDomainSocketEnabled() { - return mUnixDomainSocket; - } - - public Map<String, String> getComponents() { - return mComponents; - } - - public Map<String, String[]> getGroups() { - return mGroups; - } - - public List<String> getExecuteElements() { - return mExecuteElements; + public CfgParseResult getCfgParseResult() { + return mCfgParseResult; } public void setEnvironmentalVariables(Map<String, String> aEnvVariables){ @@ -225,6 +189,84 @@ import java.util.Map; return null; } } + + /** + * Gets the macro value string of a macro (without type) + * @param aMacroToken the macro token + * @param aErrorFormatStr format strings for error messages if definition (macro or environment variable) cannot be resolved + * %s : definition + * @return the macro value string + * or "" if macro is invalid. In this case an error marker is also created + */ + private String getMacroValue( Token aMacroToken, String aErrorFormatStr ) { + String definition = aMacroToken.getText().substring( 1, aMacroToken.getText().length() ); + String value = getDefinitionValue( definition ); + if ( value == null ) { + String errorMsg = String.format( aErrorFormatStr, definition ); + reportError( errorMsg, aMacroToken, aMacroToken ); + return ""; + } + return value; + } + + /** + * Gets the macro value string of a macro (without type) + * @param aMacroRule the macro rule + * @param aErrorFormatStr format strings for error messages if definition (macro or environment variable) cannot be resolved + * %s : definition + * @return the macro value string + * or "" if macro is invalid. In this case an error marker is also created + */ + private String getMacroValue( ParserRuleContext aMacroRule, String aErrorFormatStr ) { + String definition = aMacroRule.getText().substring( 1, aMacroRule.getText().length() ); + String value = getDefinitionValue( definition ); + if ( value == null ) { + String errorMsg = String.format( aErrorFormatStr, definition ); + reportError( errorMsg, aMacroRule.start, aMacroRule.stop ); + return ""; + } + return value; + } + + /** + * Gets the macro value string of a macro (with type) + * @param aMacroToken the macro token + * @param aErrorFormatStr format strings for error messages if definition (macro or environment variable) cannot be resolved + * %s : definition + * @return the macro value string + * or "" if macro is invalid. In this case an error marker is also created + */ + private String getTypedMacroValue( Token aMacroToken, String aErrorFormatStr ) { + int commaPosition = aMacroToken.getText().indexOf( ',' ); + String definition = aMacroToken.getText().substring( 2, commaPosition ); + String value = getDefinitionValue( definition ); + if ( value == null ) { + String errorMsg = String.format( aErrorFormatStr, definition ); + reportError( errorMsg, aMacroToken, aMacroToken ); + return ""; + } + return value; + } + + /** + * Gets the macro value string of a macro (with type) + * @param aMacroRule the macro rule + * @param aErrorFormatStr format strings for error messages if definition (macro or environment variable) cannot be resolved + * %s : definition + * @return the macro value string + * or "" if macro is invalid. In this case an error marker is also created + */ + private String getTypedMacroValue( ParserRuleContext aMacroRule, String aErrorFormatStr ) { + int commaPosition = aMacroRule.getText().indexOf( ',' ); + String definition = aMacroRule.getText().substring( 2, commaPosition ); + String value = getDefinitionValue( definition ); + if ( value == null ) { + String errorMsg = String.format( aErrorFormatStr, definition ); + reportError( errorMsg, aMacroRule.start, aMacroRule.stop ); + return ""; + } + return value; + } } options{ @@ -244,8 +286,7 @@ pr_ConfigFile: pr_Section returns [ ISection section ]: { $section = null; } -( pr_DefaultSection -| pr_MainControllerSection +( pr_MainControllerSection | i = pr_IncludeSection { $section = $i.includeSection; } | pr_OrderedIncludeSection | pr_ExecuteSection @@ -260,13 +301,6 @@ pr_Section returns [ ISection section ]: ) ; -pr_DefaultSection: -( WS -| LINE_COMMENT -| BLOCK_COMMENT -) -; - pr_MainControllerSection: MAIN_CONTROLLER_SECTION ( pr_MainControllerItem SEMICOLON1? @@ -284,36 +318,30 @@ pr_MainControllerItem: pr_MainControllerItemUnixDomainSocket: UNIXSOCKETS1 ASSIGNMENTCHAR1 u = (YES1 | NO1) SEMICOLON1? - { mUnixDomainSocket = Boolean.parseBoolean( $u.getText() ); + { mCfgParseResult.setUnixDomainSocket( Boolean.parseBoolean( $u.getText() ) ); } ; pr_MainControllerItemKillTimer: KILLTIMER1 ASSIGNMENTCHAR1 k = pr_ArithmeticValueExpression SEMICOLON1? - { try { - mKillTimer = Double.parseDouble( $k.text ); - } catch( NumberFormatException e ) {} + { mCfgParseResult.setKillTimer( $k.number.getValue() ); } ; pr_MainControllerItemLocalAddress: LOCALADDRESS1 ASSIGNMENTCHAR1 l = pr_HostName SEMICOLON1? - { mLocalAddress = $l.text; } + { mCfgParseResult.setLocalAddress( $l.text ); } ; pr_MainControllerItemNumHcs: NUMHCS1 ASSIGNMENTCHAR1 n = pr_IntegerValueExpression SEMICOLON1? - { try { - mNumHcs = Integer.parseInt( $n.text ); - } catch( NumberFormatException e ) {} + { mCfgParseResult.setNumHcs( $n.number.getIntegerValue() ); } ; pr_MainControllerItemTcpPort: TCPPORT1 ASSIGNMENTCHAR1 t = pr_IntegerValueExpression SEMICOLON1? - { try { - mTcpPort = Integer.parseInt( $t.text ); - } catch( NumberFormatException e ) {} + { mCfgParseResult.setTcpPort( $t.number.getIntegerValue() ); } ; @@ -341,7 +369,7 @@ pr_ExecuteSection: ; pr_ExecuteSectionItem: - t = TEST3 { mExecuteElements.add( $t.getText() ); } + t = TEST3 { mCfgParseResult.getExecuteElements().add( $t.getText() ); } SEMICOLON3? ; @@ -438,16 +466,20 @@ pr_DisableCoverage: pr_DatabaseFile: DATABASEFILE ASSIGNMENTCHAR12 - ( STRING12 - | MACRO12 - ) + pr_DatabaseFilePart ( AND12 - ( STRING12 - | MACRO12 - ) + pr_DatabaseFilePart )* ; +pr_DatabaseFilePart: +( STRING12 +| macro = MACRO12 + { String value = getMacroValue( $macro, DEFINITION_NOT_FOUND_STRING ); + //TODO: implement: use value if needed + } +); + pr_AggregateData: AGGREGATEDATA ASSIGNMENTCHAR12 @@ -459,16 +491,22 @@ pr_AggregateData: pr_StatisticsFile: STATISTICSFILE ASSIGNMENTCHAR12 - ( STRING12 - | MACRO12 - ) + pr_StatisticsFilePart ( AND12 - ( STRING12 - | MACRO12 - ) + pr_StatisticsFilePart )* ; +// currently it is the same as pr_DatabaseFilePart, +// but it will be different if value is used +pr_StatisticsFilePart: +( STRING12 +| macro = MACRO12 + { String value = getMacroValue( $macro, DEFINITION_NOT_FOUND_STRING ); + //TODO: implement: use value if needed + } +); + pr_DisableStatistics: DISABLESTATISTICS ASSIGNMENTCHAR12 @@ -587,15 +625,12 @@ pr_PlainLoggingParam: | LOGFILENUMBER ASSIGNMENTCHAR11 pr_Number | LOGFILESIZE ASSIGNMENTCHAR11 pr_Number | LOGFILENAME ASSIGNMENTCHAR11 f = pr_LogfileName - { mLogFileDefined = true; - mLogFileName = $f.text; - if ( mLogFileName != null ) { - if ( mLogFileName.length() > 0 && mLogFileName.startsWith( "\"" ) ) { - mLogFileName = mLogFileName.substring( 1 ); - } - if ( mLogFileName.length() > 0 && mLogFileName.endsWith( "\"" ) ) { - mLogFileName = mLogFileName.substring( 0, mLogFileName.length() - 1 ); - } + { mCfgParseResult.setLogFileDefined( true ); + String logFileName = $f.text; + if ( logFileName != null ) { + // remove quotes + logFileName = logFileName.replaceAll("^\"|\"$", ""); + mCfgParseResult.setLogFileName( logFileName ); } } | (TIMESTAMPFORMAT | CONSOLETIMESTAMPFORMAT) ASSIGNMENTCHAR11 TIMESTAMPVALUE @@ -718,8 +753,8 @@ pr_Detailed: pr_ComponentItem: n = pr_ComponentName ASSIGNMENTCHAR10 - ( h = pr_HostName { mComponents.put( $n.text, $h.text ); } - | i = IPV6_10 { mComponents.put( $n.text, $i.getText() ); } + ( h = pr_HostName { mCfgParseResult.getComponents().put( $n.text, $h.text ); } + | i = IPV6_10 { mCfgParseResult.getComponents().put( $n.text, $i.getText() ); } ) ; @@ -732,7 +767,10 @@ pr_ComponentName: pr_HostName: ( pr_DNSName | TTCN3IDENTIFIER1 | TTCN3IDENTIFIER10 -| MACRO_HOSTNAME1 | MACRO_HOSTNAME10 +| macro = (MACRO_HOSTNAME1 | MACRO_HOSTNAME10) + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_STRING ); + //TODO: implement: use value if needed + } ) ; @@ -811,103 +849,98 @@ pr_TestportName: ) ; -pr_Identifier: -( MACRO_ID7 | MACRO_ID8 | MACRO_ID9 | MACRO_ID10 | MACRO_ID11 -| TTCN3IDENTIFIER7 | TTCN3IDENTIFIER8 | TTCN3IDENTIFIER9 | TTCN3IDENTIFIER10 | TTCN3IDENTIFIER11 +pr_Identifier returns [String identifier]: +( macro = (MACRO_ID7 | MACRO_ID8 | MACRO_ID9 | MACRO_ID10 | MACRO_ID11) + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_STRING ); + $identifier = value; + } +| a = (TTCN3IDENTIFIER7 | TTCN3IDENTIFIER8 | TTCN3IDENTIFIER9 | TTCN3IDENTIFIER10 | TTCN3IDENTIFIER11) + { $identifier = $a.getText(); } ) ; -pr_IntegerValueExpression: - pr_IntegerAddExpression +pr_IntegerValueExpression returns [CFGNumber number]: + a = pr_IntegerAddExpression { $number = $a.number; } ; -pr_IntegerAddExpression: - pr_IntegerMulExpression - ( ( PLUS1 | PLUS7 | PLUS9 - | MINUS1 | MINUS7 | MINUS9 - ) - pr_IntegerMulExpression +pr_IntegerAddExpression returns [CFGNumber number]: + a = pr_IntegerMulExpression { $number = $a.number; } + ( ( PLUS1 | PLUS7 | PLUS9 ) b1 = pr_IntegerMulExpression { $number.add($b1.number); } + | ( MINUS1 | MINUS7 | MINUS9 ) b2 = pr_IntegerMulExpression { $b2.number.mul(-1); $number.add($b2.number); } )* ; -pr_IntegerMulExpression: - pr_IntegerUnaryExpression - ( ( STAR1 | STAR7 | STAR9 - | SLASH1 | SLASH7 | SLASH9 - ) - pr_IntegerUnaryExpression +pr_IntegerMulExpression returns [CFGNumber number]: + a = pr_IntegerUnaryExpression { $number = $a.number; } + ( ( STAR1 | STAR7 | STAR9 ) b1 = pr_IntegerUnaryExpression { $number.mul($b1.number); } + | ( SLASH1 | SLASH7 | SLASH9 ) b2 = pr_IntegerUnaryExpression + { try { + $number.div($b2.number); + } catch ( ArithmeticException e ) { + // division by 0 + reportError( e.getMessage(), $a.start, $b2.stop ); + $number = new CFGNumber( "0" ); + } + } )* ; -pr_IntegerUnaryExpression: - ( PLUS1 | PLUS7 | PLUS9 - | MINUS1 | MINUS7 | MINUS9 - )? - pr_IntegerPrimaryExpression +pr_IntegerUnaryExpression returns [CFGNumber number]: +{ boolean negate = false; +} + ( (PLUS1 | PLUS7 | PLUS9) + | (MINUS1 | MINUS7 | MINUS9) { negate = !negate; } + )* + a = pr_IntegerPrimaryExpression + { $number = $a.number; + if ( negate ) { + $number.mul( -1 ); + } + } ; -pr_IntegerPrimaryExpression: -( pr_Number -| LPAREN1 pr_IntegerAddExpression RPAREN1 -| LPAREN7 pr_IntegerAddExpression RPAREN7 -| LPAREN9 pr_IntegerAddExpression RPAREN9 +pr_IntegerPrimaryExpression returns [CFGNumber number]: +( a = pr_Number { $number = $a.number; } +| LPAREN1 b = pr_IntegerAddExpression RPAREN1 { $number = $b.number; } +| LPAREN7 c = pr_IntegerAddExpression RPAREN7 { $number = $c.number; } +| LPAREN9 d = pr_IntegerAddExpression RPAREN9 { $number = $d.number; } ) ; -pr_Number: -( NUMBER1 | NUMBER7 | NUMBER9 | NUMBER11 -| MACRO_INT1 | MACRO_INT7 | MACRO_INT9 | MACRO_INT11 +pr_Number returns [CFGNumber number]: +( a = (NUMBER1 | NUMBER7 | NUMBER9 | NUMBER11) {$number = new CFGNumber($a.text);} +| macro = (MACRO_INT1 | MACRO_INT7 | MACRO_INT9 | MACRO_INT11) + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_INT ); + $number = new CFGNumber( value.length() > 0 ? value : "0" ); + } ) ; -pr_StringValue: - pr_CString - ( (STRINGOP1 | STRINGOP7 | STRINGOP9 | STRINGOP11) pr_CString +pr_StringValue returns [String string]: + a = pr_CString { $string = $a.string.replaceAll("^\"|\"$", ""); } + ( (STRINGOP1 | STRINGOP7 | STRINGOP9 | STRINGOP11) b = pr_CString { $string = $string + $b.string.replaceAll("^\"|\"$", ""); } )* + { $string = "\"" + $string + "\""; } ; -pr_CString: -( STRING1 | STRING7 | STRING9 | STRING11 -| macro2 = pr_MacroCString - { -//TODO -/* - String definition = $macro2.text.substring(1, $macro2.text.length()); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if ( value != null ) { - tempAST.initialize(STRING,"\""+value+"\""); - } else { - tempAST.initialize(STRING,"\"\""); - reportError( "Could not resolve definition: " + definition + " using \"\" as a replacement.", $macro2.start, $macro2.stop ); - } -//*/ - } -| macro1 = pr_MacroExpliciteCString - { -//TODO -/* - int commaPosition = $macro1.text.indexOf(','); - String definition = $macro1.text.substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if ( value != null ) { - tempAST.initialize(STRING,"\""+value+"\""); - } else { - tempAST.initialize(STRING,"\"\""); - reportError( "Could not resolve definition: " + definition + " using \"\" as a replacement.", $macro1.start, $macro1.stop ); - } -//*/ +pr_CString returns [String string]: +( a = (STRING1 | STRING7 | STRING9 | STRING11) + { + $string = $a.text; } +| macro2 = pr_MacroCString { $string = "\"" + $macro2.string + "\""; } +| macro1 = pr_MacroExpliciteCString { $string = "\"" + $macro1.string + "\""; } ) ; -pr_MacroCString: - (MACRO1 | MACRO7 | MACRO9 | MACRO11) +pr_MacroCString returns [String string]: + macro = (MACRO1 | MACRO7 | MACRO9 | MACRO11) + { $string = getMacroValue( $macro, DEFINITION_NOT_FOUND_STRING ); } ; -pr_MacroExpliciteCString: - (MACRO_EXP_CSTR1 | MACRO_EXP_CSTR7 | MACRO_EXP_CSTR9 | MACRO_EXP_CSTR11) +pr_MacroExpliciteCString returns [String string]: + macro = (MACRO_EXP_CSTR1 | MACRO_EXP_CSTR7 | MACRO_EXP_CSTR9 | MACRO_EXP_CSTR11) + { $string = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_STRING ); } ; pr_GroupItem: @@ -925,7 +958,7 @@ pr_GroupItem: )* ) ) -{ mGroups.put( $a.text, memberlist.toArray( new String[ memberlist.size() ] ) ); +{ mCfgParseResult.getGroups().put( $a.text, memberlist.toArray( new String[ memberlist.size() ] ) ); } ; @@ -995,53 +1028,74 @@ pr_LengthBound: pr_IntegerValueExpression ; -pr_ArithmeticValueExpression: - pr_ArithmeticAddExpression +pr_ArithmeticValueExpression returns [CFGNumber number]: + a = pr_ArithmeticAddExpression { $number = $a.number; } ; -pr_ArithmeticAddExpression: - pr_ArithmeticMulExpression - ( ( PLUS1 | PLUS9 - | MINUS1 | MINUS9 - ) - pr_ArithmeticMulExpression +pr_ArithmeticAddExpression returns [CFGNumber number]: + a = pr_ArithmeticMulExpression { $number = $a.number; } + ( ( PLUS1 | PLUS9 ) b1 = pr_ArithmeticMulExpression { $number.add($b1.number); } + | ( MINUS1 | MINUS9 ) b2 = pr_ArithmeticMulExpression { $b2.number.mul(-1); $number.add($b2.number); } )* ; -pr_ArithmeticMulExpression: - pr_ArithmeticUnaryExpression - ( ( STAR1 | STAR9 - | SLASH1 | SLASH9 - ) - pr_ArithmeticUnaryExpression +pr_ArithmeticMulExpression returns [CFGNumber number]: + a = pr_ArithmeticUnaryExpression { $number = $a.number; } + ( ( STAR1 | STAR9 ) b1 = pr_ArithmeticUnaryExpression { $number.mul($b1.number); } + | ( SLASH1 | SLASH9 ) b2 = pr_ArithmeticUnaryExpression + { try { + $number.div($b2.number); + } catch ( ArithmeticException e ) { + // division by 0 + reportError( e.getMessage(), $a.start, $b2.stop ); + $number = new CFGNumber( "0.0" ); + } + } )* ; -pr_ArithmeticUnaryExpression: - ( PLUS1 | PLUS9 - | MINUS1 | MINUS9 +pr_ArithmeticUnaryExpression returns [CFGNumber number]: +{ boolean negate = false; +} + ( ( PLUS1 | PLUS9 ) + | ( MINUS1 | MINUS9 ) { negate = !negate; } )* - pr_ArithmeticPrimaryExpression + a = pr_ArithmeticPrimaryExpression + { $number = $a.number; + if ( negate ) { + $number.mul( -1 ); + } + } ; -pr_ArithmeticPrimaryExpression: -( pr_Float -| pr_Number -| LPAREN1 pr_ArithmeticAddExpression RPAREN1 -| LPAREN9 pr_ArithmeticAddExpression RPAREN9 +pr_ArithmeticPrimaryExpression returns [CFGNumber number]: +( a = pr_Float {$number = $a.number;} +| b = pr_Number {$number = $b.number;} +| LPAREN1 c = pr_ArithmeticAddExpression RPAREN1 {$number = $c.number;} +| LPAREN9 d = pr_ArithmeticAddExpression RPAREN9 {$number = $d.number;} ) ; -pr_Float: -( FLOAT1 | FLOAT9 -| MACRO_FLOAT1 | MACRO_FLOAT9 +pr_Float returns [CFGNumber number]: +( a = (FLOAT1 | FLOAT9) {$number = new CFGNumber($a.text);} +| macro = (MACRO_FLOAT1 | MACRO_FLOAT9) + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_FLOAT ); + $number = new CFGNumber( value.length() > 0 ? value : "0.0" ); + } ) ; -pr_Boolean: -( TRUE9 | TRUE11 -| FALSE9 | FALSE11 -| MACRO_BOOL9 | MACRO_BOOL11 +pr_Boolean returns [String string]: +( t = (TRUE9 | TRUE11) { $string = $t.getText(); } +| f = (FALSE9 | FALSE11) { $string = $f.getText(); } +| macro = (MACRO_BOOL9 | MACRO_BOOL11) + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_BOOLEAN ); + if ( "false".equals( value ) ) { + $string = "false"; + } else { + $string = "true"; + } + } ) ; @@ -1068,9 +1122,12 @@ pr_BStringValue: pr_BString ( STRINGOP9 pr_BString )* ; -pr_BString: -( BITSTRING9 -| MACRO_BSTR9 +pr_BString returns [String string]: +( b = BITSTRING9 { $string = $b.getText(); } +| macro = MACRO_BSTR9 + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_BSTR ); + $string = "'" + value + "'B"; + } ) ; @@ -1078,9 +1135,12 @@ pr_HStringValue: pr_HString ( STRINGOP9 pr_HString )* ; -pr_HString: -( HEXSTRING9 -| MACRO_HSTR9 +pr_HString returns [String string]: +( h = HEXSTRING9 { $string = $h.getText(); } +| macro = MACRO_HSTR9 + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_HSTR ); + $string = "'" + value + "'H"; + } ) ; @@ -1088,10 +1148,16 @@ pr_OStringValue: pr_OString ( STRINGOP9 pr_OString )* ; -pr_OString: -( OCTETSTRING9 -| MACRO_OSTR9 -| MACRO_BINARY9 +pr_OString returns [String string]: +( o = OCTETSTRING9 { $string = $o.getText(); } +| macro = MACRO_OSTR9 + { String value = getTypedMacroValue( $macro, DEFINITION_NOT_FOUND_OSTR ); + $string = "'" + value + "'0"; + } +| macro_bin = MACRO_BINARY9 + { String value = getTypedMacroValue( $macro_bin, DEFINITION_NOT_FOUND_STRING ); + $string = value; + } ) ; diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParserBaseListener.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParserBaseListener.java deleted file mode 100644 index 328afec24a0134133c11fdca0859a097a2f57c69..0000000000000000000000000000000000000000 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParserBaseListener.java +++ /dev/null @@ -1,1626 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2000-2015 Ericsson Telecom AB - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - ******************************************************************************/ -// Generated from CfgParser.g4 by ANTLR 4.3 -package org.eclipse.titan.common.parsers.cfg; - -import java.util.HashMap; - -import org.eclipse.titan.common.parsers.LocationAST; -import org.eclipse.titan.common.parsers.TITANMarker; -import org.eclipse.titan.common.parsers.cfg.indices.ComponentSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.DefineSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.ExecuteSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.ExternalCommandSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.IncludeSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.LoggingSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.MCSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.ModuleParameterSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.TestportParameterSectionHandler; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IFile; - -import java.util.Map; - - -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.misc.NotNull; -import org.antlr.v4.runtime.tree.ErrorNode; -import org.antlr.v4.runtime.tree.TerminalNode; - -/** - * This class provides an empty implementation of {@link CfgParserListener}, - * which can be extended to create a listener which only needs to handle a subset - * of the available methods. - */ -public class CfgParserBaseListener implements CfgParserListener { - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MainControllerItemTcpPort(@NotNull CfgParser.Pr_MainControllerItemTcpPortContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MainControllerItemTcpPort(@NotNull CfgParser.Pr_MainControllerItemTcpPortContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ComponentSpecificLoggingParam(@NotNull CfgParser.Pr_ComponentSpecificLoggingParamContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ComponentSpecificLoggingParam(@NotNull CfgParser.Pr_ComponentSpecificLoggingParamContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ArithmeticPrimaryExpression(@NotNull CfgParser.Pr_ArithmeticPrimaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ArithmeticPrimaryExpression(@NotNull CfgParser.Pr_ArithmeticPrimaryExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_OString(@NotNull CfgParser.Pr_OStringContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_OString(@NotNull CfgParser.Pr_OStringContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IntegerValueExpression(@NotNull CfgParser.Pr_IntegerValueExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IntegerValueExpression(@NotNull CfgParser.Pr_IntegerValueExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StructuredValue(@NotNull CfgParser.Pr_StructuredValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StructuredValue(@NotNull CfgParser.Pr_StructuredValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LoggingParam(@NotNull CfgParser.Pr_LoggingParamContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LoggingParam(@NotNull CfgParser.Pr_LoggingParamContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IntegerMulExpression(@NotNull CfgParser.Pr_IntegerMulExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IntegerMulExpression(@NotNull CfgParser.Pr_IntegerMulExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MainControllerItem(@NotNull CfgParser.Pr_MainControllerItemContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MainControllerItem(@NotNull CfgParser.Pr_MainControllerItemContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_SimpleValue(@NotNull CfgParser.Pr_SimpleValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_SimpleValue(@NotNull CfgParser.Pr_SimpleValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MainControllerItemKillTimer(@NotNull CfgParser.Pr_MainControllerItemKillTimerContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MainControllerItemKillTimer(@NotNull CfgParser.Pr_MainControllerItemKillTimerContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MacroCString(@NotNull CfgParser.Pr_MacroCStringContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MacroCString(@NotNull CfgParser.Pr_MacroCStringContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_AggregateData(@NotNull CfgParser.Pr_AggregateDataContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_AggregateData(@NotNull CfgParser.Pr_AggregateDataContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_SimpleParameterValue(@NotNull CfgParser.Pr_SimpleParameterValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_SimpleParameterValue(@NotNull CfgParser.Pr_SimpleParameterValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_OrderedIncludeSection(@NotNull CfgParser.Pr_OrderedIncludeSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_OrderedIncludeSection(@NotNull CfgParser.Pr_OrderedIncludeSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_HostName(@NotNull CfgParser.Pr_HostNameContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_HostName(@NotNull CfgParser.Pr_HostNameContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IntegerRange(@NotNull CfgParser.Pr_IntegerRangeContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IntegerRange(@NotNull CfgParser.Pr_IntegerRangeContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_BString(@NotNull CfgParser.Pr_BStringContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_BString(@NotNull CfgParser.Pr_BStringContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_CString(@NotNull CfgParser.Pr_CStringContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_CString(@NotNull CfgParser.Pr_CStringContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DefinitionRValue(@NotNull CfgParser.Pr_DefinitionRValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DefinitionRValue(@NotNull CfgParser.Pr_DefinitionRValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FieldValue(@NotNull CfgParser.Pr_FieldValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FieldValue(@NotNull CfgParser.Pr_FieldValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ConfigFile(@NotNull CfgParser.Pr_ConfigFileContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ConfigFile(@NotNull CfgParser.Pr_ConfigFileContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FloatAddExpression(@NotNull CfgParser.Pr_FloatAddExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FloatAddExpression(@NotNull CfgParser.Pr_FloatAddExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_BStringValue(@NotNull CfgParser.Pr_BStringValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_BStringValue(@NotNull CfgParser.Pr_BStringValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FloatRange(@NotNull CfgParser.Pr_FloatRangeContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FloatRange(@NotNull CfgParser.Pr_FloatRangeContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LogEventType(@NotNull CfgParser.Pr_LogEventTypeContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LogEventType(@NotNull CfgParser.Pr_LogEventTypeContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_GroupsSection(@NotNull CfgParser.Pr_GroupsSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_GroupsSection(@NotNull CfgParser.Pr_GroupsSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StringRange(@NotNull CfgParser.Pr_StringRangeContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StringRange(@NotNull CfgParser.Pr_StringRangeContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_NULLKeyword(@NotNull CfgParser.Pr_NULLKeywordContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_NULLKeyword(@NotNull CfgParser.Pr_NULLKeywordContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPt_TestComponentID(@NotNull CfgParser.Pt_TestComponentIDContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPt_TestComponentID(@NotNull CfgParser.Pt_TestComponentIDContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_Float(@NotNull CfgParser.Pr_FloatContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_Float(@NotNull CfgParser.Pr_FloatContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MainControllerItemUnixDomainSocket(@NotNull CfgParser.Pr_MainControllerItemUnixDomainSocketContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MainControllerItemUnixDomainSocket(@NotNull CfgParser.Pr_MainControllerItemUnixDomainSocketContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DiskFullActionValue(@NotNull CfgParser.Pr_DiskFullActionValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DiskFullActionValue(@NotNull CfgParser.Pr_DiskFullActionValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_Section(@NotNull CfgParser.Pr_SectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_Section(@NotNull CfgParser.Pr_SectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_PlainLoggingParam(@NotNull CfgParser.Pr_PlainLoggingParamContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_PlainLoggingParam(@NotNull CfgParser.Pr_PlainLoggingParamContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ArrayItem(@NotNull CfgParser.Pr_ArrayItemContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ArrayItem(@NotNull CfgParser.Pr_ArrayItemContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_VerdictValue(@NotNull CfgParser.Pr_VerdictValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_VerdictValue(@NotNull CfgParser.Pr_VerdictValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MainControllerSection(@NotNull CfgParser.Pr_MainControllerSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MainControllerSection(@NotNull CfgParser.Pr_MainControllerSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StructuredValue2(@NotNull CfgParser.Pr_StructuredValue2Context ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StructuredValue2(@NotNull CfgParser.Pr_StructuredValue2Context ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ExecuteSectionItem(@NotNull CfgParser.Pr_ExecuteSectionItemContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ExecuteSectionItem(@NotNull CfgParser.Pr_ExecuteSectionItemContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ArithmeticMulExpression(@NotNull CfgParser.Pr_ArithmeticMulExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ArithmeticMulExpression(@NotNull CfgParser.Pr_ArithmeticMulExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ArithmeticAddExpression(@NotNull CfgParser.Pr_ArithmeticAddExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ArithmeticAddExpression(@NotNull CfgParser.Pr_ArithmeticAddExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StringValue(@NotNull CfgParser.Pr_StringValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StringValue(@NotNull CfgParser.Pr_StringValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IntegerAddExpression(@NotNull CfgParser.Pr_IntegerAddExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IntegerAddExpression(@NotNull CfgParser.Pr_IntegerAddExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_EnumeratedValue(@NotNull CfgParser.Pr_EnumeratedValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_EnumeratedValue(@NotNull CfgParser.Pr_EnumeratedValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ModuleParam(@NotNull CfgParser.Pr_ModuleParamContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ModuleParam(@NotNull CfgParser.Pr_ModuleParamContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_TestportParametersSection(@NotNull CfgParser.Pr_TestportParametersSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_TestportParametersSection(@NotNull CfgParser.Pr_TestportParametersSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FloatMulExpression(@NotNull CfgParser.Pr_FloatMulExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FloatMulExpression(@NotNull CfgParser.Pr_FloatMulExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DisableStatistics(@NotNull CfgParser.Pr_DisableStatisticsContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DisableStatistics(@NotNull CfgParser.Pr_DisableStatisticsContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ObjIdValue(@NotNull CfgParser.Pr_ObjIdValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ObjIdValue(@NotNull CfgParser.Pr_ObjIdValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LengthMatch(@NotNull CfgParser.Pr_LengthMatchContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LengthMatch(@NotNull CfgParser.Pr_LengthMatchContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LoggingBitMask(@NotNull CfgParser.Pr_LoggingBitMaskContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LoggingBitMask(@NotNull CfgParser.Pr_LoggingBitMaskContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ArithmeticValueExpression(@NotNull CfgParser.Pr_ArithmeticValueExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ArithmeticValueExpression(@NotNull CfgParser.Pr_ArithmeticValueExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FieldName(@NotNull CfgParser.Pr_FieldNameContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FieldName(@NotNull CfgParser.Pr_FieldNameContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DefineSection(@NotNull CfgParser.Pr_DefineSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DefineSection(@NotNull CfgParser.Pr_DefineSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ArithmeticUnaryExpression(@NotNull CfgParser.Pr_ArithmeticUnaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ArithmeticUnaryExpression(@NotNull CfgParser.Pr_ArithmeticUnaryExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ModuleParametersSection(@NotNull CfgParser.Pr_ModuleParametersSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ModuleParametersSection(@NotNull CfgParser.Pr_ModuleParametersSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DNSName(@NotNull CfgParser.Pr_DNSNameContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DNSName(@NotNull CfgParser.Pr_DNSNameContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MainControllerItemLocalAddress(@NotNull CfgParser.Pr_MainControllerItemLocalAddressContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MainControllerItemLocalAddress(@NotNull CfgParser.Pr_MainControllerItemLocalAddressContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ComponentItem(@NotNull CfgParser.Pr_ComponentItemContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ComponentItem(@NotNull CfgParser.Pr_ComponentItemContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IntegerPrimaryExpression(@NotNull CfgParser.Pr_IntegerPrimaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IntegerPrimaryExpression(@NotNull CfgParser.Pr_IntegerPrimaryExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_Boolean(@NotNull CfgParser.Pr_BooleanContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_Boolean(@NotNull CfgParser.Pr_BooleanContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StatisticsFile(@NotNull CfgParser.Pr_StatisticsFileContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StatisticsFile(@NotNull CfgParser.Pr_StatisticsFileContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DatabaseFile(@NotNull CfgParser.Pr_DatabaseFileContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DatabaseFile(@NotNull CfgParser.Pr_DatabaseFileContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_CompoundValue(@NotNull CfgParser.Pr_CompoundValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_CompoundValue(@NotNull CfgParser.Pr_CompoundValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FloatValueExpression(@NotNull CfgParser.Pr_FloatValueExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FloatValueExpression(@NotNull CfgParser.Pr_FloatValueExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_Identifier(@NotNull CfgParser.Pr_IdentifierContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_Identifier(@NotNull CfgParser.Pr_IdentifierContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ParameterValue(@NotNull CfgParser.Pr_ParameterValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ParameterValue(@NotNull CfgParser.Pr_ParameterValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_PatternChunk(@NotNull CfgParser.Pr_PatternChunkContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_PatternChunk(@NotNull CfgParser.Pr_PatternChunkContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StatisticsFilterEntry(@NotNull CfgParser.Pr_StatisticsFilterEntryContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StatisticsFilterEntry(@NotNull CfgParser.Pr_StatisticsFilterEntryContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_YesNoOrBoolean(@NotNull CfgParser.Pr_YesNoOrBooleanContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_YesNoOrBoolean(@NotNull CfgParser.Pr_YesNoOrBooleanContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LogEventTypesValue(@NotNull CfgParser.Pr_LogEventTypesValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LogEventTypesValue(@NotNull CfgParser.Pr_LogEventTypesValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DisableCoverage(@NotNull CfgParser.Pr_DisableCoverageContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DisableCoverage(@NotNull CfgParser.Pr_DisableCoverageContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ParameterName(@NotNull CfgParser.Pr_ParameterNameContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ParameterName(@NotNull CfgParser.Pr_ParameterNameContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ProfilerSetting(@NotNull CfgParser.Pr_ProfilerSettingContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ProfilerSetting(@NotNull CfgParser.Pr_ProfilerSettingContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IndexValue(@NotNull CfgParser.Pr_IndexValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IndexValue(@NotNull CfgParser.Pr_IndexValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ComponentID(@NotNull CfgParser.Pr_ComponentIDContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ComponentID(@NotNull CfgParser.Pr_ComponentIDContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LoggingMaskElement(@NotNull CfgParser.Pr_LoggingMaskElementContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LoggingMaskElement(@NotNull CfgParser.Pr_LoggingMaskElementContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_BStringMatch(@NotNull CfgParser.Pr_BStringMatchContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_BStringMatch(@NotNull CfgParser.Pr_BStringMatchContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ExecuteSection(@NotNull CfgParser.Pr_ExecuteSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ExecuteSection(@NotNull CfgParser.Pr_ExecuteSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FloatPrimaryExpression(@NotNull CfgParser.Pr_FloatPrimaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FloatPrimaryExpression(@NotNull CfgParser.Pr_FloatPrimaryExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_NetFunctionTimes(@NotNull CfgParser.Pr_NetFunctionTimesContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_NetFunctionTimes(@NotNull CfgParser.Pr_NetFunctionTimesContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_HStringValue(@NotNull CfgParser.Pr_HStringValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_HStringValue(@NotNull CfgParser.Pr_HStringValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IntegerUnaryExpression(@NotNull CfgParser.Pr_IntegerUnaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IntegerUnaryExpression(@NotNull CfgParser.Pr_IntegerUnaryExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_FloatUnaryExpression(@NotNull CfgParser.Pr_FloatUnaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_FloatUnaryExpression(@NotNull CfgParser.Pr_FloatUnaryExpressionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MatchingHintsValue(@NotNull CfgParser.Pr_MatchingHintsValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MatchingHintsValue(@NotNull CfgParser.Pr_MatchingHintsValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_IncludeSection(@NotNull CfgParser.Pr_IncludeSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_IncludeSection(@NotNull CfgParser.Pr_IncludeSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_HString(@NotNull CfgParser.Pr_HStringContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_HString(@NotNull CfgParser.Pr_HStringContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_PatternChunkList(@NotNull CfgParser.Pr_PatternChunkListContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_PatternChunkList(@NotNull CfgParser.Pr_PatternChunkListContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_UniversalOrNotStringValue(@NotNull CfgParser.Pr_UniversalOrNotStringValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_UniversalOrNotStringValue(@NotNull CfgParser.Pr_UniversalOrNotStringValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_Detailed(@NotNull CfgParser.Pr_DetailedContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_Detailed(@NotNull CfgParser.Pr_DetailedContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_NetLineTimes(@NotNull CfgParser.Pr_NetLineTimesContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_NetLineTimes(@NotNull CfgParser.Pr_NetLineTimesContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ObjIdComponent(@NotNull CfgParser.Pr_ObjIdComponentContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ObjIdComponent(@NotNull CfgParser.Pr_ObjIdComponentContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ExternalCommandsSection(@NotNull CfgParser.Pr_ExternalCommandsSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ExternalCommandsSection(@NotNull CfgParser.Pr_ExternalCommandsSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_TestportName(@NotNull CfgParser.Pr_TestportNameContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_TestportName(@NotNull CfgParser.Pr_TestportNameContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_OStringValue(@NotNull CfgParser.Pr_OStringValueContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_OStringValue(@NotNull CfgParser.Pr_OStringValueContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DefaultSection(@NotNull CfgParser.Pr_DefaultSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DefaultSection(@NotNull CfgParser.Pr_DefaultSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LogEventTypeSet(@NotNull CfgParser.Pr_LogEventTypeSetContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LogEventTypeSet(@NotNull CfgParser.Pr_LogEventTypeSetContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LoggerPluginEntry(@NotNull CfgParser.Pr_LoggerPluginEntryContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LoggerPluginEntry(@NotNull CfgParser.Pr_LoggerPluginEntryContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_deprecatedEventTypeSet(@NotNull CfgParser.Pr_deprecatedEventTypeSetContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_deprecatedEventTypeSet(@NotNull CfgParser.Pr_deprecatedEventTypeSetContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LengthBound(@NotNull CfgParser.Pr_LengthBoundContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LengthBound(@NotNull CfgParser.Pr_LengthBoundContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StatisticsFilter(@NotNull CfgParser.Pr_StatisticsFilterContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StatisticsFilter(@NotNull CfgParser.Pr_StatisticsFilterContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_DisableProfiler(@NotNull CfgParser.Pr_DisableProfilerContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_DisableProfiler(@NotNull CfgParser.Pr_DisableProfilerContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MacroAssignment(@NotNull CfgParser.Pr_MacroAssignmentContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MacroAssignment(@NotNull CfgParser.Pr_MacroAssignmentContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LoggingSection(@NotNull CfgParser.Pr_LoggingSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LoggingSection(@NotNull CfgParser.Pr_LoggingSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LogfileName(@NotNull CfgParser.Pr_LogfileNameContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LogfileName(@NotNull CfgParser.Pr_LogfileNameContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_TemplateItemList(@NotNull CfgParser.Pr_TemplateItemListContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_TemplateItemList(@NotNull CfgParser.Pr_TemplateItemListContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_StartAutomatically(@NotNull CfgParser.Pr_StartAutomaticallyContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_StartAutomatically(@NotNull CfgParser.Pr_StartAutomaticallyContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ComponentsSection(@NotNull CfgParser.Pr_ComponentsSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ComponentsSection(@NotNull CfgParser.Pr_ComponentsSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MainControllerItemNumHcs(@NotNull CfgParser.Pr_MainControllerItemNumHcsContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MainControllerItemNumHcs(@NotNull CfgParser.Pr_MainControllerItemNumHcsContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_Quadruple(@NotNull CfgParser.Pr_QuadrupleContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_Quadruple(@NotNull CfgParser.Pr_QuadrupleContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ProfilerSection(@NotNull CfgParser.Pr_ProfilerSectionContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ProfilerSection(@NotNull CfgParser.Pr_ProfilerSectionContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_HStringMatch(@NotNull CfgParser.Pr_HStringMatchContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_HStringMatch(@NotNull CfgParser.Pr_HStringMatchContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_MacroExpliciteCString(@NotNull CfgParser.Pr_MacroExpliciteCStringContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_MacroExpliciteCString(@NotNull CfgParser.Pr_MacroExpliciteCStringContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ComponentName(@NotNull CfgParser.Pr_ComponentNameContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ComponentName(@NotNull CfgParser.Pr_ComponentNameContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_OStringMatch(@NotNull CfgParser.Pr_OStringMatchContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_OStringMatch(@NotNull CfgParser.Pr_OStringMatchContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_GroupItem(@NotNull CfgParser.Pr_GroupItemContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_GroupItem(@NotNull CfgParser.Pr_GroupItemContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_LoggerPluginsPart(@NotNull CfgParser.Pr_LoggerPluginsPartContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_LoggerPluginsPart(@NotNull CfgParser.Pr_LoggerPluginsPartContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_ParameterValueOrNotUsedSymbol(@NotNull CfgParser.Pr_ParameterValueOrNotUsedSymbolContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_ParameterValueOrNotUsedSymbol(@NotNull CfgParser.Pr_ParameterValueOrNotUsedSymbolContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterPr_Number(@NotNull CfgParser.Pr_NumberContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitPr_Number(@NotNull CfgParser.Pr_NumberContext ctx) { } - - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void enterEveryRule(@NotNull ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void exitEveryRule(@NotNull ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void visitTerminal(@NotNull TerminalNode node) { } - /** - * {@inheritDoc} - * - * <p>The default implementation does nothing.</p> - */ - @Override public void visitErrorNode(@NotNull ErrorNode node) { } -} \ No newline at end of file diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParserListener.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParserListener.java deleted file mode 100644 index 2db33d0af4f9a02052451e117a928896661d369d..0000000000000000000000000000000000000000 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgParserListener.java +++ /dev/null @@ -1,1357 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2000-2015 Ericsson Telecom AB - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - ******************************************************************************/ -// Generated from CfgParser.g4 by ANTLR 4.3 -package org.eclipse.titan.common.parsers.cfg; - -import java.util.HashMap; - -import org.eclipse.titan.common.parsers.LocationAST; -import org.eclipse.titan.common.parsers.TITANMarker; -import org.eclipse.titan.common.parsers.cfg.indices.ComponentSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.DefineSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.ExecuteSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.ExternalCommandSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.GroupSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.IncludeSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.LoggingSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.MCSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.ModuleParameterSectionHandler; -import org.eclipse.titan.common.parsers.cfg.indices.TestportParameterSectionHandler; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IFile; - -import java.util.Map; - -import org.antlr.v4.runtime.misc.NotNull; -import org.antlr.v4.runtime.tree.ParseTreeListener; - -/** - * This interface defines a complete listener for a parse tree produced by - * {@link CfgParser}. - */ -public interface CfgParserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by {@link CfgParser#pr_MainControllerItemTcpPort}. - * @param ctx the parse tree - */ - void enterPr_MainControllerItemTcpPort(@NotNull CfgParser.Pr_MainControllerItemTcpPortContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MainControllerItemTcpPort}. - * @param ctx the parse tree - */ - void exitPr_MainControllerItemTcpPort(@NotNull CfgParser.Pr_MainControllerItemTcpPortContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ComponentSpecificLoggingParam}. - * @param ctx the parse tree - */ - void enterPr_ComponentSpecificLoggingParam(@NotNull CfgParser.Pr_ComponentSpecificLoggingParamContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ComponentSpecificLoggingParam}. - * @param ctx the parse tree - */ - void exitPr_ComponentSpecificLoggingParam(@NotNull CfgParser.Pr_ComponentSpecificLoggingParamContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ArithmeticPrimaryExpression}. - * @param ctx the parse tree - */ - void enterPr_ArithmeticPrimaryExpression(@NotNull CfgParser.Pr_ArithmeticPrimaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ArithmeticPrimaryExpression}. - * @param ctx the parse tree - */ - void exitPr_ArithmeticPrimaryExpression(@NotNull CfgParser.Pr_ArithmeticPrimaryExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_OString}. - * @param ctx the parse tree - */ - void enterPr_OString(@NotNull CfgParser.Pr_OStringContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_OString}. - * @param ctx the parse tree - */ - void exitPr_OString(@NotNull CfgParser.Pr_OStringContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IntegerValueExpression}. - * @param ctx the parse tree - */ - void enterPr_IntegerValueExpression(@NotNull CfgParser.Pr_IntegerValueExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IntegerValueExpression}. - * @param ctx the parse tree - */ - void exitPr_IntegerValueExpression(@NotNull CfgParser.Pr_IntegerValueExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StructuredValue}. - * @param ctx the parse tree - */ - void enterPr_StructuredValue(@NotNull CfgParser.Pr_StructuredValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StructuredValue}. - * @param ctx the parse tree - */ - void exitPr_StructuredValue(@NotNull CfgParser.Pr_StructuredValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LoggingParam}. - * @param ctx the parse tree - */ - void enterPr_LoggingParam(@NotNull CfgParser.Pr_LoggingParamContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LoggingParam}. - * @param ctx the parse tree - */ - void exitPr_LoggingParam(@NotNull CfgParser.Pr_LoggingParamContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IntegerMulExpression}. - * @param ctx the parse tree - */ - void enterPr_IntegerMulExpression(@NotNull CfgParser.Pr_IntegerMulExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IntegerMulExpression}. - * @param ctx the parse tree - */ - void exitPr_IntegerMulExpression(@NotNull CfgParser.Pr_IntegerMulExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MainControllerItem}. - * @param ctx the parse tree - */ - void enterPr_MainControllerItem(@NotNull CfgParser.Pr_MainControllerItemContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MainControllerItem}. - * @param ctx the parse tree - */ - void exitPr_MainControllerItem(@NotNull CfgParser.Pr_MainControllerItemContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_SimpleValue}. - * @param ctx the parse tree - */ - void enterPr_SimpleValue(@NotNull CfgParser.Pr_SimpleValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_SimpleValue}. - * @param ctx the parse tree - */ - void exitPr_SimpleValue(@NotNull CfgParser.Pr_SimpleValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MainControllerItemKillTimer}. - * @param ctx the parse tree - */ - void enterPr_MainControllerItemKillTimer(@NotNull CfgParser.Pr_MainControllerItemKillTimerContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MainControllerItemKillTimer}. - * @param ctx the parse tree - */ - void exitPr_MainControllerItemKillTimer(@NotNull CfgParser.Pr_MainControllerItemKillTimerContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MacroCString}. - * @param ctx the parse tree - */ - void enterPr_MacroCString(@NotNull CfgParser.Pr_MacroCStringContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MacroCString}. - * @param ctx the parse tree - */ - void exitPr_MacroCString(@NotNull CfgParser.Pr_MacroCStringContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_AggregateData}. - * @param ctx the parse tree - */ - void enterPr_AggregateData(@NotNull CfgParser.Pr_AggregateDataContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_AggregateData}. - * @param ctx the parse tree - */ - void exitPr_AggregateData(@NotNull CfgParser.Pr_AggregateDataContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_SimpleParameterValue}. - * @param ctx the parse tree - */ - void enterPr_SimpleParameterValue(@NotNull CfgParser.Pr_SimpleParameterValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_SimpleParameterValue}. - * @param ctx the parse tree - */ - void exitPr_SimpleParameterValue(@NotNull CfgParser.Pr_SimpleParameterValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_OrderedIncludeSection}. - * @param ctx the parse tree - */ - void enterPr_OrderedIncludeSection(@NotNull CfgParser.Pr_OrderedIncludeSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_OrderedIncludeSection}. - * @param ctx the parse tree - */ - void exitPr_OrderedIncludeSection(@NotNull CfgParser.Pr_OrderedIncludeSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_HostName}. - * @param ctx the parse tree - */ - void enterPr_HostName(@NotNull CfgParser.Pr_HostNameContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_HostName}. - * @param ctx the parse tree - */ - void exitPr_HostName(@NotNull CfgParser.Pr_HostNameContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IntegerRange}. - * @param ctx the parse tree - */ - void enterPr_IntegerRange(@NotNull CfgParser.Pr_IntegerRangeContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IntegerRange}. - * @param ctx the parse tree - */ - void exitPr_IntegerRange(@NotNull CfgParser.Pr_IntegerRangeContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_BString}. - * @param ctx the parse tree - */ - void enterPr_BString(@NotNull CfgParser.Pr_BStringContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_BString}. - * @param ctx the parse tree - */ - void exitPr_BString(@NotNull CfgParser.Pr_BStringContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_CString}. - * @param ctx the parse tree - */ - void enterPr_CString(@NotNull CfgParser.Pr_CStringContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_CString}. - * @param ctx the parse tree - */ - void exitPr_CString(@NotNull CfgParser.Pr_CStringContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DefinitionRValue}. - * @param ctx the parse tree - */ - void enterPr_DefinitionRValue(@NotNull CfgParser.Pr_DefinitionRValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DefinitionRValue}. - * @param ctx the parse tree - */ - void exitPr_DefinitionRValue(@NotNull CfgParser.Pr_DefinitionRValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FieldValue}. - * @param ctx the parse tree - */ - void enterPr_FieldValue(@NotNull CfgParser.Pr_FieldValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FieldValue}. - * @param ctx the parse tree - */ - void exitPr_FieldValue(@NotNull CfgParser.Pr_FieldValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ConfigFile}. - * @param ctx the parse tree - */ - void enterPr_ConfigFile(@NotNull CfgParser.Pr_ConfigFileContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ConfigFile}. - * @param ctx the parse tree - */ - void exitPr_ConfigFile(@NotNull CfgParser.Pr_ConfigFileContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FloatAddExpression}. - * @param ctx the parse tree - */ - void enterPr_FloatAddExpression(@NotNull CfgParser.Pr_FloatAddExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FloatAddExpression}. - * @param ctx the parse tree - */ - void exitPr_FloatAddExpression(@NotNull CfgParser.Pr_FloatAddExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_BStringValue}. - * @param ctx the parse tree - */ - void enterPr_BStringValue(@NotNull CfgParser.Pr_BStringValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_BStringValue}. - * @param ctx the parse tree - */ - void exitPr_BStringValue(@NotNull CfgParser.Pr_BStringValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FloatRange}. - * @param ctx the parse tree - */ - void enterPr_FloatRange(@NotNull CfgParser.Pr_FloatRangeContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FloatRange}. - * @param ctx the parse tree - */ - void exitPr_FloatRange(@NotNull CfgParser.Pr_FloatRangeContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LogEventType}. - * @param ctx the parse tree - */ - void enterPr_LogEventType(@NotNull CfgParser.Pr_LogEventTypeContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LogEventType}. - * @param ctx the parse tree - */ - void exitPr_LogEventType(@NotNull CfgParser.Pr_LogEventTypeContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_GroupsSection}. - * @param ctx the parse tree - */ - void enterPr_GroupsSection(@NotNull CfgParser.Pr_GroupsSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_GroupsSection}. - * @param ctx the parse tree - */ - void exitPr_GroupsSection(@NotNull CfgParser.Pr_GroupsSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StringRange}. - * @param ctx the parse tree - */ - void enterPr_StringRange(@NotNull CfgParser.Pr_StringRangeContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StringRange}. - * @param ctx the parse tree - */ - void exitPr_StringRange(@NotNull CfgParser.Pr_StringRangeContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_NULLKeyword}. - * @param ctx the parse tree - */ - void enterPr_NULLKeyword(@NotNull CfgParser.Pr_NULLKeywordContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_NULLKeyword}. - * @param ctx the parse tree - */ - void exitPr_NULLKeyword(@NotNull CfgParser.Pr_NULLKeywordContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pt_TestComponentID}. - * @param ctx the parse tree - */ - void enterPt_TestComponentID(@NotNull CfgParser.Pt_TestComponentIDContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pt_TestComponentID}. - * @param ctx the parse tree - */ - void exitPt_TestComponentID(@NotNull CfgParser.Pt_TestComponentIDContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_Float}. - * @param ctx the parse tree - */ - void enterPr_Float(@NotNull CfgParser.Pr_FloatContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_Float}. - * @param ctx the parse tree - */ - void exitPr_Float(@NotNull CfgParser.Pr_FloatContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MainControllerItemUnixDomainSocket}. - * @param ctx the parse tree - */ - void enterPr_MainControllerItemUnixDomainSocket(@NotNull CfgParser.Pr_MainControllerItemUnixDomainSocketContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MainControllerItemUnixDomainSocket}. - * @param ctx the parse tree - */ - void exitPr_MainControllerItemUnixDomainSocket(@NotNull CfgParser.Pr_MainControllerItemUnixDomainSocketContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DiskFullActionValue}. - * @param ctx the parse tree - */ - void enterPr_DiskFullActionValue(@NotNull CfgParser.Pr_DiskFullActionValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DiskFullActionValue}. - * @param ctx the parse tree - */ - void exitPr_DiskFullActionValue(@NotNull CfgParser.Pr_DiskFullActionValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_Section}. - * @param ctx the parse tree - */ - void enterPr_Section(@NotNull CfgParser.Pr_SectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_Section}. - * @param ctx the parse tree - */ - void exitPr_Section(@NotNull CfgParser.Pr_SectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_PlainLoggingParam}. - * @param ctx the parse tree - */ - void enterPr_PlainLoggingParam(@NotNull CfgParser.Pr_PlainLoggingParamContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_PlainLoggingParam}. - * @param ctx the parse tree - */ - void exitPr_PlainLoggingParam(@NotNull CfgParser.Pr_PlainLoggingParamContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ArrayItem}. - * @param ctx the parse tree - */ - void enterPr_ArrayItem(@NotNull CfgParser.Pr_ArrayItemContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ArrayItem}. - * @param ctx the parse tree - */ - void exitPr_ArrayItem(@NotNull CfgParser.Pr_ArrayItemContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_VerdictValue}. - * @param ctx the parse tree - */ - void enterPr_VerdictValue(@NotNull CfgParser.Pr_VerdictValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_VerdictValue}. - * @param ctx the parse tree - */ - void exitPr_VerdictValue(@NotNull CfgParser.Pr_VerdictValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MainControllerSection}. - * @param ctx the parse tree - */ - void enterPr_MainControllerSection(@NotNull CfgParser.Pr_MainControllerSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MainControllerSection}. - * @param ctx the parse tree - */ - void exitPr_MainControllerSection(@NotNull CfgParser.Pr_MainControllerSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StructuredValue2}. - * @param ctx the parse tree - */ - void enterPr_StructuredValue2(@NotNull CfgParser.Pr_StructuredValue2Context ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StructuredValue2}. - * @param ctx the parse tree - */ - void exitPr_StructuredValue2(@NotNull CfgParser.Pr_StructuredValue2Context ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ExecuteSectionItem}. - * @param ctx the parse tree - */ - void enterPr_ExecuteSectionItem(@NotNull CfgParser.Pr_ExecuteSectionItemContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ExecuteSectionItem}. - * @param ctx the parse tree - */ - void exitPr_ExecuteSectionItem(@NotNull CfgParser.Pr_ExecuteSectionItemContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ArithmeticMulExpression}. - * @param ctx the parse tree - */ - void enterPr_ArithmeticMulExpression(@NotNull CfgParser.Pr_ArithmeticMulExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ArithmeticMulExpression}. - * @param ctx the parse tree - */ - void exitPr_ArithmeticMulExpression(@NotNull CfgParser.Pr_ArithmeticMulExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ArithmeticAddExpression}. - * @param ctx the parse tree - */ - void enterPr_ArithmeticAddExpression(@NotNull CfgParser.Pr_ArithmeticAddExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ArithmeticAddExpression}. - * @param ctx the parse tree - */ - void exitPr_ArithmeticAddExpression(@NotNull CfgParser.Pr_ArithmeticAddExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StringValue}. - * @param ctx the parse tree - */ - void enterPr_StringValue(@NotNull CfgParser.Pr_StringValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StringValue}. - * @param ctx the parse tree - */ - void exitPr_StringValue(@NotNull CfgParser.Pr_StringValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IntegerAddExpression}. - * @param ctx the parse tree - */ - void enterPr_IntegerAddExpression(@NotNull CfgParser.Pr_IntegerAddExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IntegerAddExpression}. - * @param ctx the parse tree - */ - void exitPr_IntegerAddExpression(@NotNull CfgParser.Pr_IntegerAddExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_EnumeratedValue}. - * @param ctx the parse tree - */ - void enterPr_EnumeratedValue(@NotNull CfgParser.Pr_EnumeratedValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_EnumeratedValue}. - * @param ctx the parse tree - */ - void exitPr_EnumeratedValue(@NotNull CfgParser.Pr_EnumeratedValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ModuleParam}. - * @param ctx the parse tree - */ - void enterPr_ModuleParam(@NotNull CfgParser.Pr_ModuleParamContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ModuleParam}. - * @param ctx the parse tree - */ - void exitPr_ModuleParam(@NotNull CfgParser.Pr_ModuleParamContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_TestportParametersSection}. - * @param ctx the parse tree - */ - void enterPr_TestportParametersSection(@NotNull CfgParser.Pr_TestportParametersSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_TestportParametersSection}. - * @param ctx the parse tree - */ - void exitPr_TestportParametersSection(@NotNull CfgParser.Pr_TestportParametersSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FloatMulExpression}. - * @param ctx the parse tree - */ - void enterPr_FloatMulExpression(@NotNull CfgParser.Pr_FloatMulExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FloatMulExpression}. - * @param ctx the parse tree - */ - void exitPr_FloatMulExpression(@NotNull CfgParser.Pr_FloatMulExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DisableStatistics}. - * @param ctx the parse tree - */ - void enterPr_DisableStatistics(@NotNull CfgParser.Pr_DisableStatisticsContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DisableStatistics}. - * @param ctx the parse tree - */ - void exitPr_DisableStatistics(@NotNull CfgParser.Pr_DisableStatisticsContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ObjIdValue}. - * @param ctx the parse tree - */ - void enterPr_ObjIdValue(@NotNull CfgParser.Pr_ObjIdValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ObjIdValue}. - * @param ctx the parse tree - */ - void exitPr_ObjIdValue(@NotNull CfgParser.Pr_ObjIdValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LengthMatch}. - * @param ctx the parse tree - */ - void enterPr_LengthMatch(@NotNull CfgParser.Pr_LengthMatchContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LengthMatch}. - * @param ctx the parse tree - */ - void exitPr_LengthMatch(@NotNull CfgParser.Pr_LengthMatchContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LoggingBitMask}. - * @param ctx the parse tree - */ - void enterPr_LoggingBitMask(@NotNull CfgParser.Pr_LoggingBitMaskContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LoggingBitMask}. - * @param ctx the parse tree - */ - void exitPr_LoggingBitMask(@NotNull CfgParser.Pr_LoggingBitMaskContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ArithmeticValueExpression}. - * @param ctx the parse tree - */ - void enterPr_ArithmeticValueExpression(@NotNull CfgParser.Pr_ArithmeticValueExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ArithmeticValueExpression}. - * @param ctx the parse tree - */ - void exitPr_ArithmeticValueExpression(@NotNull CfgParser.Pr_ArithmeticValueExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FieldName}. - * @param ctx the parse tree - */ - void enterPr_FieldName(@NotNull CfgParser.Pr_FieldNameContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FieldName}. - * @param ctx the parse tree - */ - void exitPr_FieldName(@NotNull CfgParser.Pr_FieldNameContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DefineSection}. - * @param ctx the parse tree - */ - void enterPr_DefineSection(@NotNull CfgParser.Pr_DefineSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DefineSection}. - * @param ctx the parse tree - */ - void exitPr_DefineSection(@NotNull CfgParser.Pr_DefineSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ArithmeticUnaryExpression}. - * @param ctx the parse tree - */ - void enterPr_ArithmeticUnaryExpression(@NotNull CfgParser.Pr_ArithmeticUnaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ArithmeticUnaryExpression}. - * @param ctx the parse tree - */ - void exitPr_ArithmeticUnaryExpression(@NotNull CfgParser.Pr_ArithmeticUnaryExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ModuleParametersSection}. - * @param ctx the parse tree - */ - void enterPr_ModuleParametersSection(@NotNull CfgParser.Pr_ModuleParametersSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ModuleParametersSection}. - * @param ctx the parse tree - */ - void exitPr_ModuleParametersSection(@NotNull CfgParser.Pr_ModuleParametersSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DNSName}. - * @param ctx the parse tree - */ - void enterPr_DNSName(@NotNull CfgParser.Pr_DNSNameContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DNSName}. - * @param ctx the parse tree - */ - void exitPr_DNSName(@NotNull CfgParser.Pr_DNSNameContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MainControllerItemLocalAddress}. - * @param ctx the parse tree - */ - void enterPr_MainControllerItemLocalAddress(@NotNull CfgParser.Pr_MainControllerItemLocalAddressContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MainControllerItemLocalAddress}. - * @param ctx the parse tree - */ - void exitPr_MainControllerItemLocalAddress(@NotNull CfgParser.Pr_MainControllerItemLocalAddressContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ComponentItem}. - * @param ctx the parse tree - */ - void enterPr_ComponentItem(@NotNull CfgParser.Pr_ComponentItemContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ComponentItem}. - * @param ctx the parse tree - */ - void exitPr_ComponentItem(@NotNull CfgParser.Pr_ComponentItemContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IntegerPrimaryExpression}. - * @param ctx the parse tree - */ - void enterPr_IntegerPrimaryExpression(@NotNull CfgParser.Pr_IntegerPrimaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IntegerPrimaryExpression}. - * @param ctx the parse tree - */ - void exitPr_IntegerPrimaryExpression(@NotNull CfgParser.Pr_IntegerPrimaryExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_Boolean}. - * @param ctx the parse tree - */ - void enterPr_Boolean(@NotNull CfgParser.Pr_BooleanContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_Boolean}. - * @param ctx the parse tree - */ - void exitPr_Boolean(@NotNull CfgParser.Pr_BooleanContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StatisticsFile}. - * @param ctx the parse tree - */ - void enterPr_StatisticsFile(@NotNull CfgParser.Pr_StatisticsFileContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StatisticsFile}. - * @param ctx the parse tree - */ - void exitPr_StatisticsFile(@NotNull CfgParser.Pr_StatisticsFileContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DatabaseFile}. - * @param ctx the parse tree - */ - void enterPr_DatabaseFile(@NotNull CfgParser.Pr_DatabaseFileContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DatabaseFile}. - * @param ctx the parse tree - */ - void exitPr_DatabaseFile(@NotNull CfgParser.Pr_DatabaseFileContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_CompoundValue}. - * @param ctx the parse tree - */ - void enterPr_CompoundValue(@NotNull CfgParser.Pr_CompoundValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_CompoundValue}. - * @param ctx the parse tree - */ - void exitPr_CompoundValue(@NotNull CfgParser.Pr_CompoundValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FloatValueExpression}. - * @param ctx the parse tree - */ - void enterPr_FloatValueExpression(@NotNull CfgParser.Pr_FloatValueExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FloatValueExpression}. - * @param ctx the parse tree - */ - void exitPr_FloatValueExpression(@NotNull CfgParser.Pr_FloatValueExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_Identifier}. - * @param ctx the parse tree - */ - void enterPr_Identifier(@NotNull CfgParser.Pr_IdentifierContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_Identifier}. - * @param ctx the parse tree - */ - void exitPr_Identifier(@NotNull CfgParser.Pr_IdentifierContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ParameterValue}. - * @param ctx the parse tree - */ - void enterPr_ParameterValue(@NotNull CfgParser.Pr_ParameterValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ParameterValue}. - * @param ctx the parse tree - */ - void exitPr_ParameterValue(@NotNull CfgParser.Pr_ParameterValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_PatternChunk}. - * @param ctx the parse tree - */ - void enterPr_PatternChunk(@NotNull CfgParser.Pr_PatternChunkContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_PatternChunk}. - * @param ctx the parse tree - */ - void exitPr_PatternChunk(@NotNull CfgParser.Pr_PatternChunkContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StatisticsFilterEntry}. - * @param ctx the parse tree - */ - void enterPr_StatisticsFilterEntry(@NotNull CfgParser.Pr_StatisticsFilterEntryContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StatisticsFilterEntry}. - * @param ctx the parse tree - */ - void exitPr_StatisticsFilterEntry(@NotNull CfgParser.Pr_StatisticsFilterEntryContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_YesNoOrBoolean}. - * @param ctx the parse tree - */ - void enterPr_YesNoOrBoolean(@NotNull CfgParser.Pr_YesNoOrBooleanContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_YesNoOrBoolean}. - * @param ctx the parse tree - */ - void exitPr_YesNoOrBoolean(@NotNull CfgParser.Pr_YesNoOrBooleanContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LogEventTypesValue}. - * @param ctx the parse tree - */ - void enterPr_LogEventTypesValue(@NotNull CfgParser.Pr_LogEventTypesValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LogEventTypesValue}. - * @param ctx the parse tree - */ - void exitPr_LogEventTypesValue(@NotNull CfgParser.Pr_LogEventTypesValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DisableCoverage}. - * @param ctx the parse tree - */ - void enterPr_DisableCoverage(@NotNull CfgParser.Pr_DisableCoverageContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DisableCoverage}. - * @param ctx the parse tree - */ - void exitPr_DisableCoverage(@NotNull CfgParser.Pr_DisableCoverageContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ParameterName}. - * @param ctx the parse tree - */ - void enterPr_ParameterName(@NotNull CfgParser.Pr_ParameterNameContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ParameterName}. - * @param ctx the parse tree - */ - void exitPr_ParameterName(@NotNull CfgParser.Pr_ParameterNameContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ProfilerSetting}. - * @param ctx the parse tree - */ - void enterPr_ProfilerSetting(@NotNull CfgParser.Pr_ProfilerSettingContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ProfilerSetting}. - * @param ctx the parse tree - */ - void exitPr_ProfilerSetting(@NotNull CfgParser.Pr_ProfilerSettingContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IndexValue}. - * @param ctx the parse tree - */ - void enterPr_IndexValue(@NotNull CfgParser.Pr_IndexValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IndexValue}. - * @param ctx the parse tree - */ - void exitPr_IndexValue(@NotNull CfgParser.Pr_IndexValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ComponentID}. - * @param ctx the parse tree - */ - void enterPr_ComponentID(@NotNull CfgParser.Pr_ComponentIDContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ComponentID}. - * @param ctx the parse tree - */ - void exitPr_ComponentID(@NotNull CfgParser.Pr_ComponentIDContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LoggingMaskElement}. - * @param ctx the parse tree - */ - void enterPr_LoggingMaskElement(@NotNull CfgParser.Pr_LoggingMaskElementContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LoggingMaskElement}. - * @param ctx the parse tree - */ - void exitPr_LoggingMaskElement(@NotNull CfgParser.Pr_LoggingMaskElementContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_BStringMatch}. - * @param ctx the parse tree - */ - void enterPr_BStringMatch(@NotNull CfgParser.Pr_BStringMatchContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_BStringMatch}. - * @param ctx the parse tree - */ - void exitPr_BStringMatch(@NotNull CfgParser.Pr_BStringMatchContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ExecuteSection}. - * @param ctx the parse tree - */ - void enterPr_ExecuteSection(@NotNull CfgParser.Pr_ExecuteSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ExecuteSection}. - * @param ctx the parse tree - */ - void exitPr_ExecuteSection(@NotNull CfgParser.Pr_ExecuteSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FloatPrimaryExpression}. - * @param ctx the parse tree - */ - void enterPr_FloatPrimaryExpression(@NotNull CfgParser.Pr_FloatPrimaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FloatPrimaryExpression}. - * @param ctx the parse tree - */ - void exitPr_FloatPrimaryExpression(@NotNull CfgParser.Pr_FloatPrimaryExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_NetFunctionTimes}. - * @param ctx the parse tree - */ - void enterPr_NetFunctionTimes(@NotNull CfgParser.Pr_NetFunctionTimesContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_NetFunctionTimes}. - * @param ctx the parse tree - */ - void exitPr_NetFunctionTimes(@NotNull CfgParser.Pr_NetFunctionTimesContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_HStringValue}. - * @param ctx the parse tree - */ - void enterPr_HStringValue(@NotNull CfgParser.Pr_HStringValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_HStringValue}. - * @param ctx the parse tree - */ - void exitPr_HStringValue(@NotNull CfgParser.Pr_HStringValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IntegerUnaryExpression}. - * @param ctx the parse tree - */ - void enterPr_IntegerUnaryExpression(@NotNull CfgParser.Pr_IntegerUnaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IntegerUnaryExpression}. - * @param ctx the parse tree - */ - void exitPr_IntegerUnaryExpression(@NotNull CfgParser.Pr_IntegerUnaryExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_FloatUnaryExpression}. - * @param ctx the parse tree - */ - void enterPr_FloatUnaryExpression(@NotNull CfgParser.Pr_FloatUnaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_FloatUnaryExpression}. - * @param ctx the parse tree - */ - void exitPr_FloatUnaryExpression(@NotNull CfgParser.Pr_FloatUnaryExpressionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MatchingHintsValue}. - * @param ctx the parse tree - */ - void enterPr_MatchingHintsValue(@NotNull CfgParser.Pr_MatchingHintsValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MatchingHintsValue}. - * @param ctx the parse tree - */ - void exitPr_MatchingHintsValue(@NotNull CfgParser.Pr_MatchingHintsValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_IncludeSection}. - * @param ctx the parse tree - */ - void enterPr_IncludeSection(@NotNull CfgParser.Pr_IncludeSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_IncludeSection}. - * @param ctx the parse tree - */ - void exitPr_IncludeSection(@NotNull CfgParser.Pr_IncludeSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_HString}. - * @param ctx the parse tree - */ - void enterPr_HString(@NotNull CfgParser.Pr_HStringContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_HString}. - * @param ctx the parse tree - */ - void exitPr_HString(@NotNull CfgParser.Pr_HStringContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_PatternChunkList}. - * @param ctx the parse tree - */ - void enterPr_PatternChunkList(@NotNull CfgParser.Pr_PatternChunkListContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_PatternChunkList}. - * @param ctx the parse tree - */ - void exitPr_PatternChunkList(@NotNull CfgParser.Pr_PatternChunkListContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_UniversalOrNotStringValue}. - * @param ctx the parse tree - */ - void enterPr_UniversalOrNotStringValue(@NotNull CfgParser.Pr_UniversalOrNotStringValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_UniversalOrNotStringValue}. - * @param ctx the parse tree - */ - void exitPr_UniversalOrNotStringValue(@NotNull CfgParser.Pr_UniversalOrNotStringValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_Detailed}. - * @param ctx the parse tree - */ - void enterPr_Detailed(@NotNull CfgParser.Pr_DetailedContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_Detailed}. - * @param ctx the parse tree - */ - void exitPr_Detailed(@NotNull CfgParser.Pr_DetailedContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_NetLineTimes}. - * @param ctx the parse tree - */ - void enterPr_NetLineTimes(@NotNull CfgParser.Pr_NetLineTimesContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_NetLineTimes}. - * @param ctx the parse tree - */ - void exitPr_NetLineTimes(@NotNull CfgParser.Pr_NetLineTimesContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ObjIdComponent}. - * @param ctx the parse tree - */ - void enterPr_ObjIdComponent(@NotNull CfgParser.Pr_ObjIdComponentContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ObjIdComponent}. - * @param ctx the parse tree - */ - void exitPr_ObjIdComponent(@NotNull CfgParser.Pr_ObjIdComponentContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ExternalCommandsSection}. - * @param ctx the parse tree - */ - void enterPr_ExternalCommandsSection(@NotNull CfgParser.Pr_ExternalCommandsSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ExternalCommandsSection}. - * @param ctx the parse tree - */ - void exitPr_ExternalCommandsSection(@NotNull CfgParser.Pr_ExternalCommandsSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_TestportName}. - * @param ctx the parse tree - */ - void enterPr_TestportName(@NotNull CfgParser.Pr_TestportNameContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_TestportName}. - * @param ctx the parse tree - */ - void exitPr_TestportName(@NotNull CfgParser.Pr_TestportNameContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_OStringValue}. - * @param ctx the parse tree - */ - void enterPr_OStringValue(@NotNull CfgParser.Pr_OStringValueContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_OStringValue}. - * @param ctx the parse tree - */ - void exitPr_OStringValue(@NotNull CfgParser.Pr_OStringValueContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DefaultSection}. - * @param ctx the parse tree - */ - void enterPr_DefaultSection(@NotNull CfgParser.Pr_DefaultSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DefaultSection}. - * @param ctx the parse tree - */ - void exitPr_DefaultSection(@NotNull CfgParser.Pr_DefaultSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LogEventTypeSet}. - * @param ctx the parse tree - */ - void enterPr_LogEventTypeSet(@NotNull CfgParser.Pr_LogEventTypeSetContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LogEventTypeSet}. - * @param ctx the parse tree - */ - void exitPr_LogEventTypeSet(@NotNull CfgParser.Pr_LogEventTypeSetContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LoggerPluginEntry}. - * @param ctx the parse tree - */ - void enterPr_LoggerPluginEntry(@NotNull CfgParser.Pr_LoggerPluginEntryContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LoggerPluginEntry}. - * @param ctx the parse tree - */ - void exitPr_LoggerPluginEntry(@NotNull CfgParser.Pr_LoggerPluginEntryContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_deprecatedEventTypeSet}. - * @param ctx the parse tree - */ - void enterPr_deprecatedEventTypeSet(@NotNull CfgParser.Pr_deprecatedEventTypeSetContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_deprecatedEventTypeSet}. - * @param ctx the parse tree - */ - void exitPr_deprecatedEventTypeSet(@NotNull CfgParser.Pr_deprecatedEventTypeSetContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LengthBound}. - * @param ctx the parse tree - */ - void enterPr_LengthBound(@NotNull CfgParser.Pr_LengthBoundContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LengthBound}. - * @param ctx the parse tree - */ - void exitPr_LengthBound(@NotNull CfgParser.Pr_LengthBoundContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StatisticsFilter}. - * @param ctx the parse tree - */ - void enterPr_StatisticsFilter(@NotNull CfgParser.Pr_StatisticsFilterContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StatisticsFilter}. - * @param ctx the parse tree - */ - void exitPr_StatisticsFilter(@NotNull CfgParser.Pr_StatisticsFilterContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_DisableProfiler}. - * @param ctx the parse tree - */ - void enterPr_DisableProfiler(@NotNull CfgParser.Pr_DisableProfilerContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_DisableProfiler}. - * @param ctx the parse tree - */ - void exitPr_DisableProfiler(@NotNull CfgParser.Pr_DisableProfilerContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MacroAssignment}. - * @param ctx the parse tree - */ - void enterPr_MacroAssignment(@NotNull CfgParser.Pr_MacroAssignmentContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MacroAssignment}. - * @param ctx the parse tree - */ - void exitPr_MacroAssignment(@NotNull CfgParser.Pr_MacroAssignmentContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LoggingSection}. - * @param ctx the parse tree - */ - void enterPr_LoggingSection(@NotNull CfgParser.Pr_LoggingSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LoggingSection}. - * @param ctx the parse tree - */ - void exitPr_LoggingSection(@NotNull CfgParser.Pr_LoggingSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LogfileName}. - * @param ctx the parse tree - */ - void enterPr_LogfileName(@NotNull CfgParser.Pr_LogfileNameContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LogfileName}. - * @param ctx the parse tree - */ - void exitPr_LogfileName(@NotNull CfgParser.Pr_LogfileNameContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_TemplateItemList}. - * @param ctx the parse tree - */ - void enterPr_TemplateItemList(@NotNull CfgParser.Pr_TemplateItemListContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_TemplateItemList}. - * @param ctx the parse tree - */ - void exitPr_TemplateItemList(@NotNull CfgParser.Pr_TemplateItemListContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_StartAutomatically}. - * @param ctx the parse tree - */ - void enterPr_StartAutomatically(@NotNull CfgParser.Pr_StartAutomaticallyContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_StartAutomatically}. - * @param ctx the parse tree - */ - void exitPr_StartAutomatically(@NotNull CfgParser.Pr_StartAutomaticallyContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ComponentsSection}. - * @param ctx the parse tree - */ - void enterPr_ComponentsSection(@NotNull CfgParser.Pr_ComponentsSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ComponentsSection}. - * @param ctx the parse tree - */ - void exitPr_ComponentsSection(@NotNull CfgParser.Pr_ComponentsSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MainControllerItemNumHcs}. - * @param ctx the parse tree - */ - void enterPr_MainControllerItemNumHcs(@NotNull CfgParser.Pr_MainControllerItemNumHcsContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MainControllerItemNumHcs}. - * @param ctx the parse tree - */ - void exitPr_MainControllerItemNumHcs(@NotNull CfgParser.Pr_MainControllerItemNumHcsContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_Quadruple}. - * @param ctx the parse tree - */ - void enterPr_Quadruple(@NotNull CfgParser.Pr_QuadrupleContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_Quadruple}. - * @param ctx the parse tree - */ - void exitPr_Quadruple(@NotNull CfgParser.Pr_QuadrupleContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ProfilerSection}. - * @param ctx the parse tree - */ - void enterPr_ProfilerSection(@NotNull CfgParser.Pr_ProfilerSectionContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ProfilerSection}. - * @param ctx the parse tree - */ - void exitPr_ProfilerSection(@NotNull CfgParser.Pr_ProfilerSectionContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_HStringMatch}. - * @param ctx the parse tree - */ - void enterPr_HStringMatch(@NotNull CfgParser.Pr_HStringMatchContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_HStringMatch}. - * @param ctx the parse tree - */ - void exitPr_HStringMatch(@NotNull CfgParser.Pr_HStringMatchContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_MacroExpliciteCString}. - * @param ctx the parse tree - */ - void enterPr_MacroExpliciteCString(@NotNull CfgParser.Pr_MacroExpliciteCStringContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_MacroExpliciteCString}. - * @param ctx the parse tree - */ - void exitPr_MacroExpliciteCString(@NotNull CfgParser.Pr_MacroExpliciteCStringContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ComponentName}. - * @param ctx the parse tree - */ - void enterPr_ComponentName(@NotNull CfgParser.Pr_ComponentNameContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ComponentName}. - * @param ctx the parse tree - */ - void exitPr_ComponentName(@NotNull CfgParser.Pr_ComponentNameContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_OStringMatch}. - * @param ctx the parse tree - */ - void enterPr_OStringMatch(@NotNull CfgParser.Pr_OStringMatchContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_OStringMatch}. - * @param ctx the parse tree - */ - void exitPr_OStringMatch(@NotNull CfgParser.Pr_OStringMatchContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_GroupItem}. - * @param ctx the parse tree - */ - void enterPr_GroupItem(@NotNull CfgParser.Pr_GroupItemContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_GroupItem}. - * @param ctx the parse tree - */ - void exitPr_GroupItem(@NotNull CfgParser.Pr_GroupItemContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_LoggerPluginsPart}. - * @param ctx the parse tree - */ - void enterPr_LoggerPluginsPart(@NotNull CfgParser.Pr_LoggerPluginsPartContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_LoggerPluginsPart}. - * @param ctx the parse tree - */ - void exitPr_LoggerPluginsPart(@NotNull CfgParser.Pr_LoggerPluginsPartContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_ParameterValueOrNotUsedSymbol}. - * @param ctx the parse tree - */ - void enterPr_ParameterValueOrNotUsedSymbol(@NotNull CfgParser.Pr_ParameterValueOrNotUsedSymbolContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_ParameterValueOrNotUsedSymbol}. - * @param ctx the parse tree - */ - void exitPr_ParameterValueOrNotUsedSymbol(@NotNull CfgParser.Pr_ParameterValueOrNotUsedSymbolContext ctx); - - /** - * Enter a parse tree produced by {@link CfgParser#pr_Number}. - * @param ctx the parse tree - */ - void enterPr_Number(@NotNull CfgParser.Pr_NumberContext ctx); - /** - * Exit a parse tree produced by {@link CfgParser#pr_Number}. - * @param ctx the parse tree - */ - void exitPr_Number(@NotNull CfgParser.Pr_NumberContext ctx); -} \ No newline at end of file diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgResolverListener.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgResolverListener.java deleted file mode 100644 index f3e8562206f0582ce357f995022a6e2daf6b58b3..0000000000000000000000000000000000000000 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/CfgResolverListener.java +++ /dev/null @@ -1,503 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2000-2015 Ericsson Telecom AB - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - ******************************************************************************/ -package org.eclipse.titan.common.parsers.cfg; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.misc.NotNull; -import org.eclipse.core.resources.IMarker; -import org.eclipse.titan.common.parsers.TITANMarker; - -public class CfgResolverListener extends CfgParserBaseListener { - - private List<TITANMarker> mWarnings = new ArrayList<TITANMarker>(); - - private Map<String, CfgDefinitionInformation> mDefinitions = new HashMap<String, CfgDefinitionInformation>(); - private Map<String, String> mEnvVariables = new HashMap<String, String>(); - - private Integer mTcpPort = null; - private String mLocalAddress = null; - private Double mKillTimer = null; - private Integer mNumHcs = null; - private Boolean mUnixDomainSocket = null; - private Map<String, String> mComponents = new HashMap<String, String>(); - private Map<String, String[]> mGroups = new HashMap<String, String[]>(); - private List<String> mExecuteElements = new ArrayList<String>(); - - private int mLine = 1; - private int mOffset = 0; - - public void setDefinitions( Map<String,CfgDefinitionInformation> aDefs ) { - mDefinitions = aDefs; - } - - public void setEnvironmentalVariables( Map<String, String> aEnvVariables ) { - mEnvVariables = aEnvVariables; - } - - public Boolean getUnixDomainSocket() { - return mUnixDomainSocket; - } - - public Double getKillTimer() { - return mKillTimer; - } - - public String getLocalAddress() { - return mLocalAddress; - } - - public Integer getNumHcs() { - return mNumHcs; - } - - public Integer getTcpPort() { - return mTcpPort; - } - - public Map<String, String[]> getGroups() { - return mGroups; - } - - public Map<String, String> getComponents() { - return mComponents; - } - - public List<String> getExecuteElements() { - return mExecuteElements; - } - - /** - * Creates a marker. - * Locations of input tokens are not moved by offset and line yet, this function does this conversion. - * @param aMessage marker message - * @param aStartToken the 1st token, its line and start position will be used for the location - * NOTE: start position is the column index of the tokens 1st character. - * Column index starts with 0. - * @param aEndToken the last token, its end position will be used for the location. - * NOTE: end position is the column index after the token's last character. - * @param aSeverity severity (info/warning/error) - * @param aPriority priority (low/normal/high) - * @return new marker - */ - public TITANMarker createMarker( final String aMessage, final Token aStartToken, final Token aEndToken, final int aSeverity, final int aPriority ) { - TITANMarker marker = new TITANMarker( - aMessage, - (aStartToken != null) ? mLine - 1 + aStartToken.getLine() : -1, - (aStartToken != null) ? mOffset + aStartToken.getStartIndex() : -1, - (aEndToken != null) ? mOffset + aEndToken.getStopIndex() + 1 : -1, - aSeverity, aPriority ); - return marker; - } - - /** - * Adds an error marker. - * Locations of input tokens are not moved by offset and line yet, this function does this conversion. - * @param aMessage marker message - * @param aStartToken the 1st token, its line and start position will be used for the location - * NOTE: start position is the column index of the tokens 1st character. - * Column index starts with 0. - * @param aEndToken the last token, its end position will be used for the location. - * NOTE: end position is the column index after the token's last character. - */ - public void reportError( final String aMessage, final Token aStartToken, final Token aEndToken ) { - TITANMarker marker = createMarker( aMessage, aStartToken, aEndToken, IMarker.SEVERITY_ERROR, IMarker.PRIORITY_NORMAL ); - mWarnings.add(marker); - } - - /** - * Gets the value of a macro or an environment variable - * @param aDefinition macro or environment variable - * @return macro or environment variable value, or null if there is no such definition - */ - private String getDefinitionValue(String aDefinition){ - if ( mDefinitions != null && mDefinitions.containsKey( aDefinition ) ) { - return mDefinitions.get( aDefinition ).getValue(); - } else if ( mEnvVariables != null && mEnvVariables.containsKey( aDefinition ) ) { - return mEnvVariables.get( aDefinition ); - } else { - return null; - } - } - -//TODO: remove BEGIN -// already filled in parser - @Override - public void exitPr_ExecuteSectionItem(@NotNull CfgParser.Pr_ExecuteSectionItemContext ctx) { - mExecuteElements.add( ctx.t.getText() ); - } - - @Override - public void exitPr_MainControllerItemUnixDomainSocket(@NotNull CfgParser.Pr_MainControllerItemUnixDomainSocketContext ctx) { - mUnixDomainSocket = Boolean.parseBoolean( ctx.u.getText() ); - } - - @Override - public void exitPr_MainControllerItemKillTimer(@NotNull CfgParser.Pr_MainControllerItemKillTimerContext ctx) { - mKillTimer = Double.parseDouble( ctx.k.getText() ); - } - - @Override - public void exitPr_MainControllerItemLocalAddress(@NotNull CfgParser.Pr_MainControllerItemLocalAddressContext ctx) { - mLocalAddress = ctx.l.getText(); - } - - @Override - public void exitPr_MainControllerItemNumHcs(@NotNull CfgParser.Pr_MainControllerItemNumHcsContext ctx) { - mNumHcs = Integer.parseInt( ctx.n.getText() ); - } - - @Override - public void exitPr_MainControllerItemTcpPort(@NotNull CfgParser.Pr_MainControllerItemTcpPortContext ctx) { - mTcpPort = Integer.parseInt( ctx.t.getText() ); - } - - @Override - public void exitPr_ComponentItem(@NotNull CfgParser.Pr_ComponentItemContext ctx) { - if ( ctx.h != null ) { - mComponents.put( ctx.n.getText(), ctx.h.getText() ); - } - else if ( ctx.i != null ) { - mComponents.put( ctx.n.getText(), ctx.i.getText() ); - } - } -//TODO: remove END - - @Override - public void exitPr_CString(@NotNull CfgParser.Pr_CStringContext ctx) { - /* - if( ctx.macro1 != null ) { - int commaPosition = ctx.macro1.getText().indexOf(','); - String definition = ctx.macro1.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if ( value != null ) { - tempAST.initialize(STRING,"\""+value+"\""); - } else { - tempAST.initialize(STRING,"\"\""); - reportError( "Could not resolve definition: " + definition + " using \"\" as a replacement.", ctx.macro1.start, ctx.macro1.stop ); - } - } - else if( ctx.macro2 != null ) { - String definition = ctx.macro2.getText().substring(1, ctx.macro2.getText().length()); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if ( value != null ) { - tempAST.initialize(STRING,"\""+value+"\""); - } else { - tempAST.initialize(STRING,"\"\""); - reportError( "Could not resolve definition: " + definition + " using \"\" as a replacement.", ctx.macro2.start, ctx.macro2.stop ); - } - } - */ - //TODO: implement - } -/* - // nem jok a helyettesitesek !!! (kornyezeti valtozok kimaradtak) - pr_CString: - ( STRING - | !macro1:MACRO_EXPLICITE_CSTR - { - int commaPosition = macro1.getText().indexOf(','); - String definition = macro1.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(STRING,"\""+value+"\""); - ## = #(tempAST); - }else{ - tempAST.initialize(STRING,"\"\""); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using \"\" as a replacement."); - ex.column = macro1.getOffset(); - ex.line = macro1.getLine(); - throw ex; - } - } - | !macro2:MACRO_CSTR - { - String definition = macro2.getText().substring(1,macro2.getText().length()); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(STRING,"\""+value+"\""); - ## = #(tempAST); - }else{ - tempAST.initialize(STRING,"\"\""); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using \"\" as a replacement."); - ex.column = macro2.getOffset(); - ex.line = macro2.getLine(); - throw ex; - } - } - ); -*/ - - @Override public void exitPr_Boolean(@NotNull CfgParser.Pr_BooleanContext ctx) { - //TODO: implement - } - -/* - pr_Boolean: - ( TRUE - | FALSE - | !macro:MACRO_BOOL - { - int commaPosition =macro.getText().indexOf(','); - String definition =macro.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if (value == null) { - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using \"true\" as a replacement."); - ex.column = macro.getOffset(); - ex.line = macro.getLine(); - throw ex; - } - if("false".equals(value)){ - tempAST.initialize(FALSE,"false"); - }else{ - tempAST.initialize(TRUE,"true"); - } - ## = #(tempAST); - } - ); -*/ - - @Override public void exitPr_Identifier(@NotNull CfgParser.Pr_IdentifierContext ctx) { - //TODO: implement - } - -/* - pr_Identifier: - ( TTCN3IDENTIFIER - | !macro:MACRO_ID - { - int commaPosition = macro.getText().indexOf(','); - String definition = macro.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(TTCN3IDENTIFIER,value); - ## = #(tempAST); - }else{ - tempAST.initialize(TTCN3IDENTIFIER,""); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using \"\" as a replacement."); - ex.column = macro.getOffset(); - ex.line = macro.getLine(); - reportError(ex); - } - } - ) - ; -*/ - - @Override public void exitPr_BString(@NotNull CfgParser.Pr_BStringContext ctx) { - //TODO: implement - } - -/* - pr_BString: - ( BITSTRING - | !macro:MACRO_BSTR - { - int commaPosition = macro.getText().indexOf(','); - String definition = macro.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(BITSTRING,"'" + value + "'B"); - ## = #(tempAST); - }else{ - tempAST.initialize(BITSTRING,"''B"); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using ''B as a replacement."); - ex.column = macro.getOffset(); - ex.line = macro.getLine(); - throw ex; - } - } - ); -*/ - - @Override public void exitPr_HString(@NotNull CfgParser.Pr_HStringContext ctx) { - //TODO: implement - } - -/* - pr_HString: - ( HEXSTRING - | !macro:MACRO_HSTR - { - int commaPosition = macro.getText().indexOf(','); - String definition = macro.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(HEXSTRING,"'" + value + "'H"); - ## = #(tempAST); - }else{ - tempAST.initialize(HEXSTRING,"''H"); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using ''H as a replacement."); - ex.column = macro.getOffset(); - ex.line = macro.getLine(); - throw ex; - } - } - ); -*/ - - @Override public void exitPr_OString(@NotNull CfgParser.Pr_OStringContext ctx) { - //TODO: implement - } - -/* - pr_OString: - ( OCTETSTRING - | macro1:MACRO_OSTR! - { - int commaPosition = macro1.getText().indexOf(','); - String definition = macro1.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(OCTETSTRING,"'" + value + "'O"); - ## = #(tempAST); - }else{ - tempAST.initialize(OCTETSTRING,"''O"); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using ''O as a replacement."); - ex.column = macro1.getOffset(); - ex.line = macro1.getLine(); - throw ex; - } - } - | macro2:MACRO_BINARY! - { - int commaPosition = macro2.getText().indexOf(','); - String definition = macro2.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(OCTETSTRING,value); - ## = #(tempAST); - }else{ - tempAST.initialize(OCTETSTRING,""); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using \"\" as a replacement."); - ex.column = macro2.getOffset(); - ex.line = macro2.getLine(); - throw ex; - } - } - ); -*/ - - @Override public void exitPr_HostName(@NotNull CfgParser.Pr_HostNameContext ctx) { - //TODO: implement - } -/* - pr_HostName: - ( pr_DNSName - | TTCN3IDENTIFIER - | !macro:MACRO_HOSTNAME - { - int commaPosition = macro.getText().indexOf(','); - String definition = macro.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(TTCN3IDENTIFIER,value); - ## = #(tempAST); - }else{ - tempAST.initialize(TTCN3IDENTIFIER,""); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve definition: " + definition + " using \"\" as a replacement."); - ex.column = macro.getOffset(); - ex.line = macro.getLine(); - throw ex; - } - } - ); -*/ - - @Override public void exitPr_Number(@NotNull CfgParser.Pr_NumberContext ctx) { - //TODO: implement - } - -/* - pr_Number: - ( NUMBER - | !macro:MACRO_INT - { - int commaPosition = macro.getText().indexOf(','); - String definition = macro.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(NUMBER,value); - ## = #(tempAST); - }else{ - tempAST.initialize(NUMBER,"0"); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("Could not resolve integer definition: " + definition + " using 0 as replacement."); - ex.column = macro.getOffset(); - ex.line = macro.getLine(); - throw ex; - } - } - ); -*/ - - @Override public void exitPr_Float(@NotNull CfgParser.Pr_FloatContext ctx) { - //TODO: implement - } - -/* - pr_Float: - ( FLOAT - | !macro:MACRO_FLOAT - { - int commaPosition = macro.getText().indexOf(','); - String definition = macro.getText().substring(2,commaPosition); - LocationAST tempAST = new LocationAST(); - String value = getDefinitionValue(definition); - if(value != null){ - tempAST.initialize(FLOAT,value); - ## = #(tempAST); - }else{ - tempAST.initialize(FLOAT,"0.0"); - ## = #(tempAST); - RecognitionException ex = - new RecognitionException("No macro or environmental variable defined " + - definition + " could be found, using 0.0 as a replacement value."); - ex.column = macro.getOffset(); - ex.line = macro.getLine(); - throw ex; - } - } - ); -*/ - -} diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigFileHandler.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigFileHandler.java index f6f3aea8622ed234091dc81780beec3c27c379c8..2b1e6c059778c2d477e3f58e64bd1166fef24449 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigFileHandler.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigFileHandler.java @@ -267,6 +267,7 @@ public final class ConfigFileHandler { if (analyzer.isLogFileNameDefined()) { logFileNameDefined = true; mLogFileName = analyzer.getLogFileName(); + localAddress = analyzer.getLocalAddress(); } LocationAST rootNode = new LocationAST( analyzer.getParseTreeRoot() ); if ( rootNode != null ) { diff --git a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigTreeNodeUtilities.java b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigTreeNodeUtilities.java index 2d052b806505f17b207eeb50f78b5b0f4caefafd..e72e006da9955ddbbc2fc842162b69f122fabb21 100644 --- a/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigTreeNodeUtilities.java +++ b/org.eclipse.titan.common/src/org/eclipse/titan/common/parsers/cfg/ConfigTreeNodeUtilities.java @@ -7,8 +7,6 @@ ******************************************************************************/ package org.eclipse.titan.common.parsers.cfg; -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.misc.Interval; import org.eclipse.titan.common.parsers.CommonHiddenStreamToken; import org.eclipse.titan.common.parsers.LocationAST; @@ -110,15 +108,6 @@ public final class ConfigTreeNodeUtilities { private static final StringBuilder print(final StringBuilder builder, final LocationAST root){ appendHiddenBefore(builder, root); - //TODO: remove - //* - ParserRuleContext rootRule = root.getRule(); - if ( rootRule != null ) { - int a = rootRule.start.getStartIndex(); - int b = rootRule.stop.getStopIndex(); - Interval interval = new Interval(a,b); - } - //*/ builder.append(root.getText()); appendChildren(builder, root); diff --git a/org.eclipse.titan.debug/META-INF/MANIFEST.MF b/org.eclipse.titan.debug/META-INF/MANIFEST.MF index 9bccc88b578af6d176bf29b3b0153dac787419c1..384c2326ea5d97f44cc7ce28838a4ae2448c7855 100644 --- a/org.eclipse.titan.debug/META-INF/MANIFEST.MF +++ b/org.eclipse.titan.debug/META-INF/MANIFEST.MF @@ -2,18 +2,17 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Titan_Debug Bundle-SymbolicName: org.eclipse.titan.debug;singleton:=true -Bundle-Version: 5.4.1.CRL_113_200_5_R4B_20151202-1100 +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 Bundle-Activator: org.eclipse.titan.debug.Activator -Bundle-Vendor: ekrisza +Bundle-Vendor: Eclipse Titan Project Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.titan.common, org.eclipse.core.resources, org.eclipse.ui.console, - org.eclipse.titan.common;bundle-version="5.4.1", - org.eclipse.titan.designer;bundle-version="5.4.1", - org.eclipse.titan.designer -Bundle-RequiredExecutionEnvironment: J2SE-1.5 + org.eclipse.titan.common;bundle-version="5.4.3", + org.eclipse.titan.designer;bundle-version="5.4.3" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true Bundle-ClassPath: . diff --git a/org.eclipse.titan.debug/plugin.xml b/org.eclipse.titan.debug/plugin.xml index 2e3b2d9a18d155da98d686a20d6d018e953d28fd..1b47ffef127dd935f0d4918e05b7fde0793dde37 100644 --- a/org.eclipse.titan.debug/plugin.xml +++ b/org.eclipse.titan.debug/plugin.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 diff --git a/org.eclipse.titan.designer/META-INF/MANIFEST.MF b/org.eclipse.titan.designer/META-INF/MANIFEST.MF index 60106f34568ab5f13cdfe0961a7ff7fa7862f9a3..85860c45fda3e0730479bfcf3f53765ccc9962ef 100644 --- a/org.eclipse.titan.designer/META-INF/MANIFEST.MF +++ b/org.eclipse.titan.designer/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Created-By: 23.6-b04 (Oracle Corporation) Bundle-ManifestVersion: 2 Bundle-Name: TITAN_Designer Plug-in Bundle-SymbolicName: org.eclipse.titan.designer;singleton:=true -Bundle-Version: 5.4.2.CRL_113_200_5_R4C_20160105-1100 +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 Bundle-Activator: org.eclipse.titan.designer.Activator Bundle-Vendor: Eclipse Titan Project Require-Bundle: org.eclipse.ui, @@ -22,7 +22,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.ui.navigator.resources, org.eclipse.core.filesystem, org.eclipse.debug.core, - org.eclipse.titan.common;bundle-version="5.4.1", + org.eclipse.titan.common;bundle-version="5.4.3", org.antlr.runtime;bundle-version="4.3.0" Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true diff --git a/org.eclipse.titan.designer/plugin.xml b/org.eclipse.titan.designer/plugin.xml index 3e6160fcb1ca90461b3eebafdbe64b8d2295e9e1..cbc6fd87dae713fb3f77882eacc0551984c0abbd 100644 --- a/org.eclipse.titan.designer/plugin.xml +++ b/org.eclipse.titan.designer/plugin.xml @@ -9,206 +9,235 @@ --> <?eclipse version="4.4"?> <plugin> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.NatureConverter" - id="org.eclipse.titan.designer.actions.NatureConverter" - name="NatureConverter"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.RemoteBuilder" - id="org.eclipse.titan.designer.actions.RemoteBuilder" - name="RemoteBuilder"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.ExcludeFromBuild" - id="org.eclipse.titan.designer.actions.ExcludeFromBuild" - name="ExcludeFromBuild"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.GenerateBuilderInformation" - id="org.eclipse.titan.designer.actions.GenerateBuilderInformation" - name="GenerateBuilderInformation"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.RenameRefactoringAction" - id="org.eclipse.titan.designer.editors.ttcnppeditor.RenameRefactoringAction" - name="Rename refactoring"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.FirstCharAction" - id="org.eclipse.titan.designer.editors.FirstCharAction" - name="Line Start"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.LastCharAction" - id="org.eclipse.titan.designer.editors.LastCharAction" - name="Line End"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.RenameRefactoringAction" - id="org.eclipse.titan.designer.editors.ttcn3editor.RenameRefactoringAction" - name="Rename refactoring"/></extension> - - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.configeditor.FirstCharAction" - id="org.eclipse.titan.designer.editors.configeditor.FirstCharAction" - name="Line Start"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.configeditor.LastCharAction" - id="org.eclipse.titan.designer.editors.configeditor.LastCharAction" - name="Line End"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoringAction" - id="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoringAction" - name="Rename refactoring"/></extension> - - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" - id="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" - name="Open Declaration"/> - </extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" - id="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" - name="Find References"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" - id="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" - name="Open Declaration"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.asn1editor.FindReferences" - id="org.eclipse.titan.designer.editors.asn1editor.FindReferences" - name="Find References"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoringAction" - id="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoring" - name="Rename refactoring"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" - id="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" - name="Open Declaration"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" - id="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" - name="Open Declaration"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" - id="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" - name="Find References"/></extension> - - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.ConvertXSD2TTCN" - id="org.eclipse.titan.designer.actions.ConvertXSD2TTCN" - name="Convert XSD files to TTCN-3"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.GenerateTestPortSkeleton" - id="org.eclipse.titan.designer.actions.GenerateTestPortSkeleton" - name="Generate Test Port skeleton"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.CheckSemantic" - id="org.eclipse.titan.designer.actions.CheckSemantic" - name="Check syntax and semantics (no code generation)"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.CheckSyntax" - id="org.eclipse.titan.designer.actions.CheckSyntax" - name="Check syntax (no semantic check, no code generation)"/></extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.actions.NatureConverter" + id="org.eclipse.titan.designer.actions.NatureConverter" name="NatureConverter" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.actions.RemoteBuilder" + id="org.eclipse.titan.designer.actions.RemoteBuilder" name="RemoteBuilder" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.actions.ExcludeFromBuild" + id="org.eclipse.titan.designer.actions.ExcludeFromBuild" name="ExcludeFromBuild" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.actions.GenerateBuilderInformation" + id="org.eclipse.titan.designer.actions.GenerateBuilderInformation" + name="GenerateBuilderInformation" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.RenameRefactoringAction" + id="org.eclipse.titan.designer.editors.ttcnppeditor.RenameRefactoringAction" + name="Rename refactoring" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.editors.FirstCharAction" + id="org.eclipse.titan.designer.editors.FirstCharAction" name="Line Start" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.editors.LastCharAction" + id="org.eclipse.titan.designer.editors.LastCharAction" name="Line End" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.RenameRefactoringAction" + id="org.eclipse.titan.designer.editors.ttcn3editor.RenameRefactoringAction" + name="Rename refactoring" /> + </extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.nativewin32actions.CheckVersion" - id="org.eclipse.titan.designer.nativewin32actions.CheckVersion" - name="Check compiler version"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.nativewin32actions.CheckSemantic" - id="org.eclipse.titan.designer.nativewin32actions.CheckSemantic" - name="Check syntax and semantics (no code generation, native Windows version)"/></extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.configeditor.FirstCharAction" + id="org.eclipse.titan.designer.editors.configeditor.FirstCharAction" + name="Line Start" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.configeditor.LastCharAction" + id="org.eclipse.titan.designer.editors.configeditor.LastCharAction" + name="Line End" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoringAction" + id="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoringAction" + name="Rename refactoring" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" + id="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" + name="Open Declaration" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" + id="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" + name="Find References" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" + id="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" + name="Open Declaration" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.asn1editor.FindReferences" + id="org.eclipse.titan.designer.editors.asn1editor.FindReferences" + name="Find References" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoringAction" + id="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoring" + name="Rename refactoring" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" + id="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" + name="Open Declaration" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" + id="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" + name="Open Declaration" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" + id="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" + name="Find References" /> + </extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.nativewin32actions.CheckSyntax" - id="org.eclipse.titan.designer.nativewin32actions.CheckSyntax" - name="Check syntax (no semantic check, no code generation, native Windows version)"/></extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.actions.ConvertXSD2TTCN" + id="org.eclipse.titan.designer.actions.ConvertXSD2TTCN" name="Convert XSD files to TTCN-3" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.actions.GenerateTestPortSkeleton" + id="org.eclipse.titan.designer.actions.GenerateTestPortSkeleton" + name="Generate Test Port skeleton" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.actions.CheckSemantic" + id="org.eclipse.titan.designer.actions.CheckSemantic" name="Check syntax and semantics (no code generation)" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.actions.CheckSyntax" + id="org.eclipse.titan.designer.actions.CheckSyntax" name="Check syntax (no semantic check, no code generation)" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.nativewin32actions.CheckVersion" + id="org.eclipse.titan.designer.nativewin32actions.CheckVersion" + name="Check compiler version" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.nativewin32actions.CheckSemantic" + id="org.eclipse.titan.designer.nativewin32actions.CheckSemantic" + name="Check syntax and semantics (no code generation, native Windows version)" /> + </extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.actions.CheckVersion" - id="org.eclipse.titan.designer.actions.CheckVersion" - name="Check syntax (no semantic check, no code generation, native Windows version)"/></extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.nativewin32actions.CheckSyntax" + id="org.eclipse.titan.designer.nativewin32actions.CheckSyntax" + name="Check syntax (no semantic check, no code generation, native Windows version)" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command defaultHandler="org.eclipse.titan.designer.actions.CheckVersion" + id="org.eclipse.titan.designer.actions.CheckVersion" + name="Check syntax (no semantic check, no code generation, native Windows version)" /> + </extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.asn1editor.IndentAction" - id="org.eclipse.titan.designer.editors.asn1editor.IndentAction" - name="IndentAction"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.configeditor.IndentAction" - id="org.eclipse.titan.designer.editors.configeditor.IndentAction" - name="IndentAction"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.IndentAction" - id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3IndentAction" - name="IndentAction"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.IndentAction" - id="org.eclipse.titan.designer.editors.ttcnppeditor.IndentAction" - name="IndentAction"/></extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.asn1editor.IndentAction" + id="org.eclipse.titan.designer.editors.asn1editor.IndentAction" + name="IndentAction" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.configeditor.IndentAction" + id="org.eclipse.titan.designer.editors.configeditor.IndentAction" + name="IndentAction" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.IndentAction" + id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3IndentAction" + name="IndentAction" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.IndentAction" + id="org.eclipse.titan.designer.editors.ttcnppeditor.IndentAction" + name="IndentAction" /> + </extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.GotoMatchingBracketAction" - id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3GotoMatchingBracketAction" - name="Go to Matching Bracket"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.GotoMatchingBracketAction" - id="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPGotoMatchingBracketAction" - name="Go to Matching Bracket"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.configeditor.GotoMatchingBracketAction" - id="org.eclipse.titan.designer.editors.configeditor.ConfigGotoMatchingBracketAction" - name="Go to Matching Bracket"/></extension> - <extension point="org.eclipse.ui.commands"><command - defaultHandler="org.eclipse.titan.designer.editors.asn1editor.GotoMatchingBracketAction" - id="org.eclipse.titan.designer.editors.asn1editor.ASN1GotoMatchingBracketAction" - name="Go to Matching Bracket"/> + <extension point="org.eclipse.ui.commands"> <command - defaultHandler="org.eclipse.titan.designer.actions.FindDefinitionAction" - id="org.eclipse.titan.designer.actions.FindDefinitionAction" - name="Find definition"/> + defaultHandler="org.eclipse.titan.designer.editors.ttcn3editor.GotoMatchingBracketAction" + id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3GotoMatchingBracketAction" + name="Go to Matching Bracket" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.ttcnppeditor.GotoMatchingBracketAction" + id="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPGotoMatchingBracketAction" + name="Go to Matching Bracket" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.configeditor.GotoMatchingBracketAction" + id="org.eclipse.titan.designer.editors.configeditor.ConfigGotoMatchingBracketAction" + name="Go to Matching Bracket" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.designer.editors.asn1editor.GotoMatchingBracketAction" + id="org.eclipse.titan.designer.editors.asn1editor.ASN1GotoMatchingBracketAction" + name="Go to Matching Bracket" /> + <command defaultHandler="org.eclipse.titan.designer.actions.FindDefinitionAction" + id="org.eclipse.titan.designer.actions.FindDefinitionAction" name="Find definition" /> </extension> - <extension - point="org.eclipse.ui.editors"> - <editor - name="TTCN-3 Editor" - extensions="ttcn, ttcn3" - icon="icons/ttcn.gif" + <extension point="org.eclipse.ui.editors"> + <editor name="TTCN-3 Editor" extensions="ttcn, ttcn3" icon="icons/ttcn.gif" contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor" class="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3Editor" id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3Editor"> </editor> - <editor - name="TTCNPP Editor" - extensions="ttcnpp" - icon="icons/ttcnpp.gif" + <editor name="TTCNPP Editor" extensions="ttcnpp" icon="icons/ttcnpp.gif" contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor" class="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPEditor" id="org.eclipse.titan.designer.editors.ttcn3ppeditor.TTCN3PPEditor"> </editor> - <editor - name="TTCNINC Editor" - extensions="ttcnin" - icon="icons/ttcninc.gif" + <editor name="TTCNINC Editor" extensions="ttcnin" icon="icons/ttcninc.gif" contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor" class="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPEditor" id="org.eclipse.titan.designer.editors.ttcn3ineditor.TTCN3INEditor"> </editor> - <editor - name="ASN1 Editor" - extensions="asn, asn1" - icon="icons/asn.gif" + <editor name="ASN1 Editor" extensions="asn, asn1" icon="icons/asn.gif" contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor" class="org.eclipse.titan.designer.editors.asn1editor.ASN1Editor" id="org.eclipse.titan.designer.editors.asn1editor.ASN1Editor"> </editor> - <editor - name="Configuration Editor" - extensions="cfg" - icon="icons/cfg.gif" - contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor" + <editor name="Configuration Editor" extensions="cfg" + icon="icons/cfg.gif" contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor" class="org.eclipse.titan.designer.editors.configeditor.ConfigEditor" id="org.eclipse.titan.designer.editors.configeditor.ConfigEditor"> </editor> @@ -219,292 +248,231 @@ -<extension - id="TITANActions" - name="TITAN Actions" - point="org.eclipse.ui.menus"> + <extension id="TITANActions" name="TITAN Actions" point="org.eclipse.ui.menus"> <menuContribution - locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> - <toolbar + locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> + <toolbar id="org.eclipse.example.commands.toolbar.changeSetOperations" - label="ChangeSet Operations"> - <command - commandId="org.eclipse.titan.designer.actions.ConvertXSD2TTCN" - icon="icons/xsd2ttcn.gif" - disabledIcon="icons/xsd2ttcn_d.gif" - label="Convert XSD files to TTCN-3" - tooltip="Convert XSD files to TTCN-3"> - <visibleWhen> - <not> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> + label="ChangeSet Operations"> + <command commandId="org.eclipse.titan.designer.actions.ConvertXSD2TTCN" + icon="icons/xsd2ttcn.gif" disabledIcon="icons/xsd2ttcn_d.gif" + label="Convert XSD files to TTCN-3" tooltip="Convert XSD files to TTCN-3"> + <visibleWhen> + <not> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> </not> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titan.designer.actions.GenerateTestPortSkeleton" - icon="icons/generate_testport.gif" - disabledIcon="icons/generate_testport_d.gif" - label="Generate Test Port skeleton" - tooltip="Generate Test Port skeleton"> - <visibleWhen> - <not> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> + </visibleWhen> + </command> + <command + commandId="org.eclipse.titan.designer.actions.GenerateTestPortSkeleton" + icon="icons/generate_testport.gif" disabledIcon="icons/generate_testport_d.gif" + label="Generate Test Port skeleton" tooltip="Generate Test Port skeleton"> + <visibleWhen> + <not> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> </not> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titan.designer.actions.CheckVersion" - icon="icons/check_version.gif" - disabledIcon="icons/check_version_d.gif" - label="Check compiler version" - tooltip="Check compiler version"> - <visibleWhen> - <not> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> + </visibleWhen> + </command> + <command commandId="org.eclipse.titan.designer.actions.CheckVersion" + icon="icons/check_version.gif" disabledIcon="icons/check_version_d.gif" + label="Check compiler version" tooltip="Check compiler version"> + <visibleWhen> + <not> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> </not> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titan.designer.actions.CheckSemantic" - icon="icons/check_semantic.gif" - disabledIcon="icons/check_semantic_d.gif" - label="Check semantics" - tooltip="Check syntax and semantics (no code generation)"> - <visibleWhen> - <not> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> + </visibleWhen> + </command> + <command commandId="org.eclipse.titan.designer.actions.CheckSemantic" + icon="icons/check_semantic.gif" disabledIcon="icons/check_semantic_d.gif" + label="Check semantics" tooltip="Check syntax and semantics (no code generation)"> + <visibleWhen> + <not> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> </not> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titan.designer.actions.CheckSyntax" - icon="icons/check_syntax.gif" - disabledIcon="icons/check_syntax_d.gif" - label="Check syntax" - tooltip="Check syntax (no semantic check, no code generation)"> - <visibleWhen> - <not> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> + </visibleWhen> + </command> + <command commandId="org.eclipse.titan.designer.actions.CheckSyntax" + icon="icons/check_syntax.gif" disabledIcon="icons/check_syntax_d.gif" + label="Check syntax" tooltip="Check syntax (no semantic check, no code generation)"> + <visibleWhen> + <not> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> </not> - </visibleWhen> - </command> - <command - id="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" - commandId="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" - label="Toggle Comment" - tooltip="Toggle Comment"> - <visibleWhen> - <not> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> + </visibleWhen> + </command> + <command + id="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" + commandId="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" + label="Toggle Comment" tooltip="Toggle Comment"> + <visibleWhen> + <not> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> </not> - </visibleWhen> - </command> + </visibleWhen> + </command> </toolbar> </menuContribution> <menuContribution - locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> - <toolbar + locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> + <toolbar id="org.eclipse.example.commands.toolbar.changeSetOperations" - label="ChangeSet Operations"> - <command - icon="icons/check_version_win.gif" - disabledIcon="icons/check_version_win_d.gif" - label="Check compiler version" - tooltip="Check compiler version (native Windows version)" - commandId="org.eclipse.titan.designer.nativewin32actions.CheckVersion"> - <visibleWhen> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> - </visibleWhen> - </command> - <command - id="org.eclipse.titan.designer.nativewin32CheckSemantic" - icon="icons/check_semantic_win.gif" - disabledIcon="icons/check_semantic_win_d.gif" - label="Check semantics" - tooltip="Check syntax and semantics (no code generation, native Windows version)" - commandId="org.eclipse.titan.designer.nativewin32actions.CheckSemantic"> - <visibleWhen> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> - </visibleWhen> - </command> - <command - id="org.eclipse.titan.designer.nativewin32CheckSyntax" - icon="icons/check_syntax_win.gif" - disabledIcon="icons/check_syntax_win_d.gif" - label="Check syntax" - tooltip="Check syntax (no semantic check, no code generation, native Windows version)" - commandId="org.eclipse.titan.designer.nativewin32actions.CheckSyntax"> - <visibleWhen> - <or> - <systemTest property="os.name" value="Windows 7"/> - <systemTest property="os.name" value="Windows Vista"/> - </or> - </visibleWhen> - </command> + label="ChangeSet Operations"> + <command icon="icons/check_version_win.gif" + disabledIcon="icons/check_version_win_d.gif" label="Check compiler version" + tooltip="Check compiler version (native Windows version)" + commandId="org.eclipse.titan.designer.nativewin32actions.CheckVersion"> + <visibleWhen> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> + </visibleWhen> + </command> + <command id="org.eclipse.titan.designer.nativewin32CheckSemantic" + icon="icons/check_semantic_win.gif" disabledIcon="icons/check_semantic_win_d.gif" + label="Check semantics" + tooltip="Check syntax and semantics (no code generation, native Windows version)" + commandId="org.eclipse.titan.designer.nativewin32actions.CheckSemantic"> + <visibleWhen> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> + </visibleWhen> + </command> + <command id="org.eclipse.titan.designer.nativewin32CheckSyntax" + icon="icons/check_syntax_win.gif" disabledIcon="icons/check_syntax_win_d.gif" + label="Check syntax" + tooltip="Check syntax (no semantic check, no code generation, native Windows version)" + commandId="org.eclipse.titan.designer.nativewin32actions.CheckSyntax"> + <visibleWhen> + <or> + <systemTest property="os.name" value="Windows 7" /> + <systemTest property="os.name" value="Windows Vista" /> + </or> + </visibleWhen> + </command> </toolbar> </menuContribution> </extension> - <extension - id="org.eclipse.titan.designer.core.TITANNature" - name="TITAN Nature" - point="org.eclipse.core.resources.natures"> + <extension id="org.eclipse.titan.designer.core.TITANNature" + name="TITAN Nature" point="org.eclipse.core.resources.natures"> <runtime> - <run class="org.eclipse.titan.designer.core.TITANNature"/> + <run class="org.eclipse.titan.designer.core.TITANNature" /> </runtime> - <builder id="org.eclipse.titan.designer.core.TITANBuilder"/> + <builder id="org.eclipse.titan.designer.core.TITANBuilder" /> </extension> - <extension - point="org.eclipse.ui.ide.projectNatureImages"> - <image - icon="icons/titan.gif" - id="org.eclipse.titan.designer.core.TITANNatureImage" - natureId="org.eclipse.titan.designer.core.TITANNature"/> + <extension point="org.eclipse.ui.ide.projectNatureImages"> + <image icon="icons/titan.gif" id="org.eclipse.titan.designer.core.TITANNatureImage" + natureId="org.eclipse.titan.designer.core.TITANNature" /> </extension> - <extension - id="org.eclipse.titan.designer.core.TITANBuilder" - name="TITANBuilder" - point="org.eclipse.core.resources.builders"> + <extension id="org.eclipse.titan.designer.core.TITANBuilder" + name="TITANBuilder" point="org.eclipse.core.resources.builders"> <builder hasNature="true"> - <run class="org.eclipse.titan.designer.core.TITANBuilder"/> + <run class="org.eclipse.titan.designer.core.TITANBuilder" /> </builder> </extension> - <extension - point="org.eclipse.ui.menus"> - <menuContribution - locationURI= - "popup:org.eclipse.ui.popup.any?after=additions"> - <menu label="Titan"> - <command - commandId="org.eclipse.titan.designer.actions.ExcludeFromBuild" - label="Toggle exclude from build state" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IResource"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titan.designer.actions.NatureConverter" - label="Toggle Titan project nature" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <separator - name="org.eclipse.titan.designer.separator1" - visible="true"> - </separator> - <command - commandId="org.eclipse.titan.designer.actions.GenerateBuilderInformation" - id="org.eclipse.titan.designer.actions.GenerateBuilderInformation" - label="Generate external builder information" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titan.designer.actions.RemoteBuilder" - id="org.eclipse.titan.designer.core.RemoteBuilder" - label="Build remotely"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - </menu> - </menuContribution> - + <extension point="org.eclipse.ui.menus"> + <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions"> + <menu + id="org.eclipse.titan.designer.TitanMenu" + label="Titan"> + <command commandId="org.eclipse.titan.designer.actions.ExcludeFromBuild" + label="Toggle exclude from build state" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IResource"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command commandId="org.eclipse.titan.designer.actions.NatureConverter" + label="Toggle Titan project nature" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <separator name="org.eclipse.titan.designer.separator1" + visible="true"> + </separator> + <command + commandId="org.eclipse.titan.designer.actions.GenerateBuilderInformation" + id="org.eclipse.titan.designer.actions.GenerateBuilderInformation" + label="Generate external builder information" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command commandId="org.eclipse.titan.designer.actions.RemoteBuilder" + id="org.eclipse.titan.designer.core.RemoteBuilder" label="Build remotely"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + </menu> + </menuContribution> <menuContribution - locationURI= - "popup:org.eclipse.titan.designer.editors.asn1editor.context?after=additions"> + locationURI="popup:org.eclipse.titan.designer.editors.asn1editor.context?after=additions"> <command - id="org.eclipse.titan.designer.editors.asn1editor.ASN1Indentation" - commandId="org.eclipse.titan.designer.editors.asn1editor.IndentAction" - label="Correct Indentation" - icon="icons/titan.gif"> + id="org.eclipse.titan.designer.editors.asn1editor.ASN1Indentation" + commandId="org.eclipse.titan.designer.editors.asn1editor.IndentAction" + label="Correct Indentation" icon="icons/titan.gif"> </command> <command id="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" commandId="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" - label="Open Declaration" - icon="icons/titan.gif"> + label="Open Declaration" icon="icons/titan.gif"> </command> <command id="org.eclipse.titan.designer.editors.asn1editor.FindReferences" commandId="org.eclipse.titan.designer.editors.asn1editor.FindReferences" - label="Find References" - icon="icons/titan.gif"> + label="Find References" icon="icons/titan.gif"> </command> <command commandId="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoring" @@ -514,37 +482,32 @@ </command> </menuContribution> - <menuContribution - locationURI= - "popup:org.eclipse.titan.designer.editors.configeditor.context?after=additions"> - <command + <menuContribution + locationURI="popup:org.eclipse.titan.designer.editors.configeditor.context?after=additions"> + <command id="org.eclipse.titan.designer.editors.configeditor.ConfigIndentation" commandId="org.eclipse.titan.designer.editors.configeditor.IndentAction" - label="Correct Indentation" - icon="icons/titan.gif"> + label="Correct Indentation" icon="icons/titan.gif"> </command> <command id="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" commandId="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" - label="Open Declaration" - icon="icons/titan.gif"> + label="Open Declaration" icon="icons/titan.gif"> </command> </menuContribution> - <menuContribution + <menuContribution locationURI="popup:org.eclipse.titan.designer.editors.ttcn3editor.context?after=additions"> <command id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3Indentation" commandId="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3IndentAction" - label="Correct Indentation" - icon="icons/titan.gif"> + label="Correct Indentation" icon="icons/titan.gif"> </command> <command id="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" commandId="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" - label="Open Declaration" - icon="icons/titan.gif"> + label="Open Declaration" icon="icons/titan.gif"> </command> <command commandId="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" @@ -565,14 +528,12 @@ <command id="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPIndentation" commandId="org.eclipse.titan.designer.editors.ttcnppeditor.IndentAction" - label="Correct Indentation" - icon="icons/titan.gif"> + label="Correct Indentation" icon="icons/titan.gif"> </command> <command id="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" commandId="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" - label="Open Declaration" - icon="icons/titan.gif"> + label="Open Declaration" icon="icons/titan.gif"> </command> <command commandId="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" @@ -589,653 +550,513 @@ </menuContribution> - </extension> + </extension> - <extension - point="org.eclipse.core.runtime.preferences"> - <initializer class="org.eclipse.titan.designer.preferences.PreferenceInitializer"/> + <extension point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.titan.designer.preferences.PreferenceInitializer" /> </extension> <extension point="org.eclipse.ui.preferencePages"> <page id="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" class="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" - name="TITAN Preferences"/> + name="TITAN Preferences" /> <page id="org.eclipse.titan.designer.preferences.pages.ContentAssistPage" class="org.eclipse.titan.designer.preferences.pages.ContentAssistPage" name="Content Assist" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> - <page - id="org.eclipse.titan.designer.preferences.pages.FoldingPage" + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> + <page id="org.eclipse.titan.designer.preferences.pages.FoldingPage" class="org.eclipse.titan.designer.preferences.pages.FoldingPage" name="Folding" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> <page id="org.eclipse.titan.designer.preferences.pages.OnTheFlyCheckerPreferencePage" class="org.eclipse.titan.designer.preferences.pages.OnTheFlyCheckerPreferencePage" name="On-the-fly checker" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> <page id="org.eclipse.titan.designer.preferences.pages.ErrorsWarningsPreferencePage" class="org.eclipse.titan.designer.preferences.pages.ErrorsWarningsPreferencePage" name="Errors/Warnings" - category="org.eclipse.titan.designer.preferences.pages.OnTheFlyCheckerPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.OnTheFlyCheckerPreferencePage" /> <page id="org.eclipse.titan.designer.preferences.pages.NamingConventionPreferencePage" class="org.eclipse.titan.designer.preferences.pages.NamingConventionPreferencePage" name="Naming conventions" - category="org.eclipse.titan.designer.preferences.pages.OnTheFlyCheckerPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.OnTheFlyCheckerPreferencePage" /> <page id="org.eclipse.titan.designer.preferences.pages.ExcludedResourcesPreferencePage" class="org.eclipse.titan.designer.preferences.pages.ExcludedResourcesPreferencePage" name="Excluded resources" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> <page id="org.eclipse.titan.designer.preferences.pages.SyntaxHighlightPage" class="org.eclipse.titan.designer.preferences.pages.SyntaxHighlightPage" name="Syntax Coloring" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> <page id="org.eclipse.titan.designer.preferences.pages.ShowMatchingBracketPage" class="org.eclipse.titan.designer.preferences.pages.ShowMatchingBracketPage" name="Highlight matching brackets" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> <page id="org.eclipse.titan.designer.preferences.pages.MarkOccurrencesPage" class="org.eclipse.titan.designer.preferences.pages.MarkOccurrencesPage" name="Mark occurrences" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> - <page - id="org.eclipse.titan.designer.preferences.pages.IndentationPage" + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> + <page id="org.eclipse.titan.designer.preferences.pages.IndentationPage" class="org.eclipse.titan.designer.preferences.pages.IndentationPage" name="Indentation" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> - <page - id="org.eclipse.titan.designer.preferences.pages.TypingPage" + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> + <page id="org.eclipse.titan.designer.preferences.pages.TypingPage" class="org.eclipse.titan.designer.preferences.pages.TypingPage" name="Typing" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> - <page - id="org.eclipse.titan.designer.preferences.pages.TITANActionPage" + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> + <page id="org.eclipse.titan.designer.preferences.pages.TITANActionPage" class="org.eclipse.titan.designer.preferences.pages.TITANActionPage" name="TITAN actions" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> - <page + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> + <page id="org.eclipse.titan.designer.preferences.pages.DebugPreferencePage" class="org.eclipse.titan.designer.preferences.pages.DebugPreferencePage" name="Debug" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> - <page + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> + <page id="org.eclipse.titan.designer.preferences.pages.ExportOptionsPage" class="org.eclipse.titan.designer.preferences.pages.ExportOptionsPage" name="Export" - category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage"/> + category="org.eclipse.titan.designer.preferences.pages.TITANPreferencePage" /> </extension> - <extension - point="org.eclipse.ui.propertyPages"> - <page - name="TITAN Project Property" - nameFilter="*" + <extension point="org.eclipse.ui.propertyPages"> + <page name="TITAN Project Property" nameFilter="*" class="org.eclipse.titan.designer.properties.pages.ProjectBuildPropertyPage" id="org.eclipse.titan.designer.properties.pages.ProjectBuildPropertyPage"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> </filter> <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> + <instanceof value="org.eclipse.core.resources.IProject"> </instanceof> </enabledWhen> </page> - <page - name="Naming convention" - nameFilter="*" + <page name="Naming convention" nameFilter="*" class="org.eclipse.titan.designer.properties.pages.ProjectNamingConventionPropertyPage" id="org.eclipse.titan.designer.properties.pages.ProjectNamingConventionPropertyPage" category="org.eclipse.titan.designer.properties.pages.ProjectBuildPropertyPage"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> </filter> <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> + <instanceof value="org.eclipse.core.resources.IProject"> </instanceof> </enabledWhen> </page> - <page - name="Remote build" - nameFilter="*" + <page name="Remote build" nameFilter="*" class="org.eclipse.titan.designer.properties.pages.ProjectRemoteBuildPropertyPage" id="org.eclipse.titan.designer.properties.pages.ProjectRemoteBuildPropertyPage" category="org.eclipse.titan.designer.properties.pages.ProjectBuildPropertyPage"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> </filter> <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> + <instanceof value="org.eclipse.core.resources.IProject"> </instanceof> </enabledWhen> </page> - <page - name="Project Configurations" - nameFilter="*" + <page name="Project Configurations" nameFilter="*" class="org.eclipse.titan.designer.properties.pages.ProjectConfigurationsPropertyPage" id="org.eclipse.titan.designer.properties.pages.ProjectConfigurationsPropertyPage" category="org.eclipse.titan.designer.properties.pages.ProjectBuildPropertyPage"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> </filter> <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> + <instanceof value="org.eclipse.core.resources.IProject"> </instanceof> </enabledWhen> </page> - <page - name="TITAN Folder Property" - nameFilter="*" + <page name="TITAN Folder Property" nameFilter="*" class="org.eclipse.titan.designer.properties.pages.FolderBuildPropertyPage" id="org.eclipse.titan.designer.properties.pages.FolderBuildPropertyPage"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> </filter> <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IFolder"> + <instanceof value="org.eclipse.core.resources.IFolder"> </instanceof> </enabledWhen> </page> - <page - name="Naming convention" - nameFilter="*" + <page name="Naming convention" nameFilter="*" class="org.eclipse.titan.designer.properties.pages.FolderNamingConventionPropertyPage" id="org.eclipse.titan.designer.properties.pages.FolderNamingConventionPropertyPage" category="org.eclipse.titan.designer.properties.pages.FolderBuildPropertyPage"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> </filter> <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IFolder"> + <instanceof value="org.eclipse.core.resources.IFolder"> </instanceof> </enabledWhen> </page> - <page - name="TITAN File Property" - nameFilter="*" + <page name="TITAN File Property" nameFilter="*" class="org.eclipse.titan.designer.properties.pages.FileBuildPropertyPage" id="org.eclipse.titan.designer.properties.pages.FileBuildPropertyPage"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> </filter> <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IFile"> + <instanceof value="org.eclipse.core.resources.IFile"> </instanceof> </enabledWhen> </page> </extension> <extension point="org.eclipse.ui.decorators"> - <decorator - id="org.eclipse.titan.designer.decorators.TITANDecorator" - lightweight="false" - label="TITAN Decorator" - state="true" - class= "org.eclipse.titan.designer.decorators.TITANDecorator" + <decorator id="org.eclipse.titan.designer.decorators.TITANDecorator" + lightweight="false" label="TITAN Decorator" state="true" + class="org.eclipse.titan.designer.decorators.TITANDecorator" adaptable="false"> <description> - This decorator shows whether the Makefile is managed by TITAN or the user. + This decorator shows whether the Makefile is managed + by TITAN or the user. </description> <enablement> - <objectClass name="org.eclipse.core.resources.IResource"/> + <objectClass name="org.eclipse.core.resources.IResource" /> </enablement> </decorator> </extension> - <extension - id="org.eclipse.titan.designer.compilerErrorMarker" - name="Compiler's error markers" - point="org.eclipse.core.resources.markers"> - <super type="org.eclipse.core.resources.problemmarker"/> - <attribute name="compilerproblems"/> + <extension id="org.eclipse.titan.designer.compilerErrorMarker" + name="Compiler's error markers" point="org.eclipse.core.resources.markers"> + <super type="org.eclipse.core.resources.problemmarker" /> + <attribute name="compilerproblems" /> </extension> - <extension - id="org.eclipse.titan.designer.compilerWarningMarker" - name="Compiler's warning markers" - point="org.eclipse.core.resources.markers"> - <super type="org.eclipse.core.resources.problemmarker"/> - <attribute name="compilerproblems"/> - </extension> - <extension - id="org.eclipse.titan.designer.compilerInfoMarker" - name="Compiler's info markers" - point="org.eclipse.core.resources.markers"> - <super type="org.eclipse.core.resources.problemmarker"/> - <attribute name="compilerproblems"/> + <extension id="org.eclipse.titan.designer.compilerWarningMarker" + name="Compiler's warning markers" point="org.eclipse.core.resources.markers"> + <super type="org.eclipse.core.resources.problemmarker" /> + <attribute name="compilerproblems" /> </extension> - <extension - id="org.eclipse.titan.designer.ontheflySyntacticMarker" - name="on-the-fly syntactic markers" - point="org.eclipse.core.resources.markers"> - <super type="org.eclipse.core.resources.problemmarker"/> - <attribute name="ontheflyproblems"/> + <extension id="org.eclipse.titan.designer.compilerInfoMarker" + name="Compiler's info markers" point="org.eclipse.core.resources.markers"> + <super type="org.eclipse.core.resources.problemmarker" /> + <attribute name="compilerproblems" /> </extension> - <extension - id="org.eclipse.titan.designer.ontheflySemanticMarker" - name="on-the-fly semantic markers" - point="org.eclipse.core.resources.markers"> - <super type="org.eclipse.core.resources.problemmarker"/> - <attribute name="ontheflyproblems"/> - </extension> - <extension - id="org.eclipse.titan.designer.ontheflyMixedMarker" - name="on-the-fly mixed markers" - point="org.eclipse.core.resources.markers"> - <super type="org.eclipse.core.resources.problemmarker"/> - <attribute name="ontheflyproblems"/> + <extension id="org.eclipse.titan.designer.ontheflySyntacticMarker" + name="on-the-fly syntactic markers" point="org.eclipse.core.resources.markers"> + <super type="org.eclipse.core.resources.problemmarker" /> + <attribute name="ontheflyproblems" /> </extension> - <extension - id="org.eclipse.titan.designer.ontheflyTaskMarker" - name="on-the-fly task markers" - point="org.eclipse.core.resources.markers"> - <super type="org.eclipse.core.resources.taskmarker"/> - <attribute name="ontheflyproblems"/> + <extension id="org.eclipse.titan.designer.ontheflySemanticMarker" + name="on-the-fly semantic markers" point="org.eclipse.core.resources.markers"> + <super type="org.eclipse.core.resources.problemmarker" /> + <attribute name="ontheflyproblems" /> </extension> - <extension - point="org.eclipse.ui.ide.markerSupport"> + <extension id="org.eclipse.titan.designer.ontheflyMixedMarker" + name="on-the-fly mixed markers" point="org.eclipse.core.resources.markers"> + <super type="org.eclipse.core.resources.problemmarker" /> + <attribute name="ontheflyproblems" /> + </extension> + <extension id="org.eclipse.titan.designer.ontheflyTaskMarker" + name="on-the-fly task markers" point="org.eclipse.core.resources.markers"> + <super type="org.eclipse.core.resources.taskmarker" /> + <attribute name="ontheflyproblems" /> + </extension> + <extension point="org.eclipse.ui.ide.markerSupport"> <markerTypeCategory name="TITAN compiler problems"> - <markerTypeReference id="org.eclipse.titan.designer.compilerErrorMarker"/> - <markerTypeReference id="org.eclipse.titan.designer.compilerWarningMarker"/> - <markerTypeReference id="org.eclipse.titan.designer.compilerInfoMarker"/> + <markerTypeReference + id="org.eclipse.titan.designer.compilerErrorMarker" /> + <markerTypeReference + id="org.eclipse.titan.designer.compilerWarningMarker" /> + <markerTypeReference + id="org.eclipse.titan.designer.compilerInfoMarker" /> </markerTypeCategory> <markerTypeCategory name="TITAN on-the-fly syntactic problems"> - <markerTypeReference id="org.eclipse.titan.designer.ontheflySyntacticMarker"/> + <markerTypeReference + id="org.eclipse.titan.designer.ontheflySyntacticMarker" /> </markerTypeCategory> <markerTypeCategory name="TITAN on-the-fly semantic problems"> - <markerTypeReference id="org.eclipse.titan.designer.ontheflySemanticMarker"/> + <markerTypeReference + id="org.eclipse.titan.designer.ontheflySemanticMarker" /> </markerTypeCategory> - <markerTypeCategory name="TITAN on-the-fly mixed problems"> - <markerTypeReference id="org.eclipse.titan.designer.ontheflyMixedMarker"/> + <markerTypeCategory name="TITAN on-the-fly mixed problems"> + <markerTypeReference + id="org.eclipse.titan.designer.ontheflyMixedMarker" /> </markerTypeCategory> - <markerGrouping - id="org.eclipse.titan.designer.markerGrouping" - label="TITAN problems"/> - <markerGroupingEntry - id="org.eclipse.titan.designer.TITANProblemsGroup" - label="TITAN problems" - markerGrouping="org.eclipse.titan.designer.markerGrouping" - priority="994"/> - <markerAttributeGrouping - attribute="compilerproblems" + <markerGrouping id="org.eclipse.titan.designer.markerGrouping" + label="TITAN problems" /> + <markerGroupingEntry id="org.eclipse.titan.designer.TITANProblemsGroup" + label="TITAN problems" markerGrouping="org.eclipse.titan.designer.markerGrouping" + priority="994" /> + <markerAttributeGrouping attribute="compilerproblems" defaultGroupingEntry="org.eclipse.titan.designer.TITANProblemsGroup" - markerType="org.eclipse.titan.designer.compilerErrorMarker"/> - <markerAttributeGrouping - attribute="compilerproblems" + markerType="org.eclipse.titan.designer.compilerErrorMarker" /> + <markerAttributeGrouping attribute="compilerproblems" defaultGroupingEntry="org.eclipse.titan.designer.TITANProblemsGroup" - markerType="org.eclipse.titan.designer.compilerWarningMarker"/> - <markerAttributeGrouping - attribute="compilerproblems" + markerType="org.eclipse.titan.designer.compilerWarningMarker" /> + <markerAttributeGrouping attribute="compilerproblems" defaultGroupingEntry="org.eclipse.titan.designer.TITANProblemsGroup" - markerType="org.eclipse.titan.designer.compilerInfoMarker"/> - <markerAttributeGrouping - attribute="ontheflyproblems" + markerType="org.eclipse.titan.designer.compilerInfoMarker" /> + <markerAttributeGrouping attribute="ontheflyproblems" defaultGroupingEntry="org.eclipse.titan.designer.TITANProblemsGroup" - markerType="org.eclipse.titan.designer.ontheflySyntacticMarker"/> - <markerAttributeGrouping - attribute="ontheflyproblems" + markerType="org.eclipse.titan.designer.ontheflySyntacticMarker" /> + <markerAttributeGrouping attribute="ontheflyproblems" defaultGroupingEntry="org.eclipse.titan.designer.TITANProblemsGroup" - markerType="org.eclipse.titan.designer.ontheflySemanticMarker"/> - <markerAttributeGrouping - attribute="ontheflyproblems" + markerType="org.eclipse.titan.designer.ontheflySemanticMarker" /> + <markerAttributeGrouping attribute="ontheflyproblems" defaultGroupingEntry="org.eclipse.titan.designer.TITANProblemsGroup" - markerType="org.eclipse.titan.designer.ontheflyMixedMarker"/> + markerType="org.eclipse.titan.designer.ontheflyMixedMarker" /> </extension> <extension point="org.eclipse.ui.editors.annotationTypes"> - <type - name="org.eclipse.titan.designer.compilerErrorMarkerAnnotationType" - super="org.eclipse.ui.workbench.texteditor.error" - markerType="org.eclipse.titan.designer.compilerErrorMarker"> - </type> - <type - name="org.eclipse.titan.designer.compilerWarningMarkerAnnotationType" - super="org.eclipse.ui.workbench.texteditor.warning" - markerType="org.eclipse.titan.designer.compilerWarningMarker"> - </type> - <type - name="org.eclipse.titan.designer.compilerInfoMarkerAnnotationType" - super="org.eclipse.ui.workbench.texteditor.info" - markerType="org.eclipse.titan.designer.compilerInfoMarker"> - </type> - <type - name="org.eclipse.titan.occurrences"> - </type> - <type - name="org.eclipse.titan.inactive_code"> - </type> + <type name="org.eclipse.titan.designer.compilerErrorMarkerAnnotationType" + super="org.eclipse.ui.workbench.texteditor.error" markerType="org.eclipse.titan.designer.compilerErrorMarker"> + </type> + <type + name="org.eclipse.titan.designer.compilerWarningMarkerAnnotationType" + super="org.eclipse.ui.workbench.texteditor.warning" markerType="org.eclipse.titan.designer.compilerWarningMarker"> + </type> + <type name="org.eclipse.titan.designer.compilerInfoMarkerAnnotationType" + super="org.eclipse.ui.workbench.texteditor.info" markerType="org.eclipse.titan.designer.compilerInfoMarker"> + </type> + <type name="org.eclipse.titan.occurrences"> + </type> + <type name="org.eclipse.titan.inactive_code"> + </type> </extension> <extension point="org.eclipse.ui.editors.markerAnnotationSpecification"> <specification - annotationType = "org.eclipse.titan.designer.compilerErrorMarkerAnnotationType" - annotationImageProvider = "org.eclipse.titan.designer.editors.AnnotationImageProvider" - verticalRulerPreferenceValue="true" - overviewRulerPreferenceValue="true"> + annotationType="org.eclipse.titan.designer.compilerErrorMarkerAnnotationType" + annotationImageProvider="org.eclipse.titan.designer.editors.AnnotationImageProvider" + verticalRulerPreferenceValue="true" overviewRulerPreferenceValue="true"> </specification> <specification - annotationType = "org.eclipse.titan.designer.compilerWarningMarkerAnnotationType" - annotationImageProvider = "org.eclipse.titan.designer.editors.AnnotationImageProvider" - verticalRulerPreferenceValue="true" - overviewRulerPreferenceValue="true"> + annotationType="org.eclipse.titan.designer.compilerWarningMarkerAnnotationType" + annotationImageProvider="org.eclipse.titan.designer.editors.AnnotationImageProvider" + verticalRulerPreferenceValue="true" overviewRulerPreferenceValue="true"> </specification> <specification - annotationType = "org.eclipse.titan.designer.compilerInfoMarkerAnnotationType" - annotationImageProvider = "org.eclipse.titan.designer.editors.AnnotationImageProvider" - verticalRulerPreferenceValue="true" - overviewRulerPreferenceValue="true"> + annotationType="org.eclipse.titan.designer.compilerInfoMarkerAnnotationType" + annotationImageProvider="org.eclipse.titan.designer.editors.AnnotationImageProvider" + verticalRulerPreferenceValue="true" overviewRulerPreferenceValue="true"> </specification> - <specification - annotationType="org.eclipse.titan.occurrences" - label="Occurrences" - icon="icons/match.gif" - colorPreferenceKey="occurrenceMarkColor" - colorPreferenceValue="212,212,212" - overviewRulerPreferenceKey="occurrenceMarkOverviewRuler" + <specification annotationType="org.eclipse.titan.occurrences" + label="Occurrences" icon="icons/match.gif" colorPreferenceKey="occurrenceMarkColor" + colorPreferenceValue="212,212,212" overviewRulerPreferenceKey="occurrenceMarkOverviewRuler" verticalRulerPreferenceKey="occurrenceMarkVerticalRuler" - overviewRulerPreferenceValue="true" - verticalRulerPreferenceValue="false" - textPreferenceKey="occurrenceMark" - highlightPreferenceKey="occurrenceHighlighting" - highlightPreferenceValue="true" - presentationLayer="4" - textPreferenceValue="false" - contributesToHeader="false" + overviewRulerPreferenceValue="true" verticalRulerPreferenceValue="false" + textPreferenceKey="occurrenceMark" highlightPreferenceKey="occurrenceHighlighting" + highlightPreferenceValue="true" presentationLayer="4" + textPreferenceValue="false" contributesToHeader="false" showInNextPrevDropdownToolbarActionKey="occurrenceMarkInNextPrevDropdownToolbarAction" showInNextPrevDropdownToolbarAction="true"> </specification> - <specification - annotationType="org.eclipse.titan.inactive_code" - label="Inactive code" - icon="icons/match.gif" - colorPreferenceKey="inactiveCodeMarkColor" - colorPreferenceValue="212,212,212" - overviewRulerPreferenceKey="inactiveCodeMarkOverviewRuler" + <specification annotationType="org.eclipse.titan.inactive_code" + label="Inactive code" icon="icons/match.gif" colorPreferenceKey="inactiveCodeMarkColor" + colorPreferenceValue="212,212,212" overviewRulerPreferenceKey="inactiveCodeMarkOverviewRuler" verticalRulerPreferenceKey="inactiveCodeMarkVerticalRuler" - overviewRulerPreferenceValue="true" - verticalRulerPreferenceValue="false" - textPreferenceKey="inactiveCodeMark" - highlightPreferenceKey="inactiveCodeHighlighting" - highlightPreferenceValue="true" - presentationLayer="4" - textPreferenceValue="false" - contributesToHeader="false" + overviewRulerPreferenceValue="true" verticalRulerPreferenceValue="false" + textPreferenceKey="inactiveCodeMark" highlightPreferenceKey="inactiveCodeHighlighting" + highlightPreferenceValue="true" presentationLayer="4" + textPreferenceValue="false" contributesToHeader="false" showInNextPrevDropdownToolbarActionKey="inactiveCodeMarkInNextPrevDropdownToolbarAction" showInNextPrevDropdownToolbarAction="true"> </specification> - </extension > - <extension - point="org.eclipse.ui.newWizards"> + </extension> + <extension point="org.eclipse.ui.newWizards"> <wizard category="org.eclipse.titan.designer.wizards.NewTITANWizard" class="org.eclipse.titan.designer.wizards.NewTITANProjectWizard" - icon="icons/titan.gif" - id="org.eclipse.titan.designer.wizards.NewTITANProjectWizard" - name="TITAN Project" - finalPerspective = "org.eclipse.titan.designer.perspectives.EditingPerspective" - preferredPerspectives = "org.eclipse.titan.designer.perspectives.EditingPerspective" + icon="icons/titan.gif" id="org.eclipse.titan.designer.wizards.NewTITANProjectWizard" + name="TITAN Project" finalPerspective="org.eclipse.titan.designer.perspectives.EditingPerspective" + preferredPerspectives="org.eclipse.titan.designer.perspectives.EditingPerspective" project="true" /> <wizard category="org.eclipse.titan.designer.wizards.NewTITANWizard" class="org.eclipse.titan.designer.wizards.NewTTCN3ModuleWizard" - icon="icons/ttcn.gif" - id="org.eclipse.titan.designer.wizards.NewTTCN3ModuleWizard" - name="TTCN3 Module" - preferredPerspectives = "org.eclipse.titan.designer.perspectives.EditingPerspective" + icon="icons/ttcn.gif" id="org.eclipse.titan.designer.wizards.NewTTCN3ModuleWizard" + name="TTCN3 Module" preferredPerspectives="org.eclipse.titan.designer.perspectives.EditingPerspective" project="false" /> <wizard category="org.eclipse.titan.designer.wizards.NewTITANWizard" class="org.eclipse.titan.designer.wizards.NewASN1ModuleWizard" - icon="icons/asn.gif" - id="org.eclipse.titan.designer.wizards.NewASN1ModuleWizard" - name="ASN1 Module" - preferredPerspectives = "org.eclipse.titan.designer.perspectives.EditingPerspective" + icon="icons/asn.gif" id="org.eclipse.titan.designer.wizards.NewASN1ModuleWizard" + name="ASN1 Module" preferredPerspectives="org.eclipse.titan.designer.perspectives.EditingPerspective" project="false" /> - <wizard - category="org.eclipse.titan.designer.wizards.NewTITANWizard" + <wizard category="org.eclipse.titan.designer.wizards.NewTITANWizard" class="org.eclipse.titan.designer.wizards.NewConfigFileWizard" - icon="icons/cfg.gif" - id="org.eclipse.titan.designer.wizards.NewConfigFileWizard" - name="Configuration file" - preferredPerspectives="org.eclipse.titan.designer.perspectives.EditingPerspective" - project="false"/> - <category id="org.eclipse.titan.designer.wizards.NewTITANWizard" name="TITAN" /> + icon="icons/cfg.gif" id="org.eclipse.titan.designer.wizards.NewConfigFileWizard" + name="Configuration file" preferredPerspectives="org.eclipse.titan.designer.perspectives.EditingPerspective" + project="false" /> + <category id="org.eclipse.titan.designer.wizards.NewTITANWizard" + name="TITAN" /> </extension> - <extension - point="org.eclipse.ui.importWizards"> - <category - id="org.eclipse.titan.designer.wizards.TITANImportCategory" + <extension point="org.eclipse.ui.importWizards"> + <category id="org.eclipse.titan.designer.wizards.TITANImportCategory" name="TITAN"> </category> <wizard class="org.eclipse.titan.designer.wizards.TITANProjectImportWizard" - icon="icons/titan.gif" - id="org.eclipse.titan.designer.wizards.TITANProjectImportWizard" - name="Project from .prj file" - category="org.eclipse.titan.designer.wizards.TITANImportCategory"/> + icon="icons/titan.gif" id="org.eclipse.titan.designer.wizards.TITANProjectImportWizard" + name="Project from .prj file" category="org.eclipse.titan.designer.wizards.TITANImportCategory" /> <wizard class="org.eclipse.titan.designer.wizards.projectFormat.NewTITANProjectImportWizard" icon="icons/titan.gif" id="org.eclipse.titan.designer.wizards.NewTITANProjectImportWizard" - name="Project from .tpd file" - category="org.eclipse.titan.designer.wizards.TITANImportCategory"/> + name="Project from .tpd file" category="org.eclipse.titan.designer.wizards.TITANImportCategory" /> </extension> - <extension - point="org.eclipse.ui.exportWizards"> - <category - id="org.eclipse.titan.designer.wizards.TITANExportCategory" + <extension point="org.eclipse.ui.exportWizards"> + <category id="org.eclipse.titan.designer.wizards.TITANExportCategory" name="TITAN"> </category> <wizard class="org.eclipse.titan.designer.wizards.projectFormat.TITANProjectExportWizard" icon="icons/titan.gif" id="org.eclipse.titan.designer.wizards.NewTITANProjectExportWizard" - name="TITAN Project settings" - category="org.eclipse.titan.designer.wizards.TITANExportCategory"> - <description> - Exports TITAN Designer related project information - </description> + name="TITAN Project settings" category="org.eclipse.titan.designer.wizards.TITANExportCategory"> + <description> + Exports TITAN Designer related project information + </description> </wizard> </extension> - <extension - point="org.eclipse.ui.perspectives"> + <extension point="org.eclipse.ui.perspectives"> <perspective class="org.eclipse.titan.designer.perspectives.EditingPerspective" - icon="icons/titan.gif" - id="org.eclipse.titan.designer.perspectives.EditingPerspective" - name="TITAN Editing"/> + icon="icons/titan.gif" id="org.eclipse.titan.designer.perspectives.EditingPerspective" + name="TITAN Editing" /> </extension> <extension point="org.eclipse.help.toc"> - <toc file="toc.xml" primary="false"/> + <toc file="toc.xml" primary="false" /> </extension> - <extension - point="org.eclipse.ui.commands"> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" - description="Jumps to and back the first visible char" - id="org.eclipse.titan.designer.firstChar" - name="Line Start"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" - description="Jumps to and back the last visible char" - id="org.eclipse.titan.designer.lastChar" - name="Line End"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + <extension point="org.eclipse.ui.commands"> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" + description="Jumps to and back the first visible char" id="org.eclipse.titan.designer.firstChar" + name="Line Start" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" + description="Jumps to and back the last visible char" id="org.eclipse.titan.designer.lastChar" + name="Line End" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Opens a declaration" id="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" - name="Open Declaration"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" - description="Finds references to a declaration/assignment" - id="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" - name="Find References"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Open Declaration" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" + description="Finds references to a declaration/assignment" + id="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" + name="Find References" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Rename refactoring" id="org.eclipse.titan.designer.editors.ttcn3editor.RenameRefactoring" - name="Rename refactoring"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Rename refactoring" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Toggle Comment" id="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" - name="Toggle Comment"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Toggle Comment" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Corrects the indentation" id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3Indentation" - name="Correct Indentation"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Correct Indentation" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Go to Matching Bracket" id="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3GotoMatchingBracket" - name="Go to Matching Bracket"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Go to Matching Bracket" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Opens a declaration" id="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" - name="Open Declaration"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" - description="Finds references to a declaration/assignment" - id="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" - name="Find References"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Open Declaration" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" + description="Finds references to a declaration/assignment" + id="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" + name="Find References" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Rename refactoring" id="org.eclipse.titan.designer.editors.ttcnppeditor.RenameRefactoring" - name="Rename refactoring"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Rename refactoring" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Corrects the indentation" id="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPIndentation" - name="Correct Indentation"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Correct Indentation" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Go to Matching Bracket" id="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPGotoMatchingBracket" - name="Go to Matching Bracket"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Go to Matching Bracket" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Toggle Comment" id="org.eclipse.titan.designer.editors.ttcnppeditor.ToggleComment" - name="Toggle Comment"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Toggle Comment" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Opens a declaration" id="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" - name="Open Declaration"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Open Declaration" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Finds references to a declaration/assignment" id="org.eclipse.titan.designer.editors.asn1editor.FindReferences" - name="Find References"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Find References" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Rename refactoring" id="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoring" - name="Rename refactoring"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Rename refactoring" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Corrects the indentation" id="org.eclipse.titan.designer.editors.asn1editor.ASN1Indentation" - name="Correct Indentation"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Correct Indentation" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Go to Matching Bracket" id="org.eclipse.titan.designer.editors.asn1editor.ASN1GotoMatchingBracket" - name="Go to Matching Bracket"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Go to Matching Bracket" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Opens a declaration" id="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" - name="Open Declaration"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Open Declaration" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Corrects the indentation" id="org.eclipse.titan.designer.editors.configeditor.ConfigIndentation" - name="Correct Indentation"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Correct Indentation" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Go to Matching Bracket" id="org.eclipse.titan.designer.editors.configeditor.ConfigGotoMatchingBracket" - name="Go to Matching Bracket"/> - <command - categoryId="org.eclipse.titan.designer.editors.TITANCommands" + name="Go to Matching Bracket" /> + <command categoryId="org.eclipse.titan.designer.editors.TITANCommands" description="Toggle Comment" id="org.eclipse.titan.designer.editors.configeditor.ToggleComment" - name="Toggle Comment"/> - <category - id="org.eclipse.titan.designer.editors.TITANCommands" - name="TITAN Commands"/> + name="Toggle Comment" /> + <category id="org.eclipse.titan.designer.editors.TITANCommands" + name="TITAN Commands" /> </extension> - <extension - point="org.eclipse.ui.bindings"> - <key - commandId="org.eclipse.titan.designer.firstChar" + <extension point="org.eclipse.ui.bindings"> + <key commandId="org.eclipse.titan.designer.firstChar" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="HOME"/> - <key - commandId="org.eclipse.titan.designer.lastChar" + sequence="HOME" /> + <key commandId="org.eclipse.titan.designer.lastChar" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="END"/> + sequence="END" /> <key commandId="org.eclipse.titan.designer.editors.ttcn3editor.OpenDeclaration" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F3"/> - <key - commandId="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" + sequence="F3" /> + <key commandId="org.eclipse.titan.designer.editors.ttcn3editor.FindReferences" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F4"/> + sequence="F4" /> <key commandId="org.eclipse.titan.designer.editors.ttcn3editor.RenameRefactoringAction" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+F4"/> + sequence="CTRL+F4" /> <key commandId="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3IndentAction" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+I"/> + sequence="CTRL+I" /> <key commandId="org.eclipse.titan.designer.editors.ttcn3editor.TTCN3GotoMatchingBracketAction" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+SHIFT+P"/> - <key - commandId="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" + sequence="CTRL+SHIFT+P" /> + <key commandId="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+/"/> - <key - commandId="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" + sequence="CTRL+/" /> + <key commandId="org.eclipse.titan.designer.editors.ttcn3editor.ToggleComment" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+Numpad_divide"/> - <key - commandId="org.eclipse.titan.designer.firstChar" + sequence="CTRL+Numpad_divide" /> + <key commandId="org.eclipse.titan.designer.firstChar" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="HOME"> </key> - <key - commandId="org.eclipse.titan.designer.lastChar" + <key commandId="org.eclipse.titan.designer.lastChar" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="END"> @@ -1244,45 +1065,40 @@ commandId="org.eclipse.titan.designer.editors.ttcnppeditor.OpenDeclaration" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F3"/> + sequence="F3" /> <key commandId="org.eclipse.titan.designer.editors.ttcnppeditor.FindReferences" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F4"/> + sequence="F4" /> <key commandId="org.eclipse.titan.designer.editors.ttcnppeditor.RenameRefactoring" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+F4"/> - <key - commandId="org.eclipse.titan.designer.editors.ttcnppeditor.IndentAction" + sequence="CTRL+F4" /> + <key commandId="org.eclipse.titan.designer.editors.ttcnppeditor.IndentAction" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+I"/> - <key + sequence="CTRL+I" /> + <key commandId="org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPGotoMatchingBracket" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+SHIFT+P"/> - <key - commandId="org.eclipse.titan.designer.editors.ttcnppeditor.ToggleComment" + sequence="CTRL+SHIFT+P" /> + <key commandId="org.eclipse.titan.designer.editors.ttcnppeditor.ToggleComment" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+/"/> - <key - commandId="org.eclipse.titan.designer.editors.ttcnppeditor.ToggleComment" + sequence="CTRL+/" /> + <key commandId="org.eclipse.titan.designer.editors.ttcnppeditor.ToggleComment" contextId="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+Numpad_divide"/> - <key - commandId="org.eclipse.titan.designer.firstChar" + sequence="CTRL+Numpad_divide" /> + <key commandId="org.eclipse.titan.designer.firstChar" contextId="org.eclipse.titan.designer.editors.ConfigEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="HOME"> </key> - <key - commandId="org.eclipse.titan.designer.lastChar" + <key commandId="org.eclipse.titan.designer.lastChar" contextId="org.eclipse.titan.designer.editors.ConfigEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="END"> @@ -1291,222 +1107,195 @@ commandId="org.eclipse.titan.designer.editors.configeditor.OpenDeclaration" contextId="org.eclipse.titan.designer.editors.ConfigEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F3"/> - <key - commandId="org.eclipse.titan.designer.editors.configeditor.IndentAction" + sequence="F3" /> + <key commandId="org.eclipse.titan.designer.editors.configeditor.IndentAction" contextId="org.eclipse.titan.designer.editors.ConfigEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+I"/> - <key + sequence="CTRL+I" /> + <key commandId="org.eclipse.titan.designer.editors.configeditor.ConfigGotoMatchingBracket" contextId="org.eclipse.titan.designer.editors.ConfigEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+SHIFT+P"/> - <key - commandId="org.eclipse.titan.designer.editors.configeditor.ToggleComment" + sequence="CTRL+SHIFT+P" /> + <key commandId="org.eclipse.titan.designer.editors.configeditor.ToggleComment" contextId="org.eclipse.titan.designer.editors.ConfigEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+/"/> - <key - commandId="org.eclipse.titan.designer.editors.configeditor.ToggleComment" + sequence="CTRL+/" /> + <key commandId="org.eclipse.titan.designer.editors.configeditor.ToggleComment" contextId="org.eclipse.titan.designer.editors.ConfigEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+Numpad_divide"/> - <key - commandId="org.eclipse.titan.designer.firstChar" + sequence="CTRL+Numpad_divide" /> + <key commandId="org.eclipse.titan.designer.firstChar" contextId="org.eclipse.titan.designer.editors.ASN1EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="HOME"> </key> - <key - commandId="org.eclipse.titan.designer.lastChar" + <key commandId="org.eclipse.titan.designer.lastChar" contextId="org.eclipse.titan.designer.editors.ASN1EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="END"> </key> - <key - commandId="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" + <key commandId="org.eclipse.titan.designer.editors.asn1editor.OpenDeclaration" contextId="org.eclipse.titan.designer.editors.ASN1EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F3"/> - <key - commandId="org.eclipse.titan.designer.editors.asn1editor.FindReferences" + sequence="F3" /> + <key commandId="org.eclipse.titan.designer.editors.asn1editor.FindReferences" contextId="org.eclipse.titan.designer.editors.ASN1EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F4"/> + sequence="F4" /> <key commandId="org.eclipse.titan.designer.editors.asn1editor.RenameRefactoring" contextId="org.eclipse.titan.designer.editors.ASN1EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+F4"/> - <key - commandId="org.eclipse.titan.designer.editors.asn1editor.IndentAction" + sequence="CTRL+F4" /> + <key commandId="org.eclipse.titan.designer.editors.asn1editor.IndentAction" contextId="org.eclipse.titan.designer.editors.ASN1EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+I"/> - <key + sequence="CTRL+I" /> + <key commandId="org.eclipse.titan.designer.editors.asn1editor.ASN1GotoMatchingBracket" contextId="org.eclipse.titan.designer.editors.ASN1EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+SHIFT+P"/> - <key - commandId="org.eclipse.titan.designer.actions.FindDefinitionAction" + sequence="CTRL+SHIFT+P" /> + <key commandId="org.eclipse.titan.designer.actions.FindDefinitionAction" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+SHIFT+T"/> + sequence="CTRL+SHIFT+T" /> </extension> - <extension - point="org.eclipse.ui.contexts"> - <context - description="%context.editingText.description.testtest" - id="org.eclipse.titan.designer.editors.TTCN3EditorScope" - name="Editing TTCN-3 Source" - parentId="org.eclipse.ui.textEditorScope"/> - <context - description="%context.editingText.description.testtest" - id="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" - name="Editing TTCNPP Source" + <extension point="org.eclipse.ui.contexts"> + <context description="%context.editingText.description.testtest" + id="org.eclipse.titan.designer.editors.TTCN3EditorScope" name="Editing TTCN-3 Source" + parentId="org.eclipse.ui.textEditorScope" /> + <context description="%context.editingText.description.testtest" + id="org.eclipse.titan.designer.editors.TTCN3PPEditorScope" name="Editing TTCNPP Source" parentId="org.eclipse.ui.textEditorScope"> </context> - <context - description="%context.editingText.description.testtest" - id="org.eclipse.titan.designer.editors.ConfigEditorScope" - name="TITAN Config File" + <context description="%context.editingText.description.testtest" + id="org.eclipse.titan.designer.editors.ConfigEditorScope" name="TITAN Config File" parentId="org.eclipse.ui.textEditorScope"> </context> - <context - description="%context.editingText.description.testtest" - id="org.eclipse.titan.designer.editors.ASN1EditorScope" - name="Editing ASN.1 Source" + <context description="%context.editingText.description.testtest" + id="org.eclipse.titan.designer.editors.ASN1EditorScope" name="Editing ASN.1 Source" parentId="org.eclipse.ui.textEditorScope"> </context> </extension> - <extension - point="org.eclipse.ui.navigator.navigatorContent"> - <commonWizard type = "new" wizardId="org.eclipse.titan.designer.wizards.NewTITANProjectWizard" menuGroupId ="TITAN extension"> - <enablement> - <or> - <adapt type="org.eclipse.core.resources.IProject"/> - <adapt type="org.eclipse.core.resources.IWorkspaceRoot"/> - </or> - </enablement> - </commonWizard> - <commonWizard type = "new" wizardId="org.eclipse.titan.designer.wizards.NewTTCN3ModuleWizard" menuGroupId ="TITAN extension"> - <enablement> - <and> - <or> - <adapt type="org.eclipse.core.resources.IFolder"/> - <adapt type="org.eclipse.core.resources.IProject"/> - <adapt type="org.eclipse.core.resources.IWorkspaceRoot"/> - </or> - <test property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature" /> - </and> - </enablement> - </commonWizard> - <commonWizard type = "new" wizardId="org.eclipse.titan.designer.wizards.NewASN1ModuleWizard" menuGroupId ="TITAN extension"> - <enablement> - <and> - <or> - <adapt type="org.eclipse.core.resources.IFolder"/> - <adapt type="org.eclipse.core.resources.IProject"/> - <adapt type="org.eclipse.core.resources.IWorkspaceRoot"/> - </or> - <test property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature" /> - </and> - </enablement> - </commonWizard> - <commonWizard type = "new" wizardId="org.eclipse.titan.designer.wizards.NewConfigFileWizard" menuGroupId ="TITAN extension"> - <enablement> - <and> - <or> - <adapt type="org.eclipse.core.resources.IFolder"/> - <adapt type="org.eclipse.core.resources.IProject"/> - <adapt type="org.eclipse.core.resources.IWorkspaceRoot"/> - </or> - <test property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature" /> - </and> - </enablement> - </commonWizard> + <extension point="org.eclipse.ui.navigator.navigatorContent"> + <commonWizard type="new" + wizardId="org.eclipse.titan.designer.wizards.NewTITANProjectWizard" + menuGroupId="TITAN extension"> + <enablement> + <or> + <adapt type="org.eclipse.core.resources.IProject" /> + <adapt type="org.eclipse.core.resources.IWorkspaceRoot" /> + </or> + </enablement> + </commonWizard> + <commonWizard type="new" + wizardId="org.eclipse.titan.designer.wizards.NewTTCN3ModuleWizard" + menuGroupId="TITAN extension"> + <enablement> + <and> + <or> + <adapt type="org.eclipse.core.resources.IFolder" /> + <adapt type="org.eclipse.core.resources.IProject" /> + <adapt type="org.eclipse.core.resources.IWorkspaceRoot" /> + </or> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature" /> + </and> + </enablement> + </commonWizard> + <commonWizard type="new" + wizardId="org.eclipse.titan.designer.wizards.NewASN1ModuleWizard" + menuGroupId="TITAN extension"> + <enablement> + <and> + <or> + <adapt type="org.eclipse.core.resources.IFolder" /> + <adapt type="org.eclipse.core.resources.IProject" /> + <adapt type="org.eclipse.core.resources.IWorkspaceRoot" /> + </or> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature" /> + </and> + </enablement> + </commonWizard> + <commonWizard type="new" + wizardId="org.eclipse.titan.designer.wizards.NewConfigFileWizard" + menuGroupId="TITAN extension"> + <enablement> + <and> + <or> + <adapt type="org.eclipse.core.resources.IFolder" /> + <adapt type="org.eclipse.core.resources.IProject" /> + <adapt type="org.eclipse.core.resources.IWorkspaceRoot" /> + </or> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature" /> + </and> + </enablement> + </commonWizard> </extension> - <extension - point="org.eclipse.ui.navigator.navigatorContent"> - <commonFilter - activeByDefault="true" - class="org.eclipse.titan.designer.commonFilters.WorkingDirectoryFilter" - description="Hides the working directories of projects that have the TITAN nature too." - id="org.eclipse.titan.designer.commonFilters.WorkingDirectoryFilter" - name="TITAN working directory"> - </commonFilter> - <commonFilter - activeByDefault="false" - class="org.eclipse.titan.designer.commonFilters.ExcludedResourceFilter" - description="Hides the excluded resources of projects that have the TITAN nature too." - id="org.eclipse.titan.designer.commonFilters.ExcludedResourceFilter" - name="TITAN excluded resources"> - </commonFilter> + <extension point="org.eclipse.ui.navigator.navigatorContent"> + <commonFilter activeByDefault="true" + class="org.eclipse.titan.designer.commonFilters.WorkingDirectoryFilter" + description="Hides the working directories of projects that have the TITAN nature too." + id="org.eclipse.titan.designer.commonFilters.WorkingDirectoryFilter" + name="TITAN working directory"> + </commonFilter> + <commonFilter activeByDefault="false" + class="org.eclipse.titan.designer.commonFilters.ExcludedResourceFilter" + description="Hides the excluded resources of projects that have the TITAN nature too." + id="org.eclipse.titan.designer.commonFilters.ExcludedResourceFilter" + name="TITAN excluded resources"> + </commonFilter> </extension> - <extension - point="org.eclipse.ui.navigator.viewer"> - <viewerContentBinding - viewerId="org.eclipse.ui.navigator.ProjectExplorer"> - <includes> - <contentExtension - pattern="org.eclipse.titan.designer.commonFilters.WorkingDirectoryFilter"> - </contentExtension> - <contentExtension - pattern="org.eclipse.titan.designer.commonFilters.ExcludedResourceFilter"> - </contentExtension> - </includes> - </viewerContentBinding> + <extension point="org.eclipse.ui.navigator.viewer"> + <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> + <includes> + <contentExtension + pattern="org.eclipse.titan.designer.commonFilters.WorkingDirectoryFilter"> + </contentExtension> + <contentExtension + pattern="org.eclipse.titan.designer.commonFilters.ExcludedResourceFilter"> + </contentExtension> + </includes> + </viewerContentBinding> </extension> - <extension - id="org.eclipse.titan.designer.application.InvokeBuild" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titan.designer.application.InvokeBuild"> - </run> - </application> - </extension> - <extension - id="org.eclipse.titan.designer.application.LoadFromTpd" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titan.designer.application.LoadFromTpd"> - </run> - </application> + <extension id="org.eclipse.titan.designer.application.InvokeBuild" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titan.designer.application.InvokeBuild"> + </run> + </application> + </extension> + <extension id="org.eclipse.titan.designer.application.LoadFromTpd" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titan.designer.application.LoadFromTpd"> + </run> + </application> </extension> <extension - id="org.eclipse.titan.designer.editors.ttcn3editor.referenceSearch.ReferenceSearchResultView" - point="org.eclipse.search.searchResultViewPages"> - <viewPage - id="org.eclipse.titan.designer.editors.ttcn3editor.referenceSearch.ReferenceSearchResultView" - searchResultClass="org.eclipse.titan.designer.editors.referenceSearch.ReferenceSearchResult" - class="org.eclipse.titan.designer.editors.referenceSearch.ReferenceSearchResultView"> - </viewPage> - </extension> + id="org.eclipse.titan.designer.editors.ttcn3editor.referenceSearch.ReferenceSearchResultView" + point="org.eclipse.search.searchResultViewPages"> + <viewPage + id="org.eclipse.titan.designer.editors.ttcn3editor.referenceSearch.ReferenceSearchResultView" + searchResultClass="org.eclipse.titan.designer.editors.referenceSearch.ReferenceSearchResult" + class="org.eclipse.titan.designer.editors.referenceSearch.ReferenceSearchResultView"> + </viewPage> + </extension> <extension point="org.eclipse.ui.activities"> - <activity id="org.eclipse.titan.designer.activities.debug" - description="Makes the debug preference page visible" - name="Titan debug activity" /> - <activityPatternBinding - activityId="org.eclipse.titan.designer.activities.debug" - isEqualityPattern="true" - pattern="org.eclipse.titan.designer/org.eclipse.titan.designer.preferences.pages.DebugPreferencePage" /> - </extension> - <extension-point - id="org.eclipse.titan.designer.extensions.post_analyze" - name="Post-analyze" - schema="schema/post_analyze.exsd"/> + <activity id="org.eclipse.titan.designer.activities.debug" + description="Makes the debug preference page visible" name="Titan debug activity" /> + <activityPatternBinding + activityId="org.eclipse.titan.designer.activities.debug" + isEqualityPattern="true" + pattern="org.eclipse.titan.designer/org.eclipse.titan.designer.preferences.pages.DebugPreferencePage" /> + </extension> + <extension-point id="org.eclipse.titan.designer.extensions.post_analyze" + name="Post-analyze" schema="schema/post_analyze.exsd" /> </plugin> diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignment.java index 7327fad9a8cea9a4e7c1c835bac49150d672ca99..e1891a2f2564dc9d6019d21cecd88536f3c1e496 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignment.java @@ -15,6 +15,7 @@ import org.eclipse.core.runtime.preferences.IPreferencesService; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.titan.designer.Activator; +import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.Assignment; import org.eclipse.titan.designer.AST.IReferenceChain; import org.eclipse.titan.designer.AST.Identifier; @@ -39,7 +40,7 @@ public abstract class ASN1Assignment extends Assignment { private static boolean markOccurrences; - protected final Ass_pard ass_pard; + protected final Ass_pard assPard; static { final IPreferencesService prefService = Platform.getPreferencesService(); @@ -61,14 +62,14 @@ public abstract class ASN1Assignment extends Assignment { } } - protected ASN1Assignment(final Identifier id, final Ass_pard ass_pard) { + protected ASN1Assignment(final Identifier id, final Ass_pard assPard) { super(id); - this.ass_pard = ass_pard; + this.assPard = assPard; } /** @return the parameterizes assignment related to the assignment */ public final Ass_pard getAssPard() { - return ass_pard; + return assPard; } /** @@ -101,7 +102,7 @@ public abstract class ASN1Assignment extends Assignment { * @return the assignment created. * */ public final ASN1Assignment newInstance(final Module module) { - if (null == ass_pard) { + if (null == assPard) { if (null != location) { location.reportSemanticError(MessageFormat.format(NOTPARAMETERIZEDASSIGNMENT, getFullName())); } @@ -110,7 +111,7 @@ public abstract class ASN1Assignment extends Assignment { } String newName = getIdentifier().getAsnName() + "." + module.getIdentifier().getAsnName() + ".inst"; - newName += ass_pard.newInstanceNumber(module); + newName += assPard.newInstanceNumber(module); return internalNewInstance(new Identifier(Identifier_type.ID_ASN, newName)); } @@ -133,8 +134,8 @@ public abstract class ASN1Assignment extends Assignment { @Override public void check(final CompilationTimeStamp timestamp) { - if (null != ass_pard) { - ass_pard.check(timestamp); + if (null != assPard) { + assPard.check(timestamp); lastTimeChecked = timestamp; } } @@ -144,7 +145,7 @@ public abstract class ASN1Assignment extends Assignment { * * @param timestamp * the timestamp of the actual semantic check cycle. - * @param assignment_type + * @param assignmentType * the type to check against. * @param referenceChain * the reference chain to detect circular references @@ -152,9 +153,9 @@ public abstract class ASN1Assignment extends Assignment { * @return true if the assignment is of the specified type, false * otherwise * */ - public boolean isAssignmentType(final CompilationTimeStamp timestamp, final Assignment_type assignment_type, + public boolean isAssignmentType(final CompilationTimeStamp timestamp, final Assignment_type assignmentType, final IReferenceChain referenceChain) { - return getAssignmentType().equals(assignment_type); + return getAssignmentType().equals(assignmentType); } // TODO: remove when location is fixed @@ -164,15 +165,27 @@ public abstract class ASN1Assignment extends Assignment { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (ass_pard == null) { + if (assPard == null) { return; } - ass_pard.findReferences(referenceFinder, foundIdentifiers); + assPard.findReferences(referenceFinder, foundIdentifiers); } @Override public boolean shouldMarkOccurrences() { return markOccurrences; } + + @Override + protected boolean memberAccept(ASTVisitor v) { + if (identifier != null && !identifier.accept(v)) { + return false; + } + if (assPard != null && !assPard.accept(v)) { + return false; + } + + return true; + } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignments.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignments.java index 4c6ed684f1a16b24e3fc1441d9446ea26a2f4e96..06fca47a2eeb46a4d69d34f35c6be60545c6fa63 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignments.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ASN1Assignments.java @@ -64,9 +64,9 @@ public final class ASN1Assignments extends Assignments implements ILocateableNod * @param right_scope * the scope to be set. * */ - public void setRightScope(final Scope right_scope) { + public void setRightScope(final Scope rightScope) { for (ASN1Assignment assignment : assignments) { - assignment.setRightScope(right_scope); + assignment.setRightScope(rightScope); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/InformationFromObj.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/InformationFromObj.java index e064659af416fdbbab329f620f667eaac1cfbb4d..25a133f30e46fd50188d2911d8313492b7ac3ed6 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/InformationFromObj.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/InformationFromObj.java @@ -168,12 +168,12 @@ public final class InformationFromObj extends Reference { return new Error_Setting(); } - final int nof_fields = fieldName.getNofFields(); + final int nofFields = fieldName.getNofFields(); /* the middle part */ Identifier currentFieldName; FieldSpecification currentFieldSpecification; - for (int i = 0; i < nof_fields - 1; i++) { + for (int i = 0; i < nofFields - 1; i++) { currentFieldName = fieldName.getFieldByIndex(i); currentFieldSpecification = objectClass.getFieldSpecifications().getFieldSpecificationByIdentifier(currentFieldName) .getLast(); @@ -313,7 +313,7 @@ public final class InformationFromObj extends Reference { } /* and the last part... */ - currentFieldName = fieldName.getFieldByIndex(nof_fields - 1); + currentFieldName = fieldName.getFieldByIndex(nofFields - 1); currentFieldSpecification = objectClass.getFieldSpecifications().getFieldSpecificationByIdentifier(currentFieldName).getLast(); temporalSetting = null; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Builder.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Builder.java index a9291d6e40aec49a5307a512b9dc011fdaacf563..bd5b6f1c89dc55e5048d7454c46ccb4c0a710343 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Builder.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Builder.java @@ -10,6 +10,7 @@ package org.eclipse.titan.designer.AST.ASN1.Object; import java.util.ArrayList; import java.util.List; +import org.antlr.v4.runtime.CommonToken; import org.antlr.v4.runtime.Token; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; @@ -45,12 +46,12 @@ public final class ObjectClassSyntax_Builder extends ObjectClassSyntax_Visitor { token = aBlock.getTokenList().get(i); if (token.getType() == Asn1Lexer.LEFTVERSIONBRACKETS) { - org.antlr.v4.runtime.CommonToken token2 = ((TokenWithIndexAndSubTokens) token).copy(); + CommonToken token2 = ((TokenWithIndexAndSubTokens) token).copy(); token2.setType(Asn1Lexer.SQUAREOPEN); internalTokens.add(token2); internalTokens.add(token2); } else if (token.getType() == Asn1Lexer.RIGHTVERSIONBRACKETS) { - org.antlr.v4.runtime.CommonToken token2 = ((TokenWithIndexAndSubTokens) token).copy(); + CommonToken token2 = ((TokenWithIndexAndSubTokens) token).copy(); token2.setType(Asn1Lexer.SQUARECLOSE); internalTokens.add(token2); internalTokens.add(token2); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Node.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Node.java index 0af22f15eac00228ee5b2d052002c7b6ff0ceab7..efa2b28d46394881b256f695f682dec99f4af3f7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Node.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Node.java @@ -46,8 +46,8 @@ public abstract class ObjectClassSyntax_Node implements ILocateableNode { return isBuilded; } - public final void setIsBuilded(final boolean is_builded) { - this.isBuilded = is_builded; + public final void setIsBuilded(final boolean isBuilded) { + this.isBuilded = isBuilded; } public abstract String getDisplayName(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Parser.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Parser.java index 5eb1a83b72d99e08e2437061851525e779e237bf..8f7182290b75a6e30fe153a3cd779525e6219a83 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Parser.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/ObjectClassSyntax_Parser.java @@ -11,6 +11,7 @@ package org.eclipse.titan.designer.AST.ASN1.Object; import java.util.ArrayList; import java.util.List; +import org.antlr.v4.runtime.Token; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.titan.common.parsers.SyntacticErrorStorage; @@ -48,12 +49,12 @@ public final class ObjectClassSyntax_Parser extends ObjectClassSyntax_Visitor { public ObjectClassSyntax_Parser(final Block aBlock, final Object_Definition myObject) { this.myObject = myObject; - final List<org.antlr.v4.runtime.Token> tempTokens = aBlock.getTokenList(); - final List<org.antlr.v4.runtime.Token> temp = new ArrayList<org.antlr.v4.runtime.Token>(tempTokens.size()); + final List<Token> tempTokens = aBlock.getTokenList(); + final List<Token> temp = new ArrayList<Token>(tempTokens.size()); for (int i = 0; i < tempTokens.size(); i++) { temp.add(tempTokens.get(i)); } - temp.add(new TokenWithIndexAndSubTokens(org.antlr.v4.runtime.Token.EOF)); + temp.add(new TokenWithIndexAndSubTokens(Token.EOF)); this.mBlock = new Block(temp, aBlock.getLocation()); this.mBlock.setFullNameParent(aBlock); @@ -69,14 +70,14 @@ public final class ObjectClassSyntax_Parser extends ObjectClassSyntax_Visitor { final ASN1Type type = parseType(); if (null != type) { fieldSetting = new FieldSetting_Type(parameter.getIdentifier().newInstance(), type); - fieldSetting.setLocation(type.getLocation()); + fieldSetting.setLocation(mBlock.getLocation()); } break; case S_V: final boolean parseSuccess = parseValue(); if (parseSuccess) { fieldSetting = new FieldSetting_Value(parameter.getIdentifier().newInstance()); - fieldSetting.setLocation(parameter.getIdentifier().getLocation()); + fieldSetting.setLocation(mBlock.getLocation()); } break; case S_VS: @@ -86,14 +87,14 @@ public final class ObjectClassSyntax_Parser extends ObjectClassSyntax_Visitor { final ASN1Object object = parseObject(); if (null != object) { fieldSetting = new FieldSetting_Object(parameter.getIdentifier().newInstance(), object); - fieldSetting.setLocation(object.getLocation()); + fieldSetting.setLocation(mBlock.getLocation()); } break; case S_OS: final ObjectSet objectSet = parseObjectSet(); if (null != objectSet) { fieldSetting = new FieldSetting_ObjectSet(parameter.getIdentifier().newInstance(), objectSet); - fieldSetting.setLocation(objectSet.getLocation()); + fieldSetting.setLocation(mBlock.getLocation()); } break; case S_UNDEF: @@ -118,9 +119,9 @@ public final class ObjectClassSyntax_Parser extends ObjectClassSyntax_Visitor { previousSuccess = false; parameter.getSequence().accept(this); if (null != mBlock) { - if (success && internalIndex < mBlock.getTokenList().size() && mBlock.getTokenList().get(internalIndex).getType() != org.antlr.v4.runtime.Token.EOF) { + if (success && internalIndex < mBlock.getTokenList().size() && mBlock.getTokenList().get(internalIndex).getType() != Token.EOF) { success = false; - final org.antlr.v4.runtime.Token token = mBlock.getTokenList().get(internalIndex); + final Token token = mBlock.getTokenList().get(internalIndex); myObject.getLocation().reportSemanticError("Unexpected `" + token.getText() + "', it is a superfluous part"); } } @@ -141,7 +142,7 @@ public final class ObjectClassSyntax_Parser extends ObjectClassSyntax_Visitor { } if (null != mBlock) { - final org.antlr.v4.runtime.Token token = mBlock.getTokenList().get(internalIndex); + final Token token = mBlock.getTokenList().get(internalIndex); if (null == token.getText()) { // reached the end of the block return; @@ -167,7 +168,7 @@ public final class ObjectClassSyntax_Parser extends ObjectClassSyntax_Visitor { int i; if (null != mBlock) { - org.antlr.v4.runtime.Token token = mBlock.getTokenList().get(internalIndex); + Token token = mBlock.getTokenList().get(internalIndex); if (parameter.getOptionalFirstComma() && myObject.getNofFieldSettings() > 0) { if (token.getType() == Asn1Lexer.COMMA) { if (internalIndex < mBlock.getTokenList().size() - 1) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/Object_Definition.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/Object_Definition.java index 52e5a8812c797cc4379711b8f02b0d8ce309fabf..f62035adb80537634204b181e7db641110f59ff7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/Object_Definition.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object/Object_Definition.java @@ -124,7 +124,6 @@ public final class Object_Definition extends ASN1Object { } } - fieldSettings.clear(); fieldSettings.trimToSize(); if (null != myGovernor) { @@ -295,6 +294,8 @@ public final class Object_Definition extends ASN1Object { ObjectClassSyntax_Parser parser = null; parser = new ObjectClassSyntax_Parser(mBlock, this); final ObjectClassSyntax_root root = myGovernor.getObjectClassSyntax(timestamp); + fieldSettings.clear(); + if (null != root) { root.accept(parser); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectClass_Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectClass_Assignment.java index 33ca95e6a37894eb6b18fdee1875745e4395b84e..1ca37d22ff2f81233832abbafeb6766b59cad8fb 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectClass_Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectClass_Assignment.java @@ -33,8 +33,8 @@ public final class ObjectClass_Assignment extends ASN1Assignment { /** right. */ private final ObjectClass objectClass; - public ObjectClass_Assignment(final Identifier id, final Ass_pard ass_pard, final ObjectClass objectClass) { - super(id, ass_pard); + public ObjectClass_Assignment(final Identifier id, final Ass_pard assPard, final ObjectClass objectClass) { + super(id, assPard); this.objectClass = objectClass; if (null != objectClass) { @@ -53,9 +53,9 @@ public final class ObjectClass_Assignment extends ASN1Assignment { } @Override - public void setRightScope(final Scope right_scope) { + public void setRightScope(final Scope rightScope) { if (null != objectClass) { - objectClass.setMyScope(right_scope); + objectClass.setMyScope(rightScope); } } @@ -76,7 +76,7 @@ public final class ObjectClass_Assignment extends ASN1Assignment { * @return the ObjectClass of this ObjectClass assignment */ public ObjectClass getObjectClass(final CompilationTimeStamp timestamp) { - if (null != ass_pard) { + if (null != assPard) { location.reportSemanticError(MessageFormat.format(PARAMETERISEDOBJECTCLASS, getFullName())); return null; } @@ -99,8 +99,8 @@ public final class ObjectClass_Assignment extends ASN1Assignment { lastTimeChecked = timestamp; - if (null != ass_pard) { - ass_pard.check(timestamp); + if (null != assPard) { + assPard.check(timestamp); // lastTimeChecked = timestamp; return; } @@ -156,10 +156,7 @@ public final class ObjectClass_Assignment extends ASN1Assignment { @Override protected boolean memberAccept(ASTVisitor v) { - if (identifier != null && !identifier.accept(v)) { - return false; - } - if (ass_pard != null && !ass_pard.accept(v)) { + if (!super.memberAccept(v)) { return false; } if (objectClass != null && !objectClass.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectSet_Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectSet_Assignment.java index 9fbea2cd82f5e3b043b63369fab6ce6d1fd31b5c..3521d573a842da7cccf0c5fa22438cf387115936 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectSet_Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ObjectSet_Assignment.java @@ -35,8 +35,8 @@ public final class ObjectSet_Assignment extends ASN1Assignment { /** right. */ private final ObjectSet objectSet; - public ObjectSet_Assignment(final Identifier id, final Ass_pard ass_pard, final ObjectClass objectClass, final ObjectSet objectSet) { - super(id, ass_pard); + public ObjectSet_Assignment(final Identifier id, final Ass_pard assPard, final ObjectClass objectClass, final ObjectSet objectSet) { + super(id, assPard); this.objectClass = objectClass; this.objectSet = objectSet; @@ -59,9 +59,9 @@ public final class ObjectSet_Assignment extends ASN1Assignment { } @Override - public void setRightScope(final Scope right_scope) { + public void setRightScope(final Scope rightScope) { if (null != objectSet) { - objectSet.setMyScope(right_scope); + objectSet.setMyScope(rightScope); } } @@ -85,7 +85,7 @@ public final class ObjectSet_Assignment extends ASN1Assignment { * @return the object set of this object set assignment, * */ public ObjectSet getObjectSet(final CompilationTimeStamp timestamp) { - if (null != ass_pard) { + if (null != assPard) { location.reportSemanticError(MessageFormat.format(PARAMETERISEDOBJECTSET, getFullName())); return null; } @@ -108,8 +108,8 @@ public final class ObjectSet_Assignment extends ASN1Assignment { lastTimeChecked = timestamp; - if (null != ass_pard) { - ass_pard.check(timestamp); + if (null != assPard) { + assPard.check(timestamp); // lastTimeChecked = timestamp;; return; } @@ -172,10 +172,7 @@ public final class ObjectSet_Assignment extends ASN1Assignment { @Override protected boolean memberAccept(ASTVisitor v) { - if (identifier != null && !identifier.accept(v)) { - return false; - } - if (ass_pard != null && !ass_pard.accept(v)) { + if (!super.memberAccept(v)) { return false; } if (objectClass != null && !objectClass.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object_Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object_Assignment.java index be5ce16d906671ff8d79f9405b4e898677f1fbf1..a6bdba8c31d52dd69cb416d1b78a6c9b3a0a17d5 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object_Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Object_Assignment.java @@ -35,8 +35,8 @@ public final class Object_Assignment extends ASN1Assignment { private final ObjectClass objectClass; private final ASN1Object object; - public Object_Assignment(final Identifier id, final Ass_pard ass_pard, final ObjectClass objectClass, final ASN1Object object) { - super(id, ass_pard); + public Object_Assignment(final Identifier id, final Ass_pard assPard, final ObjectClass objectClass, final ASN1Object object) { + super(id, assPard); this.objectClass = objectClass; this.object = object; @@ -59,9 +59,9 @@ public final class Object_Assignment extends ASN1Assignment { } @Override - public void setRightScope(final Scope right_scope) { + public void setRightScope(final Scope rightScope) { if (null != object) { - object.setMyScope(right_scope); + object.setMyScope(rightScope); } } @@ -84,7 +84,7 @@ public final class Object_Assignment extends ASN1Assignment { * @return the object if this object assignment. * */ public ASN1Object getObject(final CompilationTimeStamp timestamp) { - if (null != ass_pard) { + if (null != assPard) { location.reportSemanticError(MessageFormat.format(PARAMETERISEDOBJECT, getFullName())); return null; } @@ -107,8 +107,8 @@ public final class Object_Assignment extends ASN1Assignment { lastTimeChecked = timestamp; - if (null != ass_pard) { - ass_pard.check(timestamp); + if (null != assPard) { + assPard.check(timestamp); // lastTimeChecked = timestamp; return; } @@ -170,10 +170,7 @@ public final class Object_Assignment extends ASN1Assignment { @Override protected boolean memberAccept(ASTVisitor v) { - if (identifier != null && !identifier.accept(v)) { - return false; - } - if (ass_pard != null && !ass_pard.accept(v)) { + if (!super.memberAccept(v)) { return false; } if (objectClass != null && !objectClass.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Type_Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Type_Assignment.java index 8b0e3bd647e2f0b848e7374b06295561fa675ba6..bcfd5efe770c3d78fd2632c6b85dfa858028799a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Type_Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Type_Assignment.java @@ -7,7 +7,6 @@ ******************************************************************************/ package org.eclipse.titan.designer.AST.ASN1; -import java.text.MessageFormat; import java.util.List; import org.eclipse.titan.designer.AST.ASTVisitor; @@ -38,8 +37,8 @@ public final class Type_Assignment extends ASN1Assignment { /** right. */ private final IASN1Type type; - public Type_Assignment(final Identifier id, final Ass_pard ass_pard, final IASN1Type type) { - super(id, ass_pard); + public Type_Assignment(final Identifier id, final Ass_pard assPard, final IASN1Type type) { + super(id, assPard); this.type = type; if (null != type) { @@ -58,9 +57,9 @@ public final class Type_Assignment extends ASN1Assignment { } @Override - public void setRightScope(final Scope right_scope) { + public void setRightScope(final Scope rightScope) { if (null != type) { - type.setMyScope(right_scope); + type.setMyScope(rightScope); } } @@ -74,7 +73,7 @@ public final class Type_Assignment extends ASN1Assignment { @Override public IASN1Type getType(final CompilationTimeStamp timestamp) { - if (null != ass_pard) { + if (null != assPard) { //FIXME: This is commented out because Mark Occurences gives a faulty error marker //It has more types... //location.reportSemanticError(MessageFormat.format(PARAMETERISEDTYPE, getFullName())); @@ -99,8 +98,8 @@ public final class Type_Assignment extends ASN1Assignment { lastTimeChecked = timestamp; - if (null != ass_pard) { - ass_pard.check(timestamp); + if (null != assPard) { + assPard.check(timestamp); return; } @@ -191,10 +190,7 @@ public final class Type_Assignment extends ASN1Assignment { @Override protected boolean memberAccept(ASTVisitor v) { - if (identifier != null && !identifier.accept(v)) { - return false; - } - if (ass_pard != null && !ass_pard.accept(v)) { + if (!super.memberAccept(v)) { return false; } if (type != null && !type.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment.java index c21ce167d2c11362442a7515f1627569fb0aeaad..d0e4f6417113fedaca11a3426676db86a6273b71 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment.java @@ -37,8 +37,8 @@ public abstract class Undefined_Assignment extends ASN1Assignment { /** the classified assignment. */ protected ASN1Assignment realAssignment; - public Undefined_Assignment(final Identifier id, final Ass_pard ass_pard) { - super(id, ass_pard); + public Undefined_Assignment(final Identifier id, final Ass_pard assPard) { + super(id, assPard); } @Override @@ -66,11 +66,11 @@ public abstract class Undefined_Assignment extends ASN1Assignment { } @Override - public final void setRightScope(final Scope right_scope) { + public final void setRightScope(final Scope rightScope) { if (null != realAssignment) { - realAssignment.setRightScope(right_scope); + realAssignment.setRightScope(rightScope); } - this.rightScope = right_scope; + this.rightScope = rightScope; } @Override @@ -122,8 +122,8 @@ public abstract class Undefined_Assignment extends ASN1Assignment { lastTimeChecked = timestamp; - if (null != ass_pard) { - ass_pard.check(timestamp); + if (null != assPard) { + assPard.check(timestamp); return; } @@ -134,7 +134,7 @@ public abstract class Undefined_Assignment extends ASN1Assignment { } @Override - public final boolean isAssignmentType(final CompilationTimeStamp timestamp, final Assignment_type assignment_type, + public final boolean isAssignmentType(final CompilationTimeStamp timestamp, final Assignment_type assignmentType, final IReferenceChain referenceChain) { check(timestamp); @@ -142,7 +142,7 @@ public abstract class Undefined_Assignment extends ASN1Assignment { return false; } - return getIsErroneous() ? false : realAssignment.isAssignmentType(timestamp, assignment_type, referenceChain); + return getIsErroneous() ? false : realAssignment.isAssignmentType(timestamp, assignmentType, referenceChain); } /** @@ -207,10 +207,7 @@ public abstract class Undefined_Assignment extends ASN1Assignment { @Override protected boolean memberAccept(ASTVisitor v) { - if (identifier != null && !identifier.accept(v)) { - return false; - } - if (ass_pard != null && !ass_pard.accept(v)) { + if (!super.memberAccept(v)) { return false; } if (realAssignment != null && !realAssignment.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_OS_or_VS.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_OS_or_VS.java index 7f3f33db2de2df7362f1f3e18a0d1e1b5da4a4d7..99dd91c8e12729154c7843aa52647853977417b4 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_OS_or_VS.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_OS_or_VS.java @@ -7,6 +7,7 @@ ******************************************************************************/ package org.eclipse.titan.designer.AST.ASN1; +import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.IReferenceChain; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Reference; @@ -31,8 +32,8 @@ public final class Undefined_Assignment_OS_or_VS extends Undefined_Assignment { protected final Reference reference; private final Block mBlock; - public Undefined_Assignment_OS_or_VS(final Identifier id, final Ass_pard ass_pard, final Reference reference, final Block aBlock) { - super(id, ass_pard); + public Undefined_Assignment_OS_or_VS(final Identifier id, final Ass_pard assPard, final Reference reference, final Block aBlock) { + super(id, assPard); this.reference = reference; this.mBlock = aBlock; @@ -58,9 +59,9 @@ public final class Undefined_Assignment_OS_or_VS extends Undefined_Assignment { @Override protected void classifyAssignment(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) { - final boolean new_chain = null == referenceChain; + final boolean newChain = null == referenceChain; IReferenceChain temporalReferenceChain; - if (new_chain) { + if (newChain) { temporalReferenceChain = ReferenceChain.getInstance(CIRCULARASSIGNMENTCHAIN, true); } else { temporalReferenceChain = referenceChain; @@ -75,9 +76,9 @@ public final class Undefined_Assignment_OS_or_VS extends Undefined_Assignment { if (!reference.refersToSettingType(timestamp, Setting_type.S_ERROR, temporalReferenceChain)) { if (identifier.isvalidAsnObjectSetReference() && reference.refersToSettingType(timestamp, Setting_type.S_OC, temporalReferenceChain)) { - realAssignment = new ObjectSet_Assignment(identifier, ass_pard, new ObjectClass_refd(reference), + realAssignment = new ObjectSet_Assignment(identifier, assPard, new ObjectClass_refd(reference), newObjectSetDefinitionInstance()); - // ass_pard = null; + // assPard = null; // left = null; // right = null; // asstype = A_OS; @@ -104,7 +105,7 @@ public final class Undefined_Assignment_OS_or_VS extends Undefined_Assignment { realAssignment.setFullNameParent(this); } - if (new_chain) { + if (newChain) { temporalReferenceChain.release(); } else { temporalReferenceChain.previousState(); @@ -116,6 +117,17 @@ public final class Undefined_Assignment_OS_or_VS extends Undefined_Assignment { } private ValueSet_Assignment newValueSetAssignmentInstance( final Referenced_Type aType ) { - return new ValueSet_Assignment(identifier, ass_pard, aType, mBlock); + return new ValueSet_Assignment(identifier, assPard, aType, mBlock); + } + + @Override + protected boolean memberAccept(ASTVisitor v) { + if (!super.memberAccept(v)) { + return false; + } + if (reference != null && !reference.accept(v)) { + return false; + } + return true; } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_O_or_V.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_O_or_V.java index 3b2f20d903d57caf4237546a4b15f1c570066c0c..a6eb3897f9ee132166df22ea1629987f119f0f07 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_O_or_V.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_O_or_V.java @@ -7,6 +7,7 @@ ******************************************************************************/ package org.eclipse.titan.designer.AST.ASN1; +import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.IReferenceChain; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Reference; @@ -35,8 +36,8 @@ public final class Undefined_Assignment_O_or_V extends Undefined_Assignment { private final Block mBlock; private final Reference objectReference; - public Undefined_Assignment_O_or_V(final Identifier id, final Ass_pard ass_pard, final Reference reference, final Block aBlock) { - super(id, ass_pard); + public Undefined_Assignment_O_or_V(final Identifier id, final Ass_pard assPard, final Reference reference, final Block aBlock) { + super(id, assPard); this.reference = reference; this.mBlock = aBlock; objectReference = null; @@ -49,8 +50,8 @@ public final class Undefined_Assignment_O_or_V extends Undefined_Assignment { } } - public Undefined_Assignment_O_or_V(final Identifier id, final Ass_pard ass_pard, final Reference reference, final Reference reference2) { - super(id, ass_pard); + public Undefined_Assignment_O_or_V(final Identifier id, final Ass_pard assPard, final Reference reference, final Reference reference2) { + super(id, assPard); this.reference = reference; mBlock = null; objectReference = reference2; @@ -76,9 +77,9 @@ public final class Undefined_Assignment_O_or_V extends Undefined_Assignment { @Override protected void classifyAssignment(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) { - final boolean new_chain = null == referenceChain; + final boolean newChain = null == referenceChain; IReferenceChain temporalReferenceChain; - if (new_chain) { + if (newChain) { temporalReferenceChain = ReferenceChain.getInstance(CIRCULARASSIGNMENTCHAIN, true); } else { temporalReferenceChain = referenceChain; @@ -101,11 +102,11 @@ public final class Undefined_Assignment_O_or_V extends Undefined_Assignment { if (null != mBlock) { final Object_Definition obj = new Object_Definition(mBlock); // obj.setLocation(right1); - realAssignment = new Object_Assignment(identifier, ass_pard, oc, obj); + realAssignment = new Object_Assignment(identifier, assPard, oc, obj); } else if (null != objectReference) { final ReferencedObject obj = new ReferencedObject(objectReference); obj.setLocation(objectReference.getLocation()); - realAssignment = new Object_Assignment(identifier, ass_pard, oc, obj); + realAssignment = new Object_Assignment(identifier, assPard, oc, obj); } } else if (identifier.isvalidAsnValueReference() && (reference.refersToSettingType(timestamp, Setting_type.S_T, temporalReferenceChain) || reference @@ -114,11 +115,11 @@ public final class Undefined_Assignment_O_or_V extends Undefined_Assignment { if (null != mBlock) { final Value value = new Undefined_Block_Value(mBlock); value.setLocation(mBlock.getLocation()); - realAssignment = new Value_Assignment(identifier, ass_pard, type, value); + realAssignment = new Value_Assignment(identifier, assPard, type, value); } else if (null != objectReference) { final Value value = new Undefined_LowerIdentifier_Value(objectReference.getId().newInstance()); value.setLocation(objectReference.getLocation()); - realAssignment = new Value_Assignment(identifier, ass_pard, type, value); + realAssignment = new Value_Assignment(identifier, assPard, type, value); } } } @@ -133,7 +134,7 @@ public final class Undefined_Assignment_O_or_V extends Undefined_Assignment { realAssignment.setFullNameParent(this); } - if (new_chain) { + if (newChain) { temporalReferenceChain.release(); } else { temporalReferenceChain.previousState(); @@ -148,4 +149,18 @@ public final class Undefined_Assignment_O_or_V extends Undefined_Assignment { return new Undefined_Assignment_O_or_V(identifier, null, reference.newInstance(), objectReference.newInstance()); } + + @Override + protected boolean memberAccept(ASTVisitor v) { + if (!super.memberAccept(v)) { + return false; + } + if (reference != null && !reference.accept(v)) { + return false; + } + if (objectReference != null && !objectReference.accept(v)) { + return false; + } + return true; + } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_T_or_OC.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_T_or_OC.java index b34a2764321aae679e3f95376b56e8ad693ea266..f14ef8e124e08e849ea4e430dacc6904097d37d1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_T_or_OC.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Undefined_Assignment_T_or_OC.java @@ -7,6 +7,7 @@ ******************************************************************************/ package org.eclipse.titan.designer.AST.ASN1; +import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.IReferenceChain; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Reference; @@ -62,8 +63,8 @@ public final class Undefined_Assignment_T_or_OC extends Undefined_Assignment { reference.setMyScope(rightScope); if (identifier.isvalidAsnObjectClassReference() && reference.refersToSettingType(timestamp, Setting_type.S_OC, temporalReferenceChain)) { - realAssignment = new ObjectClass_Assignment(identifier, ass_pard, new ObjectClass_refd(reference)); - // ass_pard = null; + realAssignment = new ObjectClass_Assignment(identifier, assPard, new ObjectClass_refd(reference)); + // assPard = null; // asstype = Assignment.A_OC; } else if (identifier.isvalidAsnTyperef() && (reference.refersToSettingType(timestamp, Setting_type.S_T, temporalReferenceChain) || reference @@ -71,8 +72,8 @@ public final class Undefined_Assignment_T_or_OC extends Undefined_Assignment { final Referenced_Type type = new Referenced_Type(reference); type.setLocation(reference.getLocation()); - realAssignment = new Type_Assignment(identifier, ass_pard, type); - // ass_pard = null; + realAssignment = new Type_Assignment(identifier, assPard, type); + // assPard = null; // asstype = A_TYPE; } } @@ -97,4 +98,15 @@ public final class Undefined_Assignment_T_or_OC extends Undefined_Assignment { protected ASN1Assignment internalNewInstance(final Identifier identifier) { return new Undefined_Assignment_T_or_OC(identifier, null, reference.newInstance()); } + + @Override + protected boolean memberAccept(ASTVisitor v) { + if (!super.memberAccept(v)) { + return false; + } + if (reference != null && !reference.accept(v)) { + return false; + } + return true; + } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ValueSet_Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ValueSet_Assignment.java index 40219411b6d55f3d2b5af890c448bcfc879564cf..36c9ef3ad563e98b164c90b189dccb80517c0fe2 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ValueSet_Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/ValueSet_Assignment.java @@ -33,8 +33,8 @@ public final class ValueSet_Assignment extends ASN1Assignment { /** right */ private final Block mBlock; - public ValueSet_Assignment(final Identifier id, final Ass_pard ass_pard, final IASN1Type type, final Block aBlock) { - super(id, ass_pard); + public ValueSet_Assignment(final Identifier id, final Ass_pard assPard, final IASN1Type type, final Block aBlock) { + super(id, assPard); this.type = type; this.mBlock = aBlock; @@ -58,7 +58,7 @@ public final class ValueSet_Assignment extends ASN1Assignment { } @Override - public void setRightScope(final Scope right_scope) { + public void setRightScope(final Scope rightScope) { } @@ -117,10 +117,7 @@ public final class ValueSet_Assignment extends ASN1Assignment { @Override protected boolean memberAccept(ASTVisitor v) { - if (identifier != null && !identifier.accept(v)) { - return false; - } - if (ass_pard != null && !ass_pard.accept(v)) { + if (!super.memberAccept(v)) { return false; } if (type != null && !type.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Value_Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Value_Assignment.java index e4a1cd351070947b1616f4a303c992f72d32aa9e..02a4ea6d293f3b14dd9c59dfa201964cd5843433 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Value_Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/Value_Assignment.java @@ -44,8 +44,8 @@ public final class Value_Assignment extends ASN1Assignment { /** right. */ private final Value value; - public Value_Assignment(final Identifier id, final Ass_pard ass_pard, final IASN1Type type, final Value value) { - super(id, ass_pard); + public Value_Assignment(final Identifier id, final Ass_pard assPard, final IASN1Type type, final Value value) { + super(id, assPard); this.type = type; this.value = value; @@ -82,9 +82,9 @@ public final class Value_Assignment extends ASN1Assignment { } @Override - public void setRightScope(final Scope right_scope) { + public void setRightScope(final Scope rightScope) { if (null != value) { - value.setMyScope(right_scope); + value.setMyScope(rightScope); } } @@ -107,7 +107,7 @@ public final class Value_Assignment extends ASN1Assignment { } public IValue getValue() { - if (null != ass_pard) { + if (null != assPard) { location.reportSemanticError(MessageFormat.format("`{0}'' is a parameterized value assignment", getFullName())); return null; } @@ -127,8 +127,8 @@ public final class Value_Assignment extends ASN1Assignment { lastTimeChecked = timestamp; - if (null != ass_pard) { - ass_pard.check(timestamp); + if (null != assPard) { + assPard.check(timestamp); return; } @@ -144,12 +144,12 @@ public final class Value_Assignment extends ASN1Assignment { } value.setMyGovernor(type); - final IValue temp_value = type.checkThisValueRef(timestamp, value); - type.checkThisValue(timestamp, temp_value, new ValueCheckingOptions(Expected_Value_type.EXPECTED_CONSTANT, false, false, true, true, + final IValue tempValue = type.checkThisValueRef(timestamp, value); + type.checkThisValue(timestamp, tempValue, new ValueCheckingOptions(Expected_Value_type.EXPECTED_CONSTANT, false, false, true, true, false)); final IReferenceChain chain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true); - temp_value.checkRecursions(timestamp, chain); + tempValue.checkRecursions(timestamp, chain); chain.release(); } @@ -173,8 +173,8 @@ public final class Value_Assignment extends ASN1Assignment { } if (subrefs.size() == i + 1 && identifier.getName().toLowerCase().startsWith(subrefs.get(i).getId().getName().toLowerCase())) { - final String proposal_kind = UNKNOWNASSIGNMENT; - propCollector.addProposal(identifier, " - " + proposal_kind, ImageCache.getImage(getOutlineIcon()), proposal_kind); + final String proposalKind = UNKNOWNASSIGNMENT; + propCollector.addProposal(identifier, " - " + proposalKind, ImageCache.getImage(getOutlineIcon()), proposalKind); } else if (subrefs.size() > i + 1 && null != type && identifier.getName().equals(subrefs.get(i).getId().getName())) { // perfect match type.addProposal(propCollector, i + 1); @@ -214,10 +214,7 @@ public final class Value_Assignment extends ASN1Assignment { @Override protected boolean memberAccept(ASTVisitor v) { - if (identifier != null && !identifier.accept(v)) { - return false; - } - if (ass_pard != null && !ass_pard.accept(v)) { + if (!super.memberAccept(v)) { return false; } if (type != null && !type.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ASN1Module.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ASN1Module.java index 27c0e2fb9fdd6073ea11b91630c6ca770ac4a2fb..49ad74376a0a13040fd3a313e6df595cef3b25c4 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ASN1Module.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ASN1Module.java @@ -54,7 +54,7 @@ public final class ASN1Module extends Module { /** default tagging. */ private final Tag_types tagdef; - private final boolean extensibility_implied; + private final boolean extensibilityImplied; /** exported stuff. */ private Exports exports; /** imported stuff. */ @@ -62,10 +62,10 @@ public final class ASN1Module extends Module { private ASN1Assignments assignments; - public ASN1Module(final Identifier identifier, final IProject project, final Tag_types tagdef, final boolean extensibility_implied) { + public ASN1Module(final Identifier identifier, final IProject project, final Tag_types tagdef, final boolean extensibilityImplied) { super(identifier, project); this.tagdef = tagdef; - this.extensibility_implied = extensibility_implied; + this.extensibilityImplied = extensibilityImplied; exports = new Exports(false); exports.setMyModule(this); exports.setFullNameParent(this); @@ -293,16 +293,16 @@ public final class ASN1Module extends Module { module = parser.getModuleByName(moduleId.getName()); } - final List<ISubReference> new_subreferences = new ArrayList<ISubReference>(); - new_subreferences.add(new FieldSubReference(id)); - final Defined_Reference final_reference = new Defined_Reference(null, new_subreferences); + final List<ISubReference> newSubreferences = new ArrayList<ISubReference>(); + newSubreferences.add(new FieldSubReference(id)); + final Defined_Reference finalSeference = new Defined_Reference(null, newSubreferences); if (this == module || null == module) { return null; } // FIXME add semantic check guard on project level. - return module.getAssBySRef(timestamp, final_reference); + return module.getAssBySRef(timestamp, finalSeference); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Exports.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Exports.java index 4026ae0efa27f13150f0f851db0e66c08632f1d8..290a8714010990504a9e1a71f977ebdd330a85ff 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Exports.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Exports.java @@ -35,7 +35,7 @@ public final class Exports extends ASTNode implements ILocateableNode { * exports all (true if the module of this export list exports all of * its assignments). */ - private final boolean export_all; + private final boolean exportAll; /** * The location of the whole export list. This location encloses the @@ -49,9 +49,9 @@ public final class Exports extends ASTNode implements ILocateableNode { */ private CompilationTimeStamp lastCompilationTimeStamp; - public Exports(final boolean export_all) { - this.export_all = export_all; - if (export_all) { + public Exports(final boolean exportAll) { + this.exportAll = exportAll; + if (exportAll) { symbols = null; } else { symbols = new Symbols(); @@ -59,7 +59,7 @@ public final class Exports extends ASTNode implements ILocateableNode { } public Exports(final Symbols symbols) { - export_all = false; + exportAll = false; this.symbols = symbols; } @@ -86,7 +86,7 @@ public final class Exports extends ASTNode implements ILocateableNode { public boolean exportsSymbol(final CompilationTimeStamp timestamp, final Identifier id) { check(timestamp); - if (export_all) { + if (exportAll) { return true; } @@ -105,7 +105,7 @@ public final class Exports extends ASTNode implements ILocateableNode { return; } - if (export_all) { + if (exportAll) { lastCompilationTimeStamp = timestamp; return; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ImportModule.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ImportModule.java index 82e99e18c1a9d256800494c2fd66a8a77e83c07f..5b5fe85cda1055bca3e611494944c7796ecf5b8f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ImportModule.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/ImportModule.java @@ -196,12 +196,12 @@ public final class ImportModule extends ModuleImportation { propCollector.addProposal(identifier, ImageCache.getImage(getOutlineIcon()), KIND); } - final Module savedReferedModule = referredModule; - if (savedReferedModule != null) { - Assignments assignments = savedReferedModule.getAssignments(); + final Module savedReferredModule = referredModule; + if (savedReferredModule != null) { + Assignments assignments = savedReferredModule.getAssignments(); for (int i = 0, size = assignments.getNofAssignments(); i < size; i++) { Assignment temporalAssignment = assignments.getAssignmentByIndex(i); - if (savedReferedModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { + if (savedReferredModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { temporalAssignment.addProposal(propCollector, 0); } } @@ -220,19 +220,19 @@ public final class ImportModule extends ModuleImportation { * */ @Override public void addDeclaration(final DeclarationCollector declarationCollector, final Identifier targetModuleId) { - final Module savedReferedModule = referredModule; - if (savedReferedModule != null) { - Assignments assignments = savedReferedModule.getAssignments(); + final Module savedReferredModule = referredModule; + if (savedReferredModule != null) { + Assignments assignments = savedReferredModule.getAssignments(); for (int i = 0; i < assignments.getNofAssignments(); i++) { Assignment temporalAssignment = assignments.getAssignmentByIndex(i); - if (savedReferedModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { + if (savedReferredModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { temporalAssignment.addDeclaration(declarationCollector, 0); } } Identifier moduleId = declarationCollector.getReference().getModuleIdentifier(); List<ISubReference> subrefs = declarationCollector.getReference().getSubreferences(); if (moduleId == null && subrefs.size() == 1 && identifier.getName().equals(subrefs.get(0).getId().getName())) { - declarationCollector.addDeclaration(savedReferedModule.getIdentifier().getDisplayName(), savedReferedModule + declarationCollector.addDeclaration(savedReferredModule.getIdentifier().getDisplayName(), savedReferredModule .getIdentifier().getLocation(), (Scope) null); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Imports.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Imports.java index da951726b08f7ac398dfa26c91dd359ef6fe0182..6ff18d5211043961c40ba6ab943aed15a4ec3eb2 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Imports.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/Imports.java @@ -26,7 +26,6 @@ import org.eclipse.titan.designer.AST.Module; import org.eclipse.titan.designer.AST.ModuleImportationChain; import org.eclipse.titan.designer.AST.NULL_Location; import org.eclipse.titan.designer.AST.Reference; -import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module; import org.eclipse.titan.designer.core.LoadBalancingUtilities; import org.eclipse.titan.designer.editors.DeclarationCollector; import org.eclipse.titan.designer.editors.ProposalCollector; @@ -41,6 +40,8 @@ import org.eclipse.titan.designer.parsers.ProjectStructureDataCollector; * @author Kristof Szabados */ public final class Imports extends ASTNode implements IOutlineElement, ILocateableNode { + private static final String DUPLICATEIMPORTFIRST = "Duplicate import from module `{0}'' was first declared here"; + private static final String DUPLICATEIMPORTREPEATED = "Duplicate import from module `{0}'' was declared here again"; private static final String TTCN3IMPORT = "An ASN.1 module cannot import from a TTCN-3 module"; private static final String SELFIMPORT = "A module cannot import from itself"; @@ -77,7 +78,7 @@ public final class Imports extends ASTNode implements IOutlineElement, ILocateab if (null != importedModule && null != importedModule.getIdentifier() && null != importedModule.getIdentifier().getName()) { importedModule.setProject(project); importedModules_v.add(importedModule); - } + } } /** @@ -192,18 +193,13 @@ public final class Imports extends ASTNode implements IOutlineElement, ILocateab continue; } - // check the imports recursively - referenceChain.markState(); - importModule.checkImports(timestamp, referenceChain, moduleStack); - referenceChain.previousState(); - String name = identifier.getName(); if (importedModules_map.containsKey(name)) { final Location importedLocation = importedModules_map.get(name).getIdentifier().getLocation(); - importedLocation.reportSingularSemanticError(MessageFormat.format(TTCN3Module.DUPLICATEIMPORTFIRST, + importedLocation.reportSingularSemanticError(MessageFormat.format(DUPLICATEIMPORTFIRST, identifier.getDisplayName())); identifier.getLocation().reportSemanticError( - MessageFormat.format(TTCN3Module.DUPLICATEIMPORTREPEATED, identifier.getDisplayName())); + MessageFormat.format(DUPLICATEIMPORTREPEATED, identifier.getDisplayName())); } else { importedModules_map.put(name, importModule); } @@ -227,6 +223,14 @@ public final class Imports extends ASTNode implements IOutlineElement, ILocateab importModule.setUnhandledChange(false); LoadBalancingUtilities.astNodeChecked(); } + + for (ImportModule importModule : importedModules_v) { + // check the imports recursively + referenceChain.markState(); + importModule.checkImports(timestamp, referenceChain, moduleStack); + referenceChain.previousState(); + + } } /** diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/SpecialASN1Module.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/SpecialASN1Module.java index 3db25595de9ecc4a7af83624cb209f0dd3898e97..8fb90eb1a62e77c4ac2d1e7915374021c89c6182 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/SpecialASN1Module.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/definitions/SpecialASN1Module.java @@ -210,16 +210,16 @@ public final class SpecialASN1Module { * Parses the special internal assignments to build their semantic * representation. * - * @param input_code + * @param inputCode * the code to parse. * @param identifier * the identifier for the assignment to be created. * * @return the parsed assignment. */ - public static ASN1Assignment parseSpecialInternalAssignment(final String input_code, final Identifier identifier) { + public static ASN1Assignment parseSpecialInternalAssignment(final String inputCode, final Identifier identifier) { ASN1Assignment assignment = null; - StringReader reader = new StringReader(input_code); + StringReader reader = new StringReader(inputCode); CharStream charStream = new UnbufferedCharStream(reader); Asn1Lexer lexer = new Asn1Lexer(charStream); lexer.setTokenFactory(new TokenWithIndexAndSubTokensFactory(true)); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ASN1_Sequence_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ASN1_Sequence_Type.java index d2298382e23698eb99c406863f3452a7ba1ce973..212d6f7dc45a30c5c4af936194903b428105779f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ASN1_Sequence_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ASN1_Sequence_Type.java @@ -800,18 +800,18 @@ public final class ASN1_Sequence_Type extends ASN1_Set_Seq_Choice_BaseType { /** Parses the block as if it were the block of a sequence. */ private void parseBlockSequence() { - Asn1Parser parserV4 = null; + Asn1Parser parser = null; if (null != mBlock) { - parserV4 = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock); + parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock); } - if (null == parserV4) { + if (null == parser) { return; } components = null; if (null != mBlock) { - components = parserV4.pr_special_ComponentTypeLists().list; - List<SyntacticErrorStorage> errors = parserV4.getErrorStorage(); + components = parser.pr_special_ComponentTypeLists().list; + List<SyntacticErrorStorage> errors = parser.getErrorStorage(); if (null != errors && !errors.isEmpty()) { //isErroneous = true; components = null; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ComponentsOfComponentType.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ComponentsOfComponentType.java index d2f8604e6ac3ff9633f1baeb52b351907a78c26b..4bacd5d568af181e2b903bf2eff3b2b147f94376 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ComponentsOfComponentType.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/ComponentsOfComponentType.java @@ -173,7 +173,9 @@ public final class ComponentsOfComponentType extends ComponentType { for (int i = 0; i < tempCtss.getNofRootComps(); i++) { CompField compfield = tempCtss.getRootCompByIndex(i).newInstance(); compfield.setLocation(location); - componentTypes.addComponentType(new RegularComponentType(compfield)); + RegularComponentType componentType = new RegularComponentType(compfield); + componentType.setLocation(location); + componentTypes.addComponentType(componentType); } componentTypes.setMyScope(componentsOfType.getMyScope()); componentTypes.setFullNameParent(this); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/PrintableString_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/PrintableString_Type.java index 34686d5f76b7c22ff2d8e74dfb0c020e56f9eee1..b074485ffb4e5872ba908e3745bd8ef1ec4f5c8f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/PrintableString_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/PrintableString_Type.java @@ -134,15 +134,15 @@ public final class PrintableString_Type extends ASN1Type { } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); - CharString_Type.checkThisTemplateString(timestamp, this, template, is_modified); + CharString_Type.checkThisTemplateString(timestamp, this, template, isModified); } @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { final List<ISubReference> subreferences = reference.getSubreferences(); if (subreferences.size() <= actualSubReference) { return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RegularComponentType.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RegularComponentType.java index e14aaa34e94c341931fcf08c4aae2ba778d3594b..bab7b3c98511aca9c239c5870761ebc19eabcc43 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RegularComponentType.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RegularComponentType.java @@ -77,7 +77,7 @@ public final class RegularComponentType extends ComponentType { } @Override - public void trCompsof(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain, final boolean is_set) { + public void trCompsof(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain, final boolean isSet) { } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RelativeObjectIdentifier_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RelativeObjectIdentifier_Type.java index 62ab2cc8d969590395acf0d53934f36bff85ca60..37fa3dd2546e8d476141ac4b0e0e56de0eae553a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RelativeObjectIdentifier_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/RelativeObjectIdentifier_Type.java @@ -139,7 +139,7 @@ public final class RelativeObjectIdentifier_Type extends ASN1Type { @Override public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, - final boolean implicit_omit) { + final boolean implicitOmit) { registerUsage(template); template.setMyGovernor(this); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/Selection_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/Selection_Type.java index 899a66e453474e2c03540dbc2c19787a05fc62db..a013cf3f7fd93d0852c7873721d5fa902fbb9978 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/Selection_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/Selection_Type.java @@ -174,8 +174,8 @@ public final class Selection_Type extends ASN1Type implements IReferencingType { } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); if (getIsErroneous(timestamp)) { @@ -184,7 +184,7 @@ public final class Selection_Type extends ASN1Type implements IReferencingType { final IType tempType = getTypeRefdLast(timestamp); if (tempType != this) { - tempType.checkThisTemplate(timestamp, template, is_modified, implicit_omit); + tempType.checkThisTemplate(timestamp, template, isModified, implicitOmit); } } @@ -251,18 +251,18 @@ public final class Selection_Type extends ASN1Type implements IReferencingType { @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { if (null == lastTimeChecked) { check(CompilationTimeStamp.getBaseTimestamp()); } if (null != referencedLast && this != referencedLast) { final Expected_Value_type internalExpectation = - (expected_index == Expected_Value_type.EXPECTED_TEMPLATE) ? Expected_Value_type.EXPECTED_DYNAMIC_VALUE - : expected_index; + (expectedIndex == Expected_Value_type.EXPECTED_TEMPLATE) ? Expected_Value_type.EXPECTED_DYNAMIC_VALUE + : expectedIndex; return referencedLast.getFieldType(timestamp, reference, actualSubReference, internalExpectation, refChain, - interrupt_if_optional); + interruptIfOptional); } return null; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/TeletexString_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/TeletexString_Type.java index 08f7a36e89c6df9739e23a0037182e9151213e94..bb92100fe735276587e869b29c36196171e722a6 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/TeletexString_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/TeletexString_Type.java @@ -146,15 +146,15 @@ public final class TeletexString_Type extends ASN1Type { } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); - CharString_Type.checkThisTemplateString(timestamp, this, template, is_modified); + CharString_Type.checkThisTemplateString(timestamp, this, template, isModified); } @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { final List<ISubReference> subreferences = reference.getSubreferences(); if (subreferences.size() <= actualSubReference) { return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTCTime_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTCTime_Type.java index 92f8d567fb9c0511a3b4e618d6bc96a88cafacbd..90057c38cf39f8b911f1a26b90696f2569299bc6 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTCTime_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTCTime_Type.java @@ -138,15 +138,15 @@ public final class UTCTime_Type extends ASN1Type { } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); - CharString_Type.checkThisTemplateString(timestamp, this, template, is_modified); + CharString_Type.checkThisTemplateString(timestamp, this, template, isModified); } @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { final List<ISubReference> subreferences = reference.getSubreferences(); if (subreferences.size() <= actualSubReference) { return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTF8String_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTF8String_Type.java index 4dc5e92bcddf3d66c2428540fd6aeb242c77dff9..863dfc2daa39d27a5ec386f92f705eeb946ce797 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTF8String_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UTF8String_Type.java @@ -148,15 +148,15 @@ public final class UTF8String_Type extends ASN1Type { } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); - UniversalCharstring_Type.checkThisTemplateString(timestamp, this, template, is_modified); + UniversalCharstring_Type.checkThisTemplateString(timestamp, this, template, isModified); } @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { final List<ISubReference> subreferences = reference.getSubreferences(); if (subreferences.size() <= actualSubReference) { return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UnrestrictedString_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UnrestrictedString_Type.java index cc473cc3dccc6118b1d2cc5a2ac4937023f1a266..ed1a3331b9f67c26a8cdef7a8791841ddc59322a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UnrestrictedString_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/UnrestrictedString_Type.java @@ -108,8 +108,8 @@ public final class UnrestrictedString_Type extends ASN1Type implements IReferenc } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); template.setMyGovernor(this); @@ -122,7 +122,7 @@ public final class UnrestrictedString_Type extends ASN1Type implements IReferenc @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { final List<ISubReference> subreferences = reference.getSubreferences(); if (subreferences.size() <= actualSubReference) { return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VideotexString_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VideotexString_Type.java index dd313871a67d5c1c78d24b1d41e57616a59e335e..9321de0a99c5780050baac7a06d4c9775f73aea0 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VideotexString_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VideotexString_Type.java @@ -146,15 +146,15 @@ public final class VideotexString_Type extends ASN1Type { } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); - CharString_Type.checkThisTemplateString(timestamp, this, template, is_modified); + CharString_Type.checkThisTemplateString(timestamp, this, template, isModified); } @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { final List<ISubReference> subreferences = reference.getSubreferences(); if (subreferences.size() <= actualSubReference) { return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VisibleString_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VisibleString_Type.java index e6f87039a4f81df8732f09c5780e26a0a2616503..56a73a9f6b92458e9bde52f4d79bd42d455b86db 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VisibleString_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/types/VisibleString_Type.java @@ -138,15 +138,15 @@ public final class VisibleString_Type extends ASN1Type { } @Override - public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean is_modified, - final boolean implicit_omit) { + public void checkThisTemplate(final CompilationTimeStamp timestamp, final ITTCN3Template template, final boolean isModified, + final boolean implicitOmit) { registerUsage(template); - CharString_Type.checkThisTemplateString(timestamp, this, template, is_modified); + CharString_Type.checkThisTemplateString(timestamp, this, template, isModified); } @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final IReferenceChain refChain, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final IReferenceChain refChain, final boolean interruptIfOptional) { final List<ISubReference> subreferences = reference.getSubreferences(); if (subreferences.size() <= actualSubReference) { return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ASN1_Null_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ASN1_Null_Value.java index c9036359aadfbd038cbdc924590f7bb93975dbe0..2e1913f75dd7be5256d6e3db150da6201ce86e38 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ASN1_Null_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ASN1_Null_Value.java @@ -38,7 +38,7 @@ public final class ASN1_Null_Value extends Value { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { return Type_type.TYPE_NULL; } @@ -78,7 +78,7 @@ public final class ASN1_Null_Value extends Value { } @Override - public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { return true; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Charsymbols_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Charsymbols_Value.java index 2018d58906107f1885c1d7feefdab4b223ff32b6..96abc74ef7c9574e1501ad4d5a9609477c4b7931 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Charsymbols_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Charsymbols_Value.java @@ -44,7 +44,7 @@ public final class Charsymbols_Value extends Value { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { return null; } @@ -79,7 +79,7 @@ public final class Charsymbols_Value extends Value { } @Override - public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ISO2022String_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ISO2022String_Value.java index 9a1d7a969d8ff97d59c474e04f0d7c7a2e4f3b5e..6bfb385d0f0085c5b66ee0aa8cfcb2eacb7d784c 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ISO2022String_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/ISO2022String_Value.java @@ -54,7 +54,7 @@ public final class ISO2022String_Value extends Value { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { return Type_type.TYPE_GENERALSTRING; } @@ -79,15 +79,15 @@ public final class ISO2022String_Value extends Value { final ISubReference subreference = subreferences.get(actualSubReference); switch (subreference.getReferenceType()) { case arraySubReference: - final Value array_index = ((ArraySubReference) subreference).getValue(); - final IValue value_index = array_index.getValueRefdLast(timestamp, refChain); - if (!value_index.isUnfoldable(timestamp)) { - if (Value_type.INTEGER_VALUE.equals(value_index.getValuetype())) { - final int index = ((Integer_Value) value_index).intValue(); - return getStringElement(index, array_index.getLocation()); + final Value arrayIndex = ((ArraySubReference) subreference).getValue(); + final IValue valueIndex = arrayIndex.getValueRefdLast(timestamp, refChain); + if (!valueIndex.isUnfoldable(timestamp)) { + if (Value_type.INTEGER_VALUE.equals(valueIndex.getValuetype())) { + final int index = ((Integer_Value) valueIndex).intValue(); + return getStringElement(index, arrayIndex.getLocation()); } - array_index.getLocation().reportSemanticError(ArraySubReference.INTEGERINDEXEXPECTED); + arrayIndex.getLocation().reportSemanticError(ArraySubReference.INTEGERINDEXEXPECTED); return null; } return null; @@ -106,7 +106,7 @@ public final class ISO2022String_Value extends Value { } @Override - public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Bits.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Bits.java index 9dc16d9f3206915d578df68ea6888a80459d95cc..6e86f360952453b38600dd69d81ecb719a1f209d 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Bits.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Bits.java @@ -59,7 +59,7 @@ public final class Named_Bits extends Value { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (null == lastTimeChecked || lastTimeChecked.isLess(timestamp)) { return Type_type.TYPE_UNDEFINED; } @@ -68,7 +68,7 @@ public final class Named_Bits extends Value { return Type_type.TYPE_UNDEFINED; } - return realValue.getExpressionReturntype(timestamp, expected_value); + return realValue.getExpressionReturntype(timestamp, expectedValue); } public int getNofIds() { @@ -92,8 +92,8 @@ public final class Named_Bits extends Value { return identifierMap.containsKey(id.getName()); } - public void setRealValue(final Bitstring_Value real_value) { - this.realValue = real_value; + public void setRealValue(final Bitstring_Value realValue) { + this.realValue = realValue; } @Override @@ -139,23 +139,23 @@ public final class Named_Bits extends Value { } @Override - public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { if (null == realValue || realValue.getIsErroneous(timestamp)) { return true; } - return realValue.isUnfoldable(timestamp, expected_value, referenceChain); + return realValue.isUnfoldable(timestamp, expectedValue, referenceChain); } @Override - public IValue getValueRefdLast(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public IValue getValueRefdLast(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { if (null == realValue || realValue.getIsErroneous(timestamp)) { return this; } - return realValue.getValueRefdLast(timestamp, expected_value, referenceChain); + return realValue.getValueRefdLast(timestamp, expectedValue, referenceChain); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Integer_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Integer_Value.java index a7768849ad3cff3acd28ae5ea15f5e3aaf1c4bf9..b8d62e00d31ca8bd8ed42958b999a4bcfe2d2bfd 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Integer_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Named_Integer_Value.java @@ -62,7 +62,7 @@ public final class Named_Integer_Value extends Value { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { // actually this should never be called return Type_type.TYPE_INTEGER; } @@ -100,7 +100,7 @@ public final class Named_Integer_Value extends Value { } @Override - public IValue getValueRefdLast(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public IValue getValueRefdLast(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { if (null != calculatedValue) { return calculatedValue; @@ -110,7 +110,7 @@ public final class Named_Integer_Value extends Value { } @Override - public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { return true; } @@ -128,9 +128,9 @@ public final class Named_Integer_Value extends Value { } @Override - public Value setValuetype(final CompilationTimeStamp timestamp, final Value_type new_type) { + public Value setValuetype(final CompilationTimeStamp timestamp, final Value_type newType) { // the conversion is done in ASN1_Integer_Type#check_this_value - return super.setValuetype(timestamp, new_type); + return super.setValuetype(timestamp, newType); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/RelativeObjectIdentifier_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/RelativeObjectIdentifier_Value.java index e62d09a0a9620ea9f3cc9f10946e646fb335cbac..c84869d9c0dc2effccdd0fc0f7b1fef95007de6b 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/RelativeObjectIdentifier_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/RelativeObjectIdentifier_Value.java @@ -67,7 +67,7 @@ public final class RelativeObjectIdentifier_Value extends Value { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { return Type_type.TYPE_ROID; } @@ -136,7 +136,7 @@ public final class RelativeObjectIdentifier_Value extends Value { } @Override - public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { return true; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Undefined_Block_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Undefined_Block_Value.java index 2762327654a1c72c17c111f565925feaa3dcc741..d495c249ddf8ab46b9afc96a8d57da65374df1fb 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Undefined_Block_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASN1/values/Undefined_Block_Value.java @@ -74,7 +74,7 @@ public final class Undefined_Block_Value extends Value { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (null == lastTimeChecked || lastTimeChecked.isLess(timestamp)) { return Type_type.TYPE_UNDEFINED; } @@ -83,7 +83,7 @@ public final class Undefined_Block_Value extends Value { return Type_type.TYPE_UNDEFINED; } - return realValue.getExpressionReturntype(timestamp, expected_value); + return realValue.getExpressionReturntype(timestamp, expectedValue); } @Override @@ -125,7 +125,7 @@ public final class Undefined_Block_Value extends Value { } @Override - public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { if (null == lastTimeChecked || lastTimeChecked.isLess(timestamp)) { return true; @@ -135,11 +135,11 @@ public final class Undefined_Block_Value extends Value { return true; } - return realValue.isUnfoldable(timestamp, expected_value, referenceChain); + return realValue.isUnfoldable(timestamp, expectedValue, referenceChain); } @Override - public IValue getValueRefdLast(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, + public IValue getValueRefdLast(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { if (null == lastTimeChecked || lastTimeChecked.isLess(timestamp)) { return this; @@ -149,15 +149,15 @@ public final class Undefined_Block_Value extends Value { return this; } - return realValue.getValueRefdLast(timestamp, expected_value, referenceChain); + return realValue.getValueRefdLast(timestamp, expectedValue, referenceChain); } // FIXME can be converted to: charsyms @Override - public Value setValuetype(final CompilationTimeStamp timestamp, final Value_type new_type) { + public Value setValuetype(final CompilationTimeStamp timestamp, final Value_type newType) { lastTimeChecked = timestamp; - switch (new_type) { + switch (newType) { case NAMED_BITS: { Named_Bits namedBits = parseBlockNamedBits(); if (null == namedBits) { @@ -239,7 +239,7 @@ public final class Undefined_Block_Value extends Value { break; } default: - realValue = super.setValuetype(timestamp, new_type); + realValue = super.setValuetype(timestamp, newType); } return realValue; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASTNode.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASTNode.java index 9791dbca3e8f96e8c01cc739906e898d6c0ea0e0..8be1bd7e2019d5e1d6f32ac01f176d928576d69a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASTNode.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ASTNode.java @@ -63,8 +63,8 @@ public abstract class ASTNode implements IASTNode, IIdentifierContainer, IVisita return null; } - final T3Doc parent_t3doc = assignment.getT3Doc(location); - if (parent_t3doc != null) { + final T3Doc parentT3doc = assignment.getT3Doc(location); + if (parentT3doc != null) { // if it is a type assignment/definition then detect if we are in a field if (assignment.getAssignmentType() == Assignment_type.A_TYPE) { IType type = assignment.getType(CompilationTimeStamp.getBaseTimestamp()); @@ -86,8 +86,8 @@ public abstract class ASTNode implements IASTNode, IIdentifierContainer, IVisita } //Get member information if available - if (parent_t3doc.getMembers() != null) { - final String desc = parent_t3doc.getMembers().get(st); + if (parentT3doc.getMembers() != null) { + final String desc = parentT3doc.getMembers().get(st); if (desc != null) { return new T3Doc(desc); } @@ -97,12 +97,12 @@ public abstract class ASTNode implements IASTNode, IIdentifierContainer, IVisita String st = st1.substring(st1.lastIndexOf(".") + 1); String desc = null; - if (parent_t3doc.getMembers() != null) { - desc = parent_t3doc.getMembers().get(st); + if (parentT3doc.getMembers() != null) { + desc = parentT3doc.getMembers().get(st); } - if (parent_t3doc.getParams() != null) { - desc = parent_t3doc.getParams().get(st); + if (parentT3doc.getParams() != null) { + desc = parentT3doc.getParams().get(st); } if (desc != null) { @@ -118,8 +118,8 @@ public abstract class ASTNode implements IASTNode, IIdentifierContainer, IVisita String st1 = this.getFullName().toString(); String st = st1.substring(st1.lastIndexOf(".") + 1); - if (parent_t3doc.getParams() != null) { - final String desc = parent_t3doc.getParams().get(st); + if (parentT3doc.getParams() != null) { + final String desc = parentT3doc.getParams().get(st); if (desc != null) { return new T3Doc(desc); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Assignment.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Assignment.java index 17852c4c3f416437b987a358a1de892eceff65d1..87ff48c9e31ff67f4943f0cb5f33964c1bf0d098 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Assignment.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Assignment.java @@ -12,6 +12,7 @@ import java.text.MessageFormat; import org.eclipse.core.runtime.Platform; import org.eclipse.titan.designer.GeneralConstants; import org.eclipse.titan.designer.AST.TTCN3.definitions.Group; +import org.eclipse.titan.designer.declarationsearch.Declaration; import org.eclipse.titan.designer.editors.DeclarationCollector; import org.eclipse.titan.designer.editors.ProposalCollector; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; @@ -25,7 +26,7 @@ import org.eclipse.titan.designer.productUtilities.ProductConstants; * * @author Kristof Szabados * */ -public abstract class Assignment extends ASTNode implements IOutlineElement, ILocateableNode, IReferenceChainElement { +public abstract class Assignment extends ASTNode implements IOutlineElement, ILocateableNode, IReferenceChainElement, IReferencingElement { protected static final String GLOBALLY_UNUSED = "The {0} seems to be never used globally"; protected static final String LOCALLY_UNUSED = "The {0} seems to be never used locally"; @@ -97,6 +98,13 @@ public abstract class Assignment extends ASTNode implements IOutlineElement, ILo return lastTimeChecked; } + /** + * Resets the last time when this assignment was checked. + * */ + public final void resetLastTimeChecked() { + lastTimeChecked = null; + } + public final boolean getIsErroneous() { return isErroneous; } @@ -263,4 +271,9 @@ public abstract class Assignment extends ASTNode implements IOutlineElement, ILo * @return true if the highlighting of this assignment is turned on */ public abstract boolean shouldMarkOccurrences(); + + @Override + public Declaration getDeclaration() { + return Declaration.createInstance(this); + } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ISetting.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ISetting.java index ae08ca17952106e70ee79433a714391daebeacca..30abab73df7327b008a6ad66af230edcd856788d 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ISetting.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ISetting.java @@ -36,9 +36,9 @@ public interface ISetting extends IASTNode, ILocateableNode { /** * Sets the erroneousness of the setting. * - * @param is_erroneous the value to set. + * @param isErroneous the value to set. * */ - void setIsErroneous(final boolean is_erroneous); + void setIsErroneous(final boolean isErroneous); /** * @return the internal type of the setting diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IType.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IType.java index 815b3cb7d7319f55b0ae8784e1746279712959c4..9d7ddfb3aff4fafedf77c3ba309ab079210980e4 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IType.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IType.java @@ -10,14 +10,13 @@ package org.eclipse.titan.designer.AST; import java.util.List; import java.util.Set; +import org.eclipse.titan.designer.AST.Type.CompatibilityLevel; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.attributes.MultipleWithAttributes; import org.eclipse.titan.designer.AST.TTCN3.attributes.WithAttributesPath; -import org.eclipse.titan.designer.AST.TTCN3.definitions.Definition; import org.eclipse.titan.designer.AST.TTCN3.templates.ITTCN3Template; import org.eclipse.titan.designer.AST.TTCN3.types.subtypes.ParsedSubType; import org.eclipse.titan.designer.AST.TTCN3.types.subtypes.SubType; -import org.eclipse.titan.designer.AST.Type.CompatibilityLevel; import org.eclipse.titan.designer.editors.DeclarationCollector; import org.eclipse.titan.designer.editors.ProposalCollector; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; @@ -198,14 +197,14 @@ public interface IType extends IGovernor, IIdentifierContainer, IVisitableNode, /** true if the value to be checked is an element of a string */ public final boolean str_elem; - public ValueCheckingOptions(final Expected_Value_type expected_value, final boolean incomplete_allowed, final boolean omit_allowed, - final boolean sub_check, final boolean implicit_omit, final boolean str_elem) { - this.expected_value = expected_value; - this.incomplete_allowed = incomplete_allowed; - this.omit_allowed = omit_allowed; - this.sub_check = sub_check; - this.implicit_omit = implicit_omit; - this.str_elem = str_elem; + public ValueCheckingOptions(final Expected_Value_type expectedValue, final boolean incompleteAllowed, final boolean omitAllowed, + final boolean subCheck, final boolean implicitOmit, final boolean strElem) { + this.expected_value = expectedValue; + this.incomplete_allowed = incompleteAllowed; + this.omit_allowed = omitAllowed; + this.sub_check = subCheck; + this.implicit_omit = implicitOmit; + this.str_elem = strElem; } } @@ -336,7 +335,7 @@ public interface IType extends IGovernor, IIdentifierContainer, IVisitableNode, /** * Calculates the list of field types traversed, in type_array and their - * local indices in subrefs_array parameters. Must be used only after + * local indices in subrefsArray parameters. Must be used only after * getFieldType() was already successfully invoked.. It can be used only * when all array indexes are foldable, otherwise it returns false. * @@ -617,8 +616,6 @@ public interface IType extends IGovernor, IIdentifierContainer, IVisitableNode, Assignment getDefiningAssignment(); - Definition getDefiningDefinition(); - // TODO declaration and proposal collecting should not belong here /** * Searches and adds a declaration proposal to the provided collector if diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IValue.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IValue.java index 62cff01988346d9358699294e9200d36a39d5cfd..82cdecc5f52a62b7e8205d43cf39912118e728bc 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IValue.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/IValue.java @@ -191,14 +191,14 @@ public interface IValue extends IGovernedSimple, IIdentifierContainer, IVisitabl * * @param timestamp * the time stamp of the actual semantic check cycle. - * @param expected_value + * @param expectedValue * the kind of the value to be expected. * @param referenceChain * the reference chain to detect circular references. * * @return true if the value is unfoldable, false if it is foldable * */ - boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value, final IReferenceChain referenceChain); + boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain); /** * Returns the referenced field value for structured values, or itself @@ -226,13 +226,13 @@ public interface IValue extends IGovernedSimple, IIdentifierContainer, IVisitabl * * @param timestamp * the time stamp of the actual semantic check cycle. - * @param new_type + * @param newType * the new value_type the new value should belong to. * * @return the new value of the provided kind if the conversion is * possible, or this value otherwise. * */ - IValue setValuetype(final CompilationTimeStamp timestamp, final Value_type new_type); + IValue setValuetype(final CompilationTimeStamp timestamp, final Value_type newType); /** * Checks whether this value is defining itself in a recursive way. This diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Identifier.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Identifier.java index bd7d05fc6714f1bdfa48ab92318f32332513bd32..1ba9a542c23924204f481a1d91834dbc558057c7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Identifier.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Identifier.java @@ -544,18 +544,18 @@ public class Identifier implements ILocateableNode, IVisitableNode { } - public Identifier(final Identifier_type id_type, final String name) { - this(id_type, name, NULL_Location.INSTANCE, false); + public Identifier(final Identifier_type idType, final String name) { + this(idType, name, NULL_Location.INSTANCE, false); } - public Identifier(final Identifier_type id_type, final String name, final Location location) { - this(id_type, name, location, false); + public Identifier(final Identifier_type idType, final String name, final Location location) { + this(idType, name, location, false); } - public Identifier(final Identifier_type id_type, final String name, final Location location, final boolean dontregister) { - this.type = id_type; + public Identifier(final Identifier_type idType, final String name, final Location location, final boolean dontregister) { + this.type = idType; this.location = location; - switch(id_type) { + switch(idType) { case ID_ASN: if (ID_MAP_ASN.containsKey(name)) { idData = ID_MAP_ASN.get(name); @@ -680,12 +680,12 @@ public class Identifier implements ILocateableNode, IVisitableNode { } /** - * @param id_type the type of identifier to be checked for. + * @param idType the type of identifier to be checked for. * * @return whether this identifier is valid in a context * */ - public final boolean getHasValid(final Identifier_type id_type) { - switch(id_type) { + public final boolean getHasValid(final Identifier_type idType) { + switch(idType) { case ID_NAME: return !Identifier_Internal_Data.INVALID_STRING.equals(getName()); case ID_TTCN: diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/KeywordLessIdentifier.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/KeywordLessIdentifier.java index da21077e47b755d237f253417db4e557e87e6932..81bfac901253d83ae5da240555634fd6e1b030a0 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/KeywordLessIdentifier.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/KeywordLessIdentifier.java @@ -12,21 +12,21 @@ package org.eclipse.titan.designer.AST; * */ public final class KeywordLessIdentifier extends Identifier { - public KeywordLessIdentifier(final Identifier_type id_type, final String name) { - this(id_type, name, NULL_Location.INSTANCE); + public KeywordLessIdentifier(final Identifier_type idType, final String name) { + this(idType, name, NULL_Location.INSTANCE); } - public KeywordLessIdentifier(final Identifier_type id_type, final String name, final Location location) { - this(id_type, name, location, true); + public KeywordLessIdentifier(final Identifier_type idType, final String name, final Location location) { + this(idType, name, location, true); } - protected KeywordLessIdentifier(final Identifier_type id_type, final String name, + protected KeywordLessIdentifier(final Identifier_type idType, final String name, final Location location, final boolean dontregister) { - type = id_type; + type = idType; this.location = location; String realName; - switch(id_type) { + switch(idType) { case ID_ASN: if (name.length() > 0 && name.charAt(0) == '&') { realName = Identifier_Internal_Data.asnToName(name.substring(1)); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/MarkerHandler.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/MarkerHandler.java index 4d63c35dcda1533b1a64e8b14775f1413f1d3c7a..c2f8362ed9a3189c609c87d2ed3c08ef43a88a32 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/MarkerHandler.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/MarkerHandler.java @@ -682,7 +682,7 @@ public final class MarkerHandler { resources.add(file); } } catch (CoreException e) { - ErrorReporter.logExceptionStackTrace(MARKER_HANDLING_ERROR, e); + //be silent, perhaps it already has been removed } } @@ -710,7 +710,7 @@ public final class MarkerHandler { resources.add(file); } } catch (CoreException e) { - ErrorReporter.logExceptionStackTrace(MARKER_HANDLING_ERROR, e); + //be silent, perhaps it already has been removed } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ModuleImportation.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ModuleImportation.java index 1de0d130b50533679b3b2ac7d5b56ef7fd53bcc3..32d52091f5d85c7b9c5b3cf25308263054683241 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ModuleImportation.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ModuleImportation.java @@ -72,7 +72,7 @@ public abstract class ModuleImportation implements IReferenceChainElement, IOutl } /** - * Sets whether the module refered to by this importation has changed to + * Sets whether the module referred to by this importation has changed to * an other one since the last importation check. * * @param value diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/PortReference.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/PortReference.java new file mode 100644 index 0000000000000000000000000000000000000000..3dcf1f9cb71f6777533fa10adb6c08d4d615bc40 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/PortReference.java @@ -0,0 +1,78 @@ +package org.eclipse.titan.designer.AST; + +import java.text.MessageFormat; + +import org.eclipse.titan.common.logging.ErrorReporter; +import org.eclipse.titan.designer.AST.TTCN3.definitions.Definition; +import org.eclipse.titan.designer.AST.TTCN3.types.ComponentTypeBody; +import org.eclipse.titan.designer.AST.TTCN3.types.Component_Type; +import org.eclipse.titan.designer.parsers.CompilationTimeStamp; + +/** + * Special reference type used by map, unmap, connect, disconnect statements. + * + * This reference is never part of the scope hierarchy, + * but only references a port within a component type. + * + * */ +public class PortReference extends Reference { + private static final String NOPORTWITHNAME = "Component type `{0}'' does not have a port with name `{1}''"; + + private Component_Type componentType; + + public PortReference(final Reference reference) { + super(null, reference.getSubreferences()); + } + + public void setComponent(final Component_Type componentType) { + this.componentType = componentType; + } + + /** @return a new instance of this reference */ + public Reference newInstance() { + ErrorReporter.INTERNAL_ERROR("Port referencies should not be cloned"); + return null; + } + + @Override + public Assignment getRefdAssignment(CompilationTimeStamp timestamp, boolean checkParameterList) { + if(myScope == null || componentType == null) { + return null; + } + + if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) { + return referredAssignment; + } + + Identifier portIdentifier = getId(); + ComponentTypeBody componentBody = componentType.getComponentBody(); + if (!componentBody.hasLocalAssignmentWithId(portIdentifier)) { + getLocation().reportSemanticError( + MessageFormat.format(NOPORTWITHNAME, componentType.getTypename(), portIdentifier.getDisplayName())); + + referredAssignment = null; + lastTimeChecked = timestamp; + return null; + } + + referredAssignment = componentBody.getLocalAssignmentById(portIdentifier); + + if (referredAssignment != null) { + referredAssignment.check(timestamp); + referredAssignment.setUsed(); + + if (referredAssignment instanceof Definition) { + String referingModuleName = getMyScope().getModuleScope().getName(); + if (!((Definition) referredAssignment).referingHere.contains(referingModuleName)) { + ((Definition) referredAssignment).referingHere.add(referingModuleName); + } + } + } + + lastTimeChecked = timestamp; + + return referredAssignment; + } + + +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Reference.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Reference.java index 6d24a15a1227c5ddfc00278366a47788310ab98d..b9a9a12a373132ca03a68804a82d7f87b88f2655 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Reference.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Reference.java @@ -78,8 +78,8 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall /** * The assignment referred to by this reference. * */ - private Assignment referedAssignment; - private CompilationTimeStamp lastTimeChecked; + protected Assignment referredAssignment; + protected CompilationTimeStamp lastTimeChecked; /** * Stores whether this reference is used on the left hand side of an @@ -120,7 +120,7 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall * Might be outdated information. * */ public Assignment getAssOld() { - return referedAssignment; + return referredAssignment; } /** @@ -202,11 +202,11 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall /** * Sets the erroneousness of the setting. * - * @param is_erroneous + * @param isErroneous * set the erroneousness property of the references. * */ - public void setIsErroneous(final boolean is_erroneous) { - isErroneous = is_erroneous; + public void setIsErroneous(final boolean isErroneous) { + this.isErroneous = isErroneous; } /** @@ -355,7 +355,7 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall * Clears the cache of this reference. **/ public void clear() { - referedAssignment = null; + referredAssignment = null; lastTimeChecked = null; } @@ -437,43 +437,43 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall } if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp) && !checkParameterList) { - return referedAssignment; + return referredAssignment; } detectedModuleId = false; detectModid(); - referedAssignment = myScope.getAssBySRef(timestamp, this); + referredAssignment = myScope.getAssBySRef(timestamp, this); - if (referedAssignment != null) { - referedAssignment.check(timestamp); - referedAssignment.setUsed(); + if (referredAssignment != null) { + referredAssignment.check(timestamp); + referredAssignment.setUsed(); - if (referedAssignment instanceof Definition) { + if (referredAssignment instanceof Definition) { String referingModuleName = getMyScope().getModuleScope().getName(); - if (!((Definition) referedAssignment).referingHere.contains(referingModuleName)) { - ((Definition) referedAssignment).referingHere.add(referingModuleName); + if (!((Definition) referredAssignment).referingHere.contains(referingModuleName)) { + ((Definition) referredAssignment).referingHere.add(referingModuleName); } } } - if (referedAssignment != null && checkParameterList) { + if (referredAssignment != null && checkParameterList) { FormalParameterList formalParameterList = null; - if (referedAssignment instanceof IParameterisedAssignment) { - formalParameterList = ((IParameterisedAssignment) referedAssignment).getFormalParameterList(); + if (referredAssignment instanceof IParameterisedAssignment) { + formalParameterList = ((IParameterisedAssignment) referredAssignment).getFormalParameterList(); } if (formalParameterList == null) { if (!subReferences.isEmpty() && subReferences.get(0) instanceof ParameterisedSubReference) { final String message = MessageFormat.format("The referenced {0} cannot have actual parameters", - referedAssignment.getDescription()); + referredAssignment.getDescription()); getLocation().reportSemanticError(message); } } else { if (!subReferences.isEmpty()) { ISubReference firstSubReference = subReferences.get(0); if (firstSubReference instanceof ParameterisedSubReference) { - formalParameterList.check(timestamp, referedAssignment.getAssignmentType()); + formalParameterList.check(timestamp, referredAssignment.getAssignmentType()); isErroneous = ((ParameterisedSubReference) firstSubReference).checkParameters(timestamp, formalParameterList); } else { @@ -482,11 +482,11 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall // to a template having formal // parameters, where each has // default values - if (!Assignment.Assignment_type.A_TEMPLATE.equals(referedAssignment.getAssignmentType()) + if (!Assignment.Assignment_type.A_TEMPLATE.equals(referredAssignment.getAssignmentType()) || !formalParameterList.hasOnlyDefaultValues()) { final String message = MessageFormat.format( "Reference to parameterized definition `{0}'' without actual parameter list", - referedAssignment.getIdentifier().getDisplayName()); + referredAssignment.getIdentifier().getDisplayName()); getLocation().reportSemanticError(message); } } @@ -496,7 +496,7 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall lastTimeChecked = timestamp; - return referedAssignment; + return referredAssignment; } /** @@ -787,18 +787,18 @@ public class Reference extends ASTNode implements ILocateableNode, IIncrementall for (ISubReference sr : subReferences) { sr.findReferences(referenceFinder, foundIdentifiers); } - if (referedAssignment == null) { + if (referredAssignment == null) { return; } if (referenceFinder.fieldId == null) { // we are searching for the assignment itself - if (referenceFinder.assignment != referedAssignment) { + if (referenceFinder.assignment != referredAssignment) { return; } foundIdentifiers.add(new Hit(getId(), this)); } else { // we are searching for a field of a type - IType t = referedAssignment.getType(CompilationTimeStamp.getBaseTimestamp()); + IType t = referredAssignment.getType(CompilationTimeStamp.getBaseTimestamp()); if (t == null) { return; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ReferenceFinder.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ReferenceFinder.java index 54ef645f06e341da19c7380e99fad3b86446b53e..e46212e5ae199ce147cf5ade726c22b852efc6f3 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ReferenceFinder.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/ReferenceFinder.java @@ -201,6 +201,7 @@ public final class ReferenceFinder { // runs on that component or a compatible or self // treat it as global definition if (localScope instanceof ComponentTypeBody) { + //FIXME this still does not make them global, that is something completely different. localScope = module; } else // search for actual named parameters everywhere @@ -215,7 +216,7 @@ public final class ReferenceFinder { return localScope; } - + //FIXME should check all modules that might transitively import the definition public Map<Module, List<Hit>> findAllReferences(final Module module, final ProjectSourceParser projectSourceParser, final IProgressMonitor pMonitor, final boolean reportDebugInformation) { final IProgressMonitor monitor = pMonitor == null ? new NullProgressMonitor() : pMonitor; @@ -223,13 +224,15 @@ public final class ReferenceFinder { monitor.beginTask("Searching references.", projectSourceParser.getKnownModuleNames().size()); Map<Module, List<Hit>> foundIdsMap = new HashMap<Module, List<Hit>>(); // in this scope + //TODO this is efficient but only for local variables ... and if are not followed up by other searches List<Hit> foundIds = new ArrayList<Hit>(); scope.findReferences(this, foundIds); if (!foundIds.isEmpty()) { - foundIdsMap.put(module, foundIds); + foundIdsMap.put(scope.getModuleScope(), foundIds); } // in other modules that import this module, if the assignment // is global + //FIXME but if component variable ... we might have to search all related modules in all related projects. if (scope instanceof Module) { for (String moduleName2 : projectSourceParser.getKnownModuleNames()) { if (monitor.isCanceled()) { @@ -241,7 +244,7 @@ public final class ReferenceFinder { continue; } for (Module m : module2.getImportedModules()) { - if (m == module) { + if (m == scope) { if (reportDebugInformation) { TITANDebugConsole.println("found importing module: " + module2.getName()); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Setting.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Setting.java index ade3b97f987466e24ac16d8886561f9d4b9e85f1..d3098967cb998815b254ac755952ae733003cb34 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Setting.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Setting.java @@ -41,8 +41,8 @@ public abstract class Setting extends ASTNode implements ISetting { } @Override - public final void setIsErroneous(final boolean is_erroneous) { - isErroneous = is_erroneous; + public final void setIsErroneous(final boolean isErroneous) { + this.isErroneous = isErroneous; } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/TemplateRestriction.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/TemplateRestriction.java index 8c78aaa3b82996f361559a37202ac612e67022c0..846f1a7d622884193b99ceedd3600b0945862dbb 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/TemplateRestriction.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/TemplateRestriction.java @@ -84,23 +84,23 @@ public final class TemplateRestriction { } /** - * Checks if needed_tr is satisfied by refd_tr. + * Checks if neededTemplateRestriction is satisfied by refd_tr. * - * @param needed_tr the restriction that should be satisfied. - * @param refd_tr the restriction that should be satisfying. + * @param neededTemplateRestriction the restriction that should be satisfied. + * @param refdTemplateRestriction the restriction that should be satisfying. * - * @return true if needed_tr is satisfied by refd_tr, false otherwise. + * @return true if neededTemplateRestriction is satisfied by refd_tr, false otherwise. * */ - public static boolean isLessRestrictive(final Restriction_type needed_tr, final Restriction_type refd_tr) { - switch (needed_tr) { + public static boolean isLessRestrictive(final Restriction_type neededTemplateRestriction, final Restriction_type refdTemplateRestriction) { + switch (neededTemplateRestriction) { case TR_NONE: return false; case TR_VALUE: - return refd_tr != Restriction_type.TR_VALUE; + return refdTemplateRestriction != Restriction_type.TR_VALUE; case TR_OMIT: - return refd_tr != Restriction_type.TR_VALUE && refd_tr != Restriction_type.TR_OMIT; + return refdTemplateRestriction != Restriction_type.TR_VALUE && refdTemplateRestriction != Restriction_type.TR_OMIT; case TR_PRESENT: - return refd_tr != Restriction_type.TR_VALUE && refd_tr != Restriction_type.TR_PRESENT; + return refdTemplateRestriction != Restriction_type.TR_VALUE && refdTemplateRestriction != Restriction_type.TR_PRESENT; default: return true; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/DecodeTypeMappingTarget.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/DecodeTypeMappingTarget.java index 7c531c74727613893d8251be16e5d6cebbd12437..0c21d65ff8892b3ef8ddfab47b0cbcc12566cfb8 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/DecodeTypeMappingTarget.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/DecodeTypeMappingTarget.java @@ -25,13 +25,13 @@ import org.eclipse.titan.designer.parsers.CompilationTimeStamp; * */ public final class DecodeTypeMappingTarget extends TypeMappingTarget { - private final Type target_type; + private final Type targetType; private final DecodeAttribute decodeAttribute; private final ErrorBehaviorAttribute errorBehaviorAttribute; - public DecodeTypeMappingTarget(final Type target_type, final ExtensionAttribute decodeAttribute, + public DecodeTypeMappingTarget(final Type targetType, final ExtensionAttribute decodeAttribute, final ErrorBehaviorAttribute errorBehaviorAttribute) { - this.target_type = target_type; + this.targetType = targetType; if (decodeAttribute instanceof DecodeAttribute) { this.decodeAttribute = (DecodeAttribute) decodeAttribute; } else { @@ -52,7 +52,7 @@ public final class DecodeTypeMappingTarget extends TypeMappingTarget { @Override public Type getTargetType() { - return target_type; + return targetType; } public Encoding_type getCodingType() { @@ -87,7 +87,7 @@ public final class DecodeTypeMappingTarget extends TypeMappingTarget { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (target_type == child) { + if (targetType == child) { return builder.append(".<target_type>"); } else if (errorBehaviorAttribute == child) { return builder.append(".<errorbehavior>"); @@ -99,8 +99,8 @@ public final class DecodeTypeMappingTarget extends TypeMappingTarget { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (target_type != null) { - target_type.setMyScope(scope); + if (targetType != null) { + targetType.setMyScope(scope); } } @@ -112,8 +112,8 @@ public final class DecodeTypeMappingTarget extends TypeMappingTarget { lastTimeChecked = timestamp; - if (target_type != null) { - target_type.check(timestamp); + if (targetType != null) { + targetType.check(timestamp); } // FIXME implement once has_encoding is available. if (errorBehaviorAttribute != null) { @@ -123,14 +123,14 @@ public final class DecodeTypeMappingTarget extends TypeMappingTarget { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (target_type != null) { - target_type.findReferences(referenceFinder, foundIdentifiers); + if (targetType != null) { + targetType.findReferences(referenceFinder, foundIdentifiers); } } @Override protected boolean memberAccept(ASTVisitor v) { - if (target_type != null && !target_type.accept(v)) { + if (targetType != null && !targetType.accept(v)) { return false; } if (decodeAttribute != null && !decodeAttribute.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/EncodeTypeMappingTarget.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/EncodeTypeMappingTarget.java index 995bf4be995e665348a0e6a8c060c215cf30149e..5e5dffb89439c004a032656c04c10795434d5acc 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/EncodeTypeMappingTarget.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/EncodeTypeMappingTarget.java @@ -27,13 +27,13 @@ public final class EncodeTypeMappingTarget extends TypeMappingTarget { private static final String FULLNAMEPART1 = ".<target_type>"; private static final String FULLNAMEPART2 = ".<errorbehavior>"; - private final Type target_type; + private final Type targetType; private final EncodeAttribute encodeAttribute; private final ErrorBehaviorAttribute errorBehaviorAttribute; - public EncodeTypeMappingTarget(final Type target_type, final ExtensionAttribute encodeAttribute, + public EncodeTypeMappingTarget(final Type targetType, final ExtensionAttribute encodeAttribute, final ErrorBehaviorAttribute errorBehaviorAttribute) { - this.target_type = target_type; + this.targetType = targetType; if (encodeAttribute instanceof EncodeAttribute) { this.encodeAttribute = (EncodeAttribute) encodeAttribute; } else { @@ -54,7 +54,7 @@ public final class EncodeTypeMappingTarget extends TypeMappingTarget { @Override public Type getTargetType() { - return target_type; + return targetType; } public Encoding_type getCodingType() { @@ -89,7 +89,7 @@ public final class EncodeTypeMappingTarget extends TypeMappingTarget { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (target_type == child) { + if (targetType == child) { return builder.append(FULLNAMEPART1); } else if (errorBehaviorAttribute == child) { return builder.append(FULLNAMEPART2); @@ -101,8 +101,8 @@ public final class EncodeTypeMappingTarget extends TypeMappingTarget { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (target_type != null) { - target_type.setMyScope(scope); + if (targetType != null) { + targetType.setMyScope(scope); } } @@ -114,8 +114,8 @@ public final class EncodeTypeMappingTarget extends TypeMappingTarget { lastTimeChecked = timestamp; - if (target_type != null) { - target_type.check(timestamp); + if (targetType != null) { + targetType.check(timestamp); } // FIXME implement once has_encoding is available. if (errorBehaviorAttribute != null) { @@ -125,14 +125,14 @@ public final class EncodeTypeMappingTarget extends TypeMappingTarget { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (target_type != null) { - target_type.findReferences(referenceFinder, foundIdentifiers); + if (targetType != null) { + targetType.findReferences(referenceFinder, foundIdentifiers); } } @Override protected boolean memberAccept(ASTVisitor v) { - if (target_type != null && !target_type.accept(v)) { + if (targetType != null && !targetType.accept(v)) { return false; } if (encodeAttribute != null && !encodeAttribute.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributeSpecification.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributeSpecification.java index 7bd2c1b425805c910863751d6fcbd7b16d0bdb6b..2313f5ec746b6d8f120f07aae5a03e950552ebf9 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributeSpecification.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributeSpecification.java @@ -59,11 +59,11 @@ public final class ErroneousAttributeSpecification implements ILocateableNode, I // set by check() or null if tmpl_inst is invalid or omit private IValue value = null; - public ErroneousAttributeSpecification(final Indicator_Type indicator, final boolean isRaw, final TemplateInstance tmpl_inst, + public ErroneousAttributeSpecification(final Indicator_Type indicator, final boolean isRaw, final TemplateInstance templateInst, final boolean hasAllKeyword) { this.indicator = indicator; this.isRaw = isRaw; - this.templateInst = tmpl_inst; + this.templateInst = templateInst; this.hasAllKeyword = hasAllKeyword; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributes.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributes.java index 1d46c4d64097dfef5ba0951c53be18e3fde31760..03e8b0aa75afa9a316eaf315f31ba9a06c7225fb 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributes.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErroneousAttributes.java @@ -34,16 +34,16 @@ import org.eclipse.titan.designer.parsers.CompilationTimeStamp; */ class FieldErr_Type { public Qualifier qualifier; - public ErroneousAttributeSpecification errAttr; + public ErroneousAttributeSpecification errAttrSpec; public List<Integer> subrefsArray; public List<IType> typeArray; - FieldErr_Type(final Qualifier qualifier, final ErroneousAttributeSpecification err_attr_spec, final List<Integer> subrefs_array, - final List<IType> type_array) { + FieldErr_Type(final Qualifier qualifier, final ErroneousAttributeSpecification errAttrSpec, final List<Integer> subrefsArray, + final List<IType> typeArray) { this.qualifier = qualifier; - this.errAttr = err_attr_spec; - this.subrefsArray = subrefs_array; - this.typeArray = type_array; + this.errAttrSpec = errAttrSpec; + this.subrefsArray = subrefsArray; + this.typeArray = typeArray; } } @@ -120,8 +120,8 @@ public class ErroneousAttributes implements IIdentifierContainer, IVisitableNode Qualifier omitAfterQualifier = null; Map<Integer, List<FieldErr_Type>> embeddedFieldArrayMap = new HashMap<Integer, List<FieldErr_Type>>(); for (FieldErr_Type actualFieldErr : fldArray) { - Indicator_Type actIndicator = actualFieldErr.errAttr.getIndicator(); - boolean isOmit = actualFieldErr.errAttr.isOmit(); + Indicator_Type actIndicator = actualFieldErr.errAttrSpec.getIndicator(); + boolean isOmit = actualFieldErr.errAttrSpec.isOmit(); if (actualFieldErr.subrefsArray.size() <= level) { ErrorReporter.INTERNAL_ERROR(); return erroneousDescr; @@ -309,13 +309,13 @@ public class ErroneousAttributes implements IIdentifierContainer, IVisitableNode actualFieldErr.qualifier.getDisplayName()); switch (actIndicator) { case Before_Indicator: - evs.before = actualFieldErr.errAttr; + evs.before = actualFieldErr.errAttrSpec; break; case Value_Indicator: - evs.value = actualFieldErr.errAttr; + evs.value = actualFieldErr.errAttrSpec; break; case After_Indicator: - evs.after = actualFieldErr.errAttr; + evs.after = actualFieldErr.errAttrSpec; break; default: ErrorReporter.INTERNAL_ERROR(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErrorBehaviorList.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErrorBehaviorList.java index 5c63ee92fb6a01ce9b93b825a7dd5209d45b8d9f..810b2410692b186ce879fbc4c8c072294e544392 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErrorBehaviorList.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/ErrorBehaviorList.java @@ -87,15 +87,15 @@ public final class ErrorBehaviorList extends ASTNode implements ILocateableNode return settings.get(index); } - public boolean hasSetting(final CompilationTimeStamp timestamp, final String error_type) { + public boolean hasSetting(final CompilationTimeStamp timestamp, final String errorType) { check(timestamp); - return settingAll != null || settingMap.containsKey(error_type); + return settingAll != null || settingMap.containsKey(errorType); } - public String getHandling(final CompilationTimeStamp timestamp, final String error_type) { + public String getHandling(final CompilationTimeStamp timestamp, final String errorType) { check(timestamp); - if (settingMap.containsKey(error_type)) { - return settingMap.get(error_type).getErrorHandling(); + if (settingMap.containsKey(errorType)) { + return settingMap.get(errorType).getErrorHandling(); } else if (settingAll != null) { return settingAll.getErrorHandling(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/FunctionTypeMappingTarget.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/FunctionTypeMappingTarget.java index 24ec01d8643949ab12de5bf154fcf194203ceef6..d4dbcff571aad6a9993883f8e575deabdea3f905 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/FunctionTypeMappingTarget.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/FunctionTypeMappingTarget.java @@ -37,9 +37,9 @@ public final class FunctionTypeMappingTarget extends TypeMappingTarget { private Def_Function functionReferenced; private Def_Extfunction extfunctionReferenced; - public FunctionTypeMappingTarget(final Type target_type, final Reference function_reference) { - this.targetType = target_type; - this.functionReference = function_reference; + public FunctionTypeMappingTarget(final Type targetType, final Reference functionReference) { + this.targetType = targetType; + this.functionReference = functionReference; } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/SimpleTypeMappingTarget.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/SimpleTypeMappingTarget.java index 8a28051427854df689eda25cbb48134cddb3ba35..44515e8c18f8c78906080b4877f0294abb156765 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/SimpleTypeMappingTarget.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/SimpleTypeMappingTarget.java @@ -23,10 +23,10 @@ import org.eclipse.titan.designer.parsers.CompilationTimeStamp; * */ public final class SimpleTypeMappingTarget extends TypeMappingTarget { - private final Type target_type; + private final Type targetType; - public SimpleTypeMappingTarget(final Type target_type) { - this.target_type = target_type; + public SimpleTypeMappingTarget(final Type targetType) { + this.targetType = targetType; } @Override @@ -41,7 +41,7 @@ public final class SimpleTypeMappingTarget extends TypeMappingTarget { @Override public Type getTargetType() { - return target_type; + return targetType; } @Override @@ -52,23 +52,23 @@ public final class SimpleTypeMappingTarget extends TypeMappingTarget { lastTimeChecked = timestamp; - if (source != null && !source.isIdentical(timestamp, target_type)) { - target_type.getLocation().reportSemanticError( + if (source != null && !source.isIdentical(timestamp, targetType)) { + targetType.getLocation().reportSemanticError( MessageFormat.format("The source and target types must be the same: `{0}'' was expected instead of `{1}''", - source.getTypename(), target_type.getTypename())); + source.getTypename(), targetType.getTypename())); } } @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (target_type != null) { - target_type.findReferences(referenceFinder, foundIdentifiers); + if (targetType != null) { + targetType.findReferences(referenceFinder, foundIdentifiers); } } @Override protected boolean memberAccept(ASTVisitor v) { - if (target_type != null && !target_type.accept(v)) { + if (targetType != null && !targetType.accept(v)) { return false; } return true; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/TypeMappings.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/TypeMappings.java index de67ba1702377dccd52f2a0c13b64e37744f63ca..f9a29cfebabf03ced60e48b7a402835e42630a77 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/TypeMappings.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/TypeMappings.java @@ -104,16 +104,16 @@ public final class TypeMappings extends ASTNode implements ILocateableNode { /** * Copy over the mappings from the provided mapping list. * - * @param other_mappings + * @param otherMappings * the other list of mappings. * */ - public void copyMappings(final TypeMappings other_mappings) { - for (int i = 0, size = other_mappings.getNofMappings(); i < size; i++) { - mappings.add(other_mappings.getMappingByIndex(i)); + public void copyMappings(final TypeMappings otherMappings) { + for (int i = 0, size = otherMappings.getNofMappings(); i < size; i++) { + mappings.add(otherMappings.getMappingByIndex(i)); } // join the locations - getLocation().setEndOffset(other_mappings.getLocation().getEndOffset()); + getLocation().setEndOffset(otherMappings.getLocation().getEndOffset()); } /** diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/WithAttributesPath.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/WithAttributesPath.java index d12192033e6308acf6fb02acbc237ea6bb7935ad..decefd3287d0f635ad88523abb8842edfcec7196 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/WithAttributesPath.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/attributes/WithAttributesPath.java @@ -122,7 +122,7 @@ public final class WithAttributesPath implements ILocateableNode, IIncrementally * @param timestamp * the timestamp of the actual semantic check cycle. */ - public void checkGlobalAttributes(final CompilationTimeStamp timestamp, final boolean erroneous_allowed) { + public void checkGlobalAttributes(final CompilationTimeStamp timestamp, final boolean erroneousAllowed) { if (lastTimeGlobalChecked != null && !lastTimeGlobalChecked.isLess(timestamp)) { return; } @@ -134,7 +134,7 @@ public final class WithAttributesPath implements ILocateableNode, IIncrementally } SingleWithAttribute tempAttribute; - if (!erroneous_allowed) { + if (!erroneousAllowed) { for (int i = 0, size = attributes.getNofElements(); i < size; i++) { tempAttribute = attributes.getAttribute(i); if (tempAttribute.getAttributeType() == Attribute_Type.Erroneous_Attribute) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Altstep.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Altstep.java index cb029c2d1e4c7adaae5886dab16289d2a88446f9..239b9fd65e79281af8d57b00bb5cc0f1babce432 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Altstep.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Altstep.java @@ -62,17 +62,17 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig } private final FormalParameterList formalParList; - private final Reference runs_on_ref; + private final Reference runsOnRef; private Component_Type runsOnType = null; private final StatementBlock block; private final AltGuards altGuards; private NamedBridgeScope bridgeScope = null; - public Def_Altstep(final Identifier identifier, final FormalParameterList formalParameters, final Reference runs_on_ref, + public Def_Altstep(final Identifier identifier, final FormalParameterList formalParameters, final Reference runsOnRef, final StatementBlock block, final AltGuards altGuards) { super(identifier); this.formalParList = formalParameters; - this.runs_on_ref = runs_on_ref; + this.runsOnRef = runsOnRef; this.block = block; this.altGuards = altGuards; @@ -80,8 +80,8 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig formalParList.setMyDefinition(this); formalParList.setFullNameParent(this); } - if (runs_on_ref != null) { - runs_on_ref.setFullNameParent(this); + if (runsOnRef != null) { + runsOnRef.setFullNameParent(this); } if (block != null) { block.setMyDefinition(this); @@ -106,7 +106,7 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig if (formalParList == child) { return builder.append(FULLNAMEPART1); - } else if (runs_on_ref == child) { + } else if (runsOnRef == child) { return builder.append(FULLNAMEPART2); } else if (block == child) { return builder.append(FULLNAMEPART3); @@ -158,8 +158,8 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig bridgeScope.setScopeMacroName(identifier.getDisplayName()); super.setMyScope(bridgeScope); - if (runs_on_ref != null) { - runs_on_ref.setMyScope(bridgeScope); + if (runsOnRef != null) { + runsOnRef.setMyScope(bridgeScope); } formalParList.setMyScope(bridgeScope); if (block != null) { @@ -198,8 +198,8 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig T3Doc.check(this.getCommentLocation(), KIND); - if (runs_on_ref != null) { - runsOnType = runs_on_ref.chkComponentypeReference(timestamp); + if (runsOnRef != null) { + runsOnType = runsOnRef.chkComponentypeReference(timestamp); if (runsOnType != null) { Scope formalParlistPreviosScope = formalParList.getParentScope(); if (formalParlistPreviosScope instanceof RunsOnScope @@ -359,12 +359,10 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); @@ -372,7 +370,6 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig // damage handled if (result == 0) { enveloped = true; - reparser.moduleToBeReanalysed.addAll(referingHere); } else { removeBridge(); throw new ReParseException(result); @@ -388,7 +385,6 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig formalParList.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(formalParList.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -396,16 +392,15 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig } } - if (runs_on_ref != null) { + if (runsOnRef != null) { if (enveloped) { - runs_on_ref.updateSyntax(reparser, false); - reparser.updateLocation(runs_on_ref.getLocation()); - } else if (reparser.envelopsDamage(runs_on_ref.getLocation())) { + runsOnRef.updateSyntax(reparser, false); + reparser.updateLocation(runsOnRef.getLocation()); + } else if (reparser.envelopsDamage(runsOnRef.getLocation())) { try { - runs_on_ref.updateSyntax(reparser, true); + runsOnRef.updateSyntax(reparser, true); enveloped = true; - reparser.updateLocation(runs_on_ref.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); + reparser.updateLocation(runsOnRef.getLocation()); } catch (ReParseException e) { removeBridge(); throw e; @@ -454,7 +449,6 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig withAttributesPath.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(withAttributesPath.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -477,9 +471,9 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig reparser.updateLocation(formalParList.getLocation()); } - if (runs_on_ref != null) { - runs_on_ref.updateSyntax(reparser, false); - reparser.updateLocation(runs_on_ref.getLocation()); + if (runsOnRef != null) { + runsOnRef.updateSyntax(reparser, false); + reparser.updateLocation(runsOnRef.getLocation()); } if (block != null) { @@ -514,8 +508,8 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig if (formalParList != null) { formalParList.findReferences(referenceFinder, foundIdentifiers); } - if (runs_on_ref != null) { - runs_on_ref.findReferences(referenceFinder, foundIdentifiers); + if (runsOnRef != null) { + runsOnRef.findReferences(referenceFinder, foundIdentifiers); } if (block != null) { block.findReferences(referenceFinder, foundIdentifiers); @@ -533,7 +527,7 @@ public final class Def_Altstep extends Definition implements IParameterisedAssig if (formalParList != null && !formalParList.accept(v)) { return false; } - if (runs_on_ref != null && !runs_on_ref.accept(v)) { + if (runsOnRef != null && !runsOnRef.accept(v)) { return false; } if (block != null && !block.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Const.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Const.java index a9c00aa52245c84013071e76aac8797c1f81369e..764674f74e5e8a12135827057ec4a171fbb76127 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Const.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Const.java @@ -294,14 +294,10 @@ public final class Def_Const extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ExternalConst.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ExternalConst.java index bbb11b3d6fda7320a5a26ea55a11e819b556a556..8a8f4dc6e01c311f6ccb63c4bf535b9b1d66a8f4 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ExternalConst.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ExternalConst.java @@ -173,14 +173,10 @@ public final class Def_ExternalConst extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Extfunction.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Extfunction.java index c7c09550c06cae83b5ab0dceadb7bbf72f3fa7a6..3a922169af74a9922041b9d8c8ea8cf3ca43a271 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Extfunction.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Extfunction.java @@ -73,11 +73,11 @@ public final class Def_Extfunction extends Definition implements IParameterisedA private static final String KIND = "external function"; - private final Assignment_type assignment_type; + private final Assignment_type assignmentType; private final FormalParameterList formalParList; private final Type returnType; private final boolean returnsTemplate; - private final TemplateRestriction.Restriction_type template_restriction; + private final TemplateRestriction.Restriction_type templateRestriction; private EncodingPrototype_type prototype; private Type inputType; private Type outputType; @@ -88,15 +88,15 @@ public final class Def_Extfunction extends Definition implements IParameterisedA private PrintingType printingType; public Def_Extfunction(final Identifier identifier, final FormalParameterList formalParameters, final Type returnType, - final boolean returnsTemplate, final TemplateRestriction.Restriction_type template_restriction) { + final boolean returnsTemplate, final TemplateRestriction.Restriction_type templateRestriction) { super(identifier); - assignment_type = (returnType == null) ? Assignment_type.A_EXT_FUNCTION : (returnsTemplate ? Assignment_type.A_EXT_FUNCTION_RTEMP + assignmentType = (returnType == null) ? Assignment_type.A_EXT_FUNCTION : (returnsTemplate ? Assignment_type.A_EXT_FUNCTION_RTEMP : Assignment_type.A_EXT_FUNCTION_RVAL); formalParList = formalParameters; formalParList.setMyDefinition(this); this.returnType = returnType; this.returnsTemplate = returnsTemplate; - this.template_restriction = template_restriction; + this.templateRestriction = templateRestriction; prototype = EncodingPrototype_type.NONE; functionEncodingType = ExternalFunctionEncodingType_type.MANUAL; encodingType = Encoding_type.UNDEFINED; @@ -112,7 +112,7 @@ public final class Def_Extfunction extends Definition implements IParameterisedA @Override public Assignment_type getAssignmentType() { - return assignment_type; + return assignmentType; } @Override @@ -442,7 +442,7 @@ public final class Def_Extfunction extends Definition implements IParameterisedA location.reportSemanticError(MessageFormat.format( "The external function must have a return type for attribute `prototype({0})''", prototype.getName())); } else { - if (Assignment_type.A_FUNCTION_RTEMP.equals(assignment_type)) { + if (Assignment_type.A_FUNCTION_RTEMP.equals(assignmentType)) { returnType.getLocation() .reportSemanticError( MessageFormat.format( @@ -610,20 +610,16 @@ public final class Def_Extfunction extends Definition implements IParameterisedA @Override public TemplateRestriction.Restriction_type getTemplateRestriction() { - return template_restriction; + return templateRestriction; } @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Extfunction.java_ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Extfunction.java_ deleted file mode 100644 index 60709a3a6e74abd2866d49266c96f5c02dbe7007..0000000000000000000000000000000000000000 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Extfunction.java_ +++ /dev/null @@ -1,720 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2000-2014 Ericsson Telecom AB - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - ******************************************************************************/ -package org.eclipse.titan.designer.AST.TTCN3.definitions; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.text.templates.Template; -import org.eclipse.titan.designer.AST.ASTVisitor; -import org.eclipse.titan.designer.AST.INamedNode; -import org.eclipse.titan.designer.AST.ISubReference; -import org.eclipse.titan.designer.AST.IType; -import org.eclipse.titan.designer.AST.Identifier; -import org.eclipse.titan.designer.AST.Location; -import org.eclipse.titan.designer.AST.NamingConventionHelper; -import org.eclipse.titan.designer.AST.ReferenceFinder; -import org.eclipse.titan.designer.AST.Scope; -import org.eclipse.titan.designer.AST.Type; -import org.eclipse.titan.designer.AST.ISubReference.Subreference_type; -import org.eclipse.titan.designer.AST.IType.Encoding_type; -import org.eclipse.titan.designer.AST.IType.Type_type; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; -import org.eclipse.titan.designer.AST.TTCN3.TemplateRestriction; -import org.eclipse.titan.designer.AST.TTCN3.attributes.AttributeSpecification; -import org.eclipse.titan.designer.AST.TTCN3.attributes.DecodeAttribute; -import org.eclipse.titan.designer.AST.TTCN3.attributes.EncodeAttribute; -import org.eclipse.titan.designer.AST.TTCN3.attributes.ErrorBehaviorAttribute; -import org.eclipse.titan.designer.AST.TTCN3.attributes.ErrorBehaviorList; -import org.eclipse.titan.designer.AST.TTCN3.attributes.ExtensionAttribute; -import org.eclipse.titan.designer.AST.TTCN3.attributes.PrintingAttribute; -import org.eclipse.titan.designer.AST.TTCN3.attributes.PrintingType; -import org.eclipse.titan.designer.AST.TTCN3.attributes.PrototypeAttribute; -import org.eclipse.titan.designer.AST.TTCN3.attributes.Qualifiers; -import org.eclipse.titan.designer.AST.TTCN3.attributes.SingleWithAttribute; -import org.eclipse.titan.designer.AST.TTCN3.attributes.SingleWithAttribute.Attribute_Type; -import org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Function.EncodingPrototype_type; -import org.eclipse.titan.designer.editors.DeclarationCollector; -import org.eclipse.titan.designer.editors.ProposalCollector; -import org.eclipse.titan.designer.editors.ttcn3editor.TTCN3CodeSkeletons; -import org.eclipse.titan.designer.parsers.CompilationTimeStamp; -import org.eclipse.titan.designer.parsers.ParserFactory; -import org.eclipse.titan.designer.parsers.extensionattributeparser.ExtensionAttributeAnalyzer; -import org.eclipse.titan.designer.parsers.ttcn3parser.IIdentifierReparser; -import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException; -import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; -import org.eclipse.titan.designer.preferences.PreferenceConstants; - -/** - * The Def_ExtFunction class represents TTCN3 external function definitions. - * - * @author Kristof Szabados - * */ -public final class Def_Extfunction extends Definition implements IParameterisedAssignment { - public enum ExternalFunctionEncodingType_type { - /** manual encoding. */ - MANUAL, - /** generated encoder function. */ - ENCODE, - /** generated decoder function. */ - DECODE - } - - private static final String FULLNAMEPART1 = ".<formal_parameter_list>"; - private static final String FULLNAMEPART2 = ".<type>"; - private static final String FULLNAMEPART3 = ".<errorbehavior_list>"; - public static final String PORTRETURNNOTALLOWED = "External functions can not return ports"; - - private static final String KIND = "external function"; - - private final Assignment_type assignment_type; - private final FormalParameterList formalParList; - private final Type returnType; - private final boolean returnsTemplate; - private final TemplateRestriction.Restriction_type template_restriction; - private EncodingPrototype_type prototype; - private Type inputType; - private Type outputType; - private ExternalFunctionEncodingType_type functionEncodingType; - private Encoding_type encodingType; - private String encodingOptions; - private ErrorBehaviorList errorBehaviorList; - private PrintingType printingType; - - public Def_Extfunction(final Identifier identifier, final FormalParameterList formalParameters, final Type returnType, - final boolean returnsTemplate, final TemplateRestriction.Restriction_type template_restriction) { - super(identifier); - assignment_type = (returnType == null) ? Assignment_type.A_EXT_FUNCTION : (returnsTemplate ? Assignment_type.A_EXT_FUNCTION_RTEMP - : Assignment_type.A_EXT_FUNCTION_RVAL); - formalParList = formalParameters; - formalParList.setMyDefinition(this); - this.returnType = returnType; - this.returnsTemplate = returnsTemplate; - this.template_restriction = template_restriction; - prototype = EncodingPrototype_type.NONE; - functionEncodingType = ExternalFunctionEncodingType_type.MANUAL; - encodingType = Encoding_type.UNDEFINED; - encodingOptions = null; - errorBehaviorList = null; - printingType = null; - - formalParList.setFullNameParent(this); - if (returnType != null) { - returnType.setFullNameParent(this); - } - } - - @Override - public Assignment_type getAssignmentType() { - return assignment_type; - } - - @Override - public StringBuilder getFullName(final INamedNode child) { - StringBuilder builder = super.getFullName(child); - - if (formalParList == child) { - return builder.append(FULLNAMEPART1); - } else if (returnType == child) { - return builder.append(FULLNAMEPART2); - } else if (errorBehaviorList == child) { - return builder.append(FULLNAMEPART3); - } - - return builder; - } - - @Override - public FormalParameterList getFormalParameterList() { - return formalParList; - } - - public EncodingPrototype_type getPrototype() { - return prototype; - } - - public Type getInputType() { - return inputType; - } - - public Type getOutputType() { - return outputType; - } - - @Override - public String getProposalKind() { - return KIND; - } - - @Override - public String getAssignmentName() { - return "external function"; - } - - @Override - public String getOutlineIcon() { - if (returnType == null) { - return "function_external.gif"; - } - - return "function_external_return.gif"; - } - - @Override - public void setMyScope(final Scope scope) { - super.setMyScope(scope); - - formalParList.setMyScope(scope); - if (returnType != null) { - returnType.setMyScope(scope); - } - scope.addSubScope(formalParList.getLocation(), formalParList); - } - - @Override - public Type getType(final CompilationTimeStamp timestamp) { - check(timestamp); - - return returnType; - } - - @Override - public void check(final CompilationTimeStamp timestamp) { - if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) { - return; - } - - isUsed = false; - prototype = EncodingPrototype_type.NONE; - functionEncodingType = ExternalFunctionEncodingType_type.MANUAL; - encodingType = Encoding_type.UNDEFINED; - encodingOptions = null; - errorBehaviorList = null; - printingType = null; - lastTimeChecked = timestamp; - - NamingConventionHelper.checkConvention(PreferenceConstants.REPORTNAMINGCONVENTION_EXTERNALFUNCTION, identifier, this); - NamingConventionHelper.checkNameContents(identifier, getMyScope().getModuleScope().getIdentifier(), getDescription()); - - if (returnType != null) { - returnType.check(timestamp); - IType returnedType = returnType.getTypeRefdLast(timestamp); - if (returnedType != null && Type_type.TYPE_PORT.equals(returnedType.getTypetype()) && returnType.getLocation() != null) { - returnType.getLocation().reportSemanticError(PORTRETURNNOTALLOWED); - } - } - - formalParList.reset(); - formalParList.check(timestamp, getAssignmentType()); - - if (withAttributesPath != null) { - withAttributesPath.checkGlobalAttributes(timestamp, false); - withAttributesPath.checkAttributes(timestamp); - analyzeExtensionAttributes(timestamp); - checkPrototype(timestamp); - checkFunctionType(timestamp); - } - } - - @Override - public void postCheck() { - super.postCheck(); - postCheckPrivateness(); - } - - /** - * Convert and check the encoding attributes applied to this external - * function. - * - * @param timestamp - * the timestamp of the actual build cycle. - * */ - public void analyzeExtensionAttributes(final CompilationTimeStamp timestamp) { - List<SingleWithAttribute> realAttributes = withAttributesPath.getRealAttributes(timestamp); - - SingleWithAttribute attribute; - List<AttributeSpecification> specifications = null; - for (int i = 0, size = realAttributes.size(); i < size; i++) { - attribute = realAttributes.get(i); - if (Attribute_Type.Extension_Attribute.equals(attribute.getAttributeType())) { - Qualifiers qualifiers = attribute.getQualifiers(); - if (qualifiers == null || qualifiers.getNofQualifiers() == 0) { - if (specifications == null) { - specifications = new ArrayList<AttributeSpecification>(); - } - specifications.add(attribute.getAttributeSpecification()); - } - } - } - - if (specifications == null) { - return; - } - - List<ExtensionAttribute> attributes = new ArrayList<ExtensionAttribute>(); - AttributeSpecification specification; - for (int i = 0, size = specifications.size(); i < size; i++) { - specification = specifications.get(i); - ExtensionAttributeAnalyzer analyzer = new ExtensionAttributeAnalyzer(); - analyzer.parse(specification); - List<ExtensionAttribute> temp = analyzer.getAttributes(); - if (temp != null) { - attributes.addAll(temp); - } - } - - ExtensionAttribute extensionAttribute; - for (int i = 0, size = attributes.size(); i < size; i++) { - extensionAttribute = attributes.get(i); - - switch (extensionAttribute.getAttributeType()) { - case PROTOTYPE: - if (EncodingPrototype_type.NONE.equals(prototype)) { - prototype = ((PrototypeAttribute) extensionAttribute).getPrototypeType(); - } else { - location.reportSemanticError("duplicate attribute `prototype'."); - } - break; - case ENCODE: - switch (functionEncodingType) { - case MANUAL: - break; - case ENCODE: - location.reportSemanticError("duplicate attribute `encode'."); - break; - case DECODE: - location.reportSemanticError("`decode' and `encode' attributes cannot be used at the same time."); - break; - default: - break; - } - encodingType = ((EncodeAttribute) extensionAttribute).getEncodingType(); - encodingOptions = ((EncodeAttribute) extensionAttribute).getOptions(); - functionEncodingType = ExternalFunctionEncodingType_type.ENCODE; - break; - case DECODE: - switch (functionEncodingType) { - case MANUAL: - break; - case ENCODE: - location.reportSemanticError("`decode' and `encode' attributes cannot be used at the same time."); - break; - case DECODE: - location.reportSemanticError("duplicate attribute `decode'."); - break; - default: - break; - } - encodingType = ((DecodeAttribute) extensionAttribute).getEncodingType(); - encodingOptions = ((DecodeAttribute) extensionAttribute).getOptions(); - functionEncodingType = ExternalFunctionEncodingType_type.DECODE; - break; - case ERRORBEHAVIOR: - if (errorBehaviorList == null) { - errorBehaviorList = ((ErrorBehaviorAttribute) extensionAttribute).getErrrorBehaviorList(); - } else { - errorBehaviorList.addAllBehaviors(((ErrorBehaviorAttribute) extensionAttribute).getErrrorBehaviorList()); - } - break; - case PRINTING: - if (printingType == null) { - printingType = ((PrintingAttribute) extensionAttribute).getPrintingType(); - } else { - location.reportSemanticError("duplicate attribute `printing'."); - } - break; - default: - break; - } - } - } - - /** - * Checks the prototype attribute set for this external function - * definition. - * - * @param timestamp - * the timestamp of the actual semantic check cycle. - * */ - private void checkPrototype(final CompilationTimeStamp timestamp) { - if (EncodingPrototype_type.NONE.equals(prototype)) { - return; - } - - // checking formal parameter list - if (EncodingPrototype_type.CONVERT.equals(prototype)) { - if (formalParList.getNofParameters() == 1) { - FormalParameter parameter = formalParList.getParameterByIndex(0); - switch (parameter.getRealAssignmentType()) { - case A_PAR_VAL: - case A_PAR_VAL_IN: - inputType = parameter.getType(timestamp); - break; - default: { - final String message = MessageFormat - .format("The parameter must be an `in'' value parameter for attribute `prototype({0})'' instead of {1}", - prototype.getName(), parameter.getAssignmentName()); - parameter.getLocation().reportSemanticError(message); - break; - } - } - } else { - final String message = MessageFormat.format( - "The external function must have one parameter instead of {0} for attribute `prototype({1})''", - formalParList.getNofParameters(), prototype.getName()); - formalParList.getLocation().reportSemanticError(message); - } - } else if (formalParList.getNofParameters() == 2) { - FormalParameter firstParameter = formalParList.getParameterByIndex(0); - if (EncodingPrototype_type.SLIDING.equals(prototype)) { - if (Assignment_type.A_PAR_VAL_INOUT.equals(firstParameter.getRealAssignmentType())) { - Type firstParameterType = firstParameter.getType(timestamp); - IType last = firstParameterType.getTypeRefdLast(timestamp); - if (last.getIsErroneous(timestamp)) { - inputType = firstParameterType; - } else { - switch (last.getTypetypeTtcn3()) { - case TYPE_OCTETSTRING: - case TYPE_CHARSTRING: - inputType = firstParameterType; - break; - default: { - final String message = MessageFormat - .format("The type of the first parameter must be `octetstring'' or `charstring'' for attribute `prototype({0})''", - prototype.getName()); - firstParameter.getLocation().reportSemanticError(message); - - break; - } - } - } - } else { - firstParameter.getLocation() - .reportSemanticError( - MessageFormat.format( - "The first parameter must be an `inout'' value parameter for attribute `prototype({0})'' instead of {1}", - prototype.getName(), firstParameter.getAssignmentName())); - } - } else { - if (Assignment_type.A_PAR_VAL_IN.equals(firstParameter.getRealAssignmentType())) { - inputType = firstParameter.getType(timestamp); - } else { - firstParameter.getLocation() - .reportSemanticError( - MessageFormat.format( - "The first parameter must be an `in'' value parameter for attribute `prototype({0})'' instead of {1}", - prototype.getName(), firstParameter.getAssignmentName())); - } - } - - FormalParameter secondParameter = formalParList.getParameterByIndex(1); - if (Assignment_type.A_PAR_VAL_OUT.equals(secondParameter.getRealAssignmentType())) { - outputType = secondParameter.getType(timestamp); - } else { - secondParameter.getLocation() - .reportSemanticError( - MessageFormat.format( - "The second parameter must be an `out'' value parameter for attribute `prototype({0})'' instead of {1}", - prototype.getName(), secondParameter.getAssignmentName())); - } - } else { - formalParList.getLocation().reportSemanticError( - MessageFormat.format("The function must have two parameters for attribute `prototype({0})'' instead of {1}", - prototype.getName(), formalParList.getNofParameters())); - } - - // checking the return type - if (EncodingPrototype_type.FAST.equals(prototype)) { - if (returnType != null) { - returnType.getLocation().reportSemanticError( - MessageFormat.format("The external function cannot have return type fo attribute `prototype({0})''", - prototype.getName())); - } - } else { - if (returnType == null) { - location.reportSemanticError(MessageFormat.format( - "The external function must have a return type for attribute `prototype({0})''", prototype.getName())); - } else { - if (Assignment_type.A_FUNCTION_RTEMP.equals(assignment_type)) { - returnType.getLocation() - .reportSemanticError( - MessageFormat.format( - "The external function must return a value instead of a template for attribute `prototype({0})''", - prototype.getName())); - } - - if (EncodingPrototype_type.CONVERT.equals(prototype)) { - outputType = returnType; - } else { - IType last = returnType.getTypeRefdLast(timestamp); - - if (!last.getIsErroneous(timestamp) && !Type_type.TYPE_INTEGER.equals(last.getTypetypeTtcn3())) { - returnType.getLocation() - .reportSemanticError( - MessageFormat.format( - "The return type of the function must be `integer'' instead of `{0}'' for attribute `prototype({1})''", - returnType.getTypename(), prototype.getName())); - } - } - } - } - } - - /** - * Checks that the encoding/decoding attributes set for this external - * function definition are valid according to the encoding/decoding type - * of the function. - * - * @param timestamp - * the timestamp of the actual semantic check cycle. - * */ - public void checkFunctionType(final CompilationTimeStamp timestamp) { - switch (functionEncodingType) { - case MANUAL: - if (errorBehaviorList != null) { - errorBehaviorList.getLocation().reportSemanticError( - "Attribute `errorbehavior' can only be used together with `encode' or `decode'"); - errorBehaviorList.check(timestamp); - } - break; - case ENCODE: - switch (prototype) { - case NONE: - location.reportSemanticError("Attribute `encode' cannot be used without `prototype'"); - break; - case BACKTRACK: - case SLIDING: - location.reportSemanticError(MessageFormat.format("Attribute `encode'' cannot be used without `prototype({0})''", - prototype.getName())); - break; - default: - break; - } - // FIXME implement once we know what encoding is set for - // a type - if (errorBehaviorList != null) { - errorBehaviorList.check(timestamp); - } - if (printingType != null) { - printingType.check(timestamp); - } - break; - case DECODE: - if (EncodingPrototype_type.NONE.equals(prototype)) { - location.reportSemanticError("Attribute `decode' cannot be used without `prototype'"); - } - // FIXME implement once we know what encoding is set for - // a type - if (errorBehaviorList != null) { - errorBehaviorList.check(timestamp); - } - break; - default: - // no other option possible - break; - } - - if (printingType != null && (functionEncodingType != ExternalFunctionEncodingType_type.ENCODE || - encodingType != Encoding_type.JSON)) { - location.reportSemanticError("Attribute `printing' is only allowed for JSON encoding functions"); - } - } - - @Override - public String getProposalDescription() { - StringBuilder nameBuilder = new StringBuilder(identifier.getDisplayName()); - nameBuilder.append('('); - formalParList.getAsProposalDesriptionPart(nameBuilder); - nameBuilder.append(')'); - return nameBuilder.toString(); - } - - @Override - public void addProposal(final ProposalCollector propCollector, final int i) { - List<ISubReference> subrefs = propCollector.getReference().getSubreferences(); - if (subrefs.size() <= i || Subreference_type.arraySubReference.equals(subrefs.get(i).getReferenceType())) { - return; - } - - if (subrefs.size() == i + 1 && identifier.getName().toLowerCase().startsWith(subrefs.get(i).getId().getName().toLowerCase())) { - StringBuilder patternBuilder = new StringBuilder(identifier.getDisplayName()); - patternBuilder.append('('); - formalParList.getAsProposalPart(patternBuilder); - patternBuilder.append(')'); - propCollector.addTemplateProposal(identifier.getDisplayName(), - new Template(getProposalDescription(), "", propCollector.getContextIdentifier(), patternBuilder.toString(), - false), TTCN3CodeSkeletons.SKELETON_IMAGE); - super.addProposal(propCollector, i); - } else if (subrefs.size() > i + 1 && returnType != null - && Subreference_type.parameterisedSubReference.equals(subrefs.get(i).getReferenceType()) - && identifier.getName().equals(subrefs.get(i).getId().getName())) { - // perfect match - returnType.addProposal(propCollector, i + 1); - } - } - - @Override - public void addDeclaration(final DeclarationCollector declarationCollector, final int i) { - List<ISubReference> subrefs = declarationCollector.getReference().getSubreferences(); - if (subrefs.size() <= i || Subreference_type.arraySubReference.equals(subrefs.get(i).getReferenceType())) { - return; - } - - if (identifier.getName().equals(subrefs.get(0).getId().getName())) { - if (subrefs.size() > i + 1 && returnType != null) { - returnType.addDeclaration(declarationCollector, i + 1); - } else { - declarationCollector.addDeclaration(this); - } - } - } - - @Override - public String getOutlineText() { - if (lastTimeChecked == null) { - check(CompilationTimeStamp.getBaseTimestamp()); - } - - StringBuilder text = new StringBuilder(identifier.getDisplayName()); - if (formalParList == null) { - return text.toString(); - } - - text.append('('); - for (int i = 0; i < formalParList.getNofParameters(); i++) { - if (i != 0) { - text.append(", "); - } - FormalParameter parameter = formalParList.getParameterByIndex(i); - if (Assignment_type.A_PAR_TIMER.equals(parameter.getRealAssignmentType())) { - text.append("timer"); - } else { - IType type = parameter.getType(lastTimeChecked); - if (type == null) { - text.append("Unknown type"); - } else { - text.append(type.getTypename()); - } - } - } - text.append(')'); - return text.toString(); - } - - @Override - public TemplateRestriction.Restriction_type getTemplateRestriction() { - return template_restriction; - } - - @Override - public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { - if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - - boolean enveloped = false; - - Location temporalIdentifier = identifier.getLocation(); - if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; - reparser.extendDamagedRegion(temporalIdentifier); - IIdentifierReparser r = ParserFactory.createIdentifierReparser(reparser); - int result = r.parseAndSetNameChanged(); - identifier = r.getIdentifier(); - // damage handled - if (result == 0) { - enveloped = true; - } else { - throw new ReParseException(result); - } - } - - if (formalParList != null) { - if (enveloped) { - formalParList.updateSyntax(reparser, false); - reparser.updateLocation(formalParList.getLocation()); - } else if (reparser.envelopsDamage(formalParList.getLocation())) { - formalParList.updateSyntax(reparser, true); - enveloped = true; - reparser.updateLocation(formalParList.getLocation()); - } - } - - if (returnType != null) { - if (enveloped) { - returnType.updateSyntax(reparser, false); - reparser.updateLocation(returnType.getLocation()); - } else if (reparser.envelopsDamage(returnType.getLocation())) { - returnType.updateSyntax(reparser, true); - enveloped = true; - reparser.updateLocation(returnType.getLocation()); - } - } - - if (withAttributesPath != null) { - if (enveloped) { - withAttributesPath.updateSyntax(reparser, false); - reparser.updateLocation(withAttributesPath.getLocation()); - } else if (reparser.envelopsDamage(withAttributesPath.getLocation())) { - withAttributesPath.updateSyntax(reparser, true); - enveloped = true; - reparser.updateLocation(withAttributesPath.getLocation()); - } - } - - if (!enveloped) { - throw new ReParseException(); - } - - return; - } - - reparser.updateLocation(identifier.getLocation()); - - if (formalParList != null) { - formalParList.updateSyntax(reparser, false); - reparser.updateLocation(formalParList.getLocation()); - } - - if (returnType != null) { - returnType.updateSyntax(reparser, false); - reparser.updateLocation(returnType.getLocation()); - } - - if (withAttributesPath != null) { - withAttributesPath.updateSyntax(reparser, false); - reparser.updateLocation(withAttributesPath.getLocation()); - } - } - - @Override - public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - super.findReferences(referenceFinder, foundIdentifiers); - if (formalParList != null) { - formalParList.findReferences(referenceFinder, foundIdentifiers); - } - if (returnType != null) { - returnType.findReferences(referenceFinder, foundIdentifiers); - } - } - - @Override - protected boolean memberAccept(ASTVisitor v) { - if (!super.memberAccept(v)) { - return false; - } - if (formalParList != null && !formalParList.accept(v)) { - return false; - } - if (returnType != null && !returnType.accept(v)) { - return false; - } - return true; - } -} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Function.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Function.java index 8c3b30db2f4a1fba115d469e2504b4bd146228f5..1590da847a9b4e5cbea774a48441546bfce08457 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Function.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Function.java @@ -102,13 +102,13 @@ public final class Def_Function extends Definition implements IParameterisedAssi return KIND; } - private final Assignment_type assignment_type; + private final Assignment_type assignmentType; private final FormalParameterList formalParList; - private final Reference runs_on_ref; + private final Reference runsOnRef; private Component_Type runsOnType = null; private final Type returnType; private final boolean returnsTemplate; - private final TemplateRestriction.Restriction_type template_restriction; + private final TemplateRestriction.Restriction_type templateRestriction; private final StatementBlock block; private EncodingPrototype_type prototype; private Type inputType; @@ -118,21 +118,21 @@ public final class Def_Function extends Definition implements IParameterisedAssi private boolean isStartable; private NamedBridgeScope bridgeScope = null; - public Def_Function(final Identifier identifier, final FormalParameterList formalParameters, final Reference runs_on_ref, - final Type returnType, final boolean returnsTemplate, final TemplateRestriction.Restriction_type template_restriction, + public Def_Function(final Identifier identifier, final FormalParameterList formalParameters, final Reference runsOnRef, + final Type returnType, final boolean returnsTemplate, final TemplateRestriction.Restriction_type templateRestriction, final StatementBlock block) { super(identifier); - assignment_type = (returnType == null) ? Assignment_type.A_FUNCTION : (returnsTemplate ? Assignment_type.A_FUNCTION_RTEMP + assignmentType = (returnType == null) ? Assignment_type.A_FUNCTION : (returnsTemplate ? Assignment_type.A_FUNCTION_RTEMP : Assignment_type.A_FUNCTION_RVAL); this.formalParList = formalParameters; if (formalParList != null) { formalParList.setMyDefinition(this); formalParList.setFullNameParent(this); } - this.runs_on_ref = runs_on_ref; + this.runsOnRef = runsOnRef; this.returnType = returnType; this.returnsTemplate = returnsTemplate; - this.template_restriction = template_restriction; + this.templateRestriction = templateRestriction; this.block = block; this.prototype = EncodingPrototype_type.NONE; @@ -143,8 +143,8 @@ public final class Def_Function extends Definition implements IParameterisedAssi block.setMyDefinition(this); block.setFullNameParent(this); } - if (runs_on_ref != null) { - runs_on_ref.setFullNameParent(this); + if (runsOnRef != null) { + runsOnRef.setFullNameParent(this); } if (returnType != null) { returnType.setFullNameParent(this); @@ -157,14 +157,14 @@ public final class Def_Function extends Definition implements IParameterisedAssi @Override public Assignment_type getAssignmentType() { - return assignment_type; + return assignmentType; } @Override public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (runs_on_ref == child) { + if (runsOnRef == child) { return builder.append(FULLNAMEPART1); } else if (formalParList == child) { return builder.append(FULLNAMEPART2); @@ -234,8 +234,8 @@ public final class Def_Function extends Definition implements IParameterisedAssi bridgeScope.setScopeMacroName(identifier.getDisplayName()); super.setMyScope(bridgeScope); - if (runs_on_ref != null) { - runs_on_ref.setMyScope(bridgeScope); + if (runsOnRef != null) { + runsOnRef.setMyScope(bridgeScope); } formalParList.setMyScope(bridgeScope); if (returnType != null) { @@ -276,8 +276,8 @@ public final class Def_Function extends Definition implements IParameterisedAssi lastTimeChecked = timestamp; isStartable = false; - if (runs_on_ref != null) { - runsOnType = runs_on_ref.chkComponentypeReference(timestamp); + if (runsOnRef != null) { + runsOnType = runsOnRef.chkComponentypeReference(timestamp); if (runsOnType != null) { Scope formalParlistPreviosScope = formalParList.getParentScope(); if (formalParlistPreviosScope instanceof RunsOnScope @@ -320,7 +320,7 @@ public final class Def_Function extends Definition implements IParameterisedAssi } // decision of startability - isStartable = runs_on_ref != null; + isStartable = runsOnRef != null; isStartable &= formalParList.getStartability(); if (isStartable && returnType != null && returnType.isComponentInternal(timestamp)) { isStartable = false; @@ -389,7 +389,7 @@ public final class Def_Function extends Definition implements IParameterisedAssi return true; } - if (runs_on_ref == null) { + if (runsOnRef == null) { errorLocation.reportSemanticError(MessageFormat.format( "Function `{0}'' cannot be started on parallel test component because it does not have a `runs on'' clause", getFullName())); @@ -563,7 +563,7 @@ public final class Def_Function extends Definition implements IParameterisedAssi location.reportSemanticError(MessageFormat.format( "The function must have a return type for attribute `prototype({0})''", prototype.getName())); } else { - if (Assignment_type.A_FUNCTION_RTEMP.equals(assignment_type)) { + if (Assignment_type.A_FUNCTION_RTEMP.equals(assignmentType)) { returnType.getLocation() .reportSemanticError( MessageFormat.format( @@ -588,8 +588,8 @@ public final class Def_Function extends Definition implements IParameterisedAssi } // checking the runs on clause - if (runsOnType != null && runs_on_ref != null) { - runs_on_ref.getLocation().reportSemanticError( + if (runsOnType != null && runsOnRef != null) { + runsOnRef.getLocation().reportSemanticError( MessageFormat.format("The function cannot have `runs on'' clause for attribute `prototype({0})''", prototype.getName())); } @@ -686,19 +686,16 @@ public final class Def_Function extends Definition implements IParameterisedAssi @Override public TemplateRestriction.Restriction_type getTemplateRestriction() { - return template_restriction; + return templateRestriction; } @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); @@ -706,7 +703,6 @@ public final class Def_Function extends Definition implements IParameterisedAssi // damage handled if (result == 0) { enveloped = true; - reparser.moduleToBeReanalysed.addAll(referingHere); } else { removeBridge(); throw new ReParseException(result); @@ -722,7 +718,6 @@ public final class Def_Function extends Definition implements IParameterisedAssi formalParList.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(formalParList.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -730,16 +725,15 @@ public final class Def_Function extends Definition implements IParameterisedAssi } } - if (runs_on_ref != null) { + if (runsOnRef != null) { if (enveloped) { - runs_on_ref.updateSyntax(reparser, false); - reparser.updateLocation(runs_on_ref.getLocation()); - } else if (reparser.envelopsDamage(runs_on_ref.getLocation())) { + runsOnRef.updateSyntax(reparser, false); + reparser.updateLocation(runsOnRef.getLocation()); + } else if (reparser.envelopsDamage(runsOnRef.getLocation())) { try { - runs_on_ref.updateSyntax(reparser, true); + runsOnRef.updateSyntax(reparser, true); enveloped = true; - reparser.updateLocation(runs_on_ref.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); + reparser.updateLocation(runsOnRef.getLocation()); } catch (ReParseException e) { removeBridge(); throw e; @@ -756,7 +750,6 @@ public final class Def_Function extends Definition implements IParameterisedAssi returnType.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(returnType.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -789,7 +782,6 @@ public final class Def_Function extends Definition implements IParameterisedAssi withAttributesPath.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(withAttributesPath.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -812,9 +804,9 @@ public final class Def_Function extends Definition implements IParameterisedAssi reparser.updateLocation(formalParList.getLocation()); } - if (runs_on_ref != null) { - runs_on_ref.updateSyntax(reparser, false); - reparser.updateLocation(runs_on_ref.getLocation()); + if (runsOnRef != null) { + runsOnRef.updateSyntax(reparser, false); + reparser.updateLocation(runsOnRef.getLocation()); } if (returnType != null) { @@ -852,8 +844,8 @@ public final class Def_Function extends Definition implements IParameterisedAssi if (returnType != null) { returnType.findReferences(referenceFinder, foundIdentifiers); } - if (runs_on_ref != null) { - runs_on_ref.findReferences(referenceFinder, foundIdentifiers); + if (runsOnRef != null) { + runsOnRef.findReferences(referenceFinder, foundIdentifiers); } if (block != null) { block.findReferences(referenceFinder, foundIdentifiers); @@ -871,7 +863,7 @@ public final class Def_Function extends Definition implements IParameterisedAssi if (returnType != null && !returnType.accept(v)) { return false; } - if (runs_on_ref != null && !runs_on_ref.accept(v)) { + if (runsOnRef != null && !runsOnRef.accept(v)) { return false; } if (block != null && !block.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar.java index 429f89828a8748baebe10a74c41a48c43be12306..2f7e3792ac7e3d8df3fda27d2e6aacf0f10199e5 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar.java @@ -56,18 +56,18 @@ public final class Def_ModulePar extends Definition { } private final Type type; - private final Value default_value; + private final Value defaultValue; - public Def_ModulePar(final Identifier identifier, final Type type, final Value default_value) { + public Def_ModulePar(final Identifier identifier, final Type type, final Value defaultValue) { super(identifier); this.type = type; - this.default_value = default_value; + this.defaultValue = defaultValue; if (type != null) { type.setFullNameParent(this); } - if (default_value != null) { - default_value.setFullNameParent(this); + if (defaultValue != null) { + defaultValue.setFullNameParent(this); } } @@ -77,7 +77,7 @@ public final class Def_ModulePar extends Definition { } public Value getDefaultValue() { - return default_value; + return defaultValue; } @@ -87,7 +87,7 @@ public final class Def_ModulePar extends Definition { if (type == child) { return builder.append(FULLNAMEPART1); - } else if (default_value == child) { + } else if (defaultValue == child) { return builder.append(FULLNAMEPART2); } @@ -100,8 +100,8 @@ public final class Def_ModulePar extends Definition { if (type != null) { type.setMyScope(scope); } - if (default_value != null) { - default_value.setMyScope(scope); + if (defaultValue != null) { + defaultValue.setMyScope(scope); } } @@ -175,9 +175,9 @@ public final class Def_ModulePar extends Definition { break; } - if (default_value != null) { - default_value.setMyGovernor(type); - IValue temporalValue = type.checkThisValueRef(timestamp, default_value); + if (defaultValue != null) { + defaultValue.setMyGovernor(type); + IValue temporalValue = type.checkThisValueRef(timestamp, defaultValue); type.checkThisValue(timestamp, temporalValue, new ValueCheckingOptions(Expected_Value_type.EXPECTED_CONSTANT, true, false, true, hasImplicitOmitAttribute(timestamp), false)); } @@ -238,12 +238,10 @@ public final class Def_ModulePar extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); @@ -251,7 +249,6 @@ public final class Def_ModulePar extends Definition { // damage handled if (result == 0) { enveloped = true; - reparser.moduleToBeReanalysed.addAll(referingHere); } else { throw new ReParseException(result); } @@ -265,18 +262,17 @@ public final class Def_ModulePar extends Definition { type.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(type.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } } - if (default_value != null) { + if (defaultValue != null) { if (enveloped) { - default_value.updateSyntax(reparser, false); - reparser.updateLocation(default_value.getLocation()); - } else if (reparser.envelopsDamage(default_value.getLocation())) { - default_value.updateSyntax(reparser, true); + defaultValue.updateSyntax(reparser, false); + reparser.updateLocation(defaultValue.getLocation()); + } else if (reparser.envelopsDamage(defaultValue.getLocation())) { + defaultValue.updateSyntax(reparser, true); enveloped = true; - reparser.updateLocation(default_value.getLocation()); + reparser.updateLocation(defaultValue.getLocation()); } } @@ -288,7 +284,6 @@ public final class Def_ModulePar extends Definition { withAttributesPath.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(withAttributesPath.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } } @@ -306,9 +301,9 @@ public final class Def_ModulePar extends Definition { reparser.updateLocation(type.getLocation()); } - if (default_value != null) { - default_value.updateSyntax(reparser, false); - reparser.updateLocation(default_value.getLocation()); + if (defaultValue != null) { + defaultValue.updateSyntax(reparser, false); + reparser.updateLocation(defaultValue.getLocation()); } if (withAttributesPath != null) { @@ -323,8 +318,8 @@ public final class Def_ModulePar extends Definition { if (type != null) { type.findReferences(referenceFinder, foundIdentifiers); } - if (default_value != null) { - default_value.findReferences(referenceFinder, foundIdentifiers); + if (defaultValue != null) { + defaultValue.findReferences(referenceFinder, foundIdentifiers); } } @@ -336,7 +331,7 @@ public final class Def_ModulePar extends Definition { if (type != null && !type.accept(v)) { return false; } - if (default_value != null && !default_value.accept(v)) { + if (defaultValue != null && !defaultValue.accept(v)) { return false; } return true; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar_Template.java index c4481d19bf1282c9cc0495283eba39208db37bce..e3545172c4a386156633e1c4c979f2abfd84e687 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_ModulePar_Template.java @@ -54,15 +54,15 @@ public final class Def_ModulePar_Template extends Definition { private final TTCN3Template defaultTemplate; private ITTCN3Template realTemplate; - public Def_ModulePar_Template(final Identifier identifier, final Type type, final TTCN3Template default_template) { + public Def_ModulePar_Template(final Identifier identifier, final Type type, final TTCN3Template defaultTemplate) { super(identifier); this.type = type; - this.defaultTemplate = default_template; + this.defaultTemplate = defaultTemplate; if (type != null) { type.setFullNameParent(this); } - if (default_template != null) { - default_template.setFullNameParent(this); + if (defaultTemplate != null) { + defaultTemplate.setFullNameParent(this); } } @@ -246,12 +246,10 @@ public final class Def_ModulePar_Template extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); @@ -259,7 +257,6 @@ public final class Def_ModulePar_Template extends Definition { // damage handled if (result == 0) { enveloped = true; - reparser.moduleToBeReanalysed.addAll(referingHere); } else { throw new ReParseException(result); } @@ -273,7 +270,6 @@ public final class Def_ModulePar_Template extends Definition { type.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(type.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } } @@ -296,7 +292,6 @@ public final class Def_ModulePar_Template extends Definition { withAttributesPath.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(withAttributesPath.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Port.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Port.java index af7e30752fe0930f35fc437cffa8513667d4eec7..198ad06caa1e876ff32f8bda3a95cac9d565a9ab 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Port.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Port.java @@ -254,14 +254,10 @@ public final class Def_Port extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Template.java index 609fe743785b353d785bad8a43f8e760488ace29..c7a0cba482e47d5bb368f3f29ef0a5ef7ae47a46 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Template.java @@ -83,7 +83,7 @@ public final class Def_Template extends Definition implements IParameterisedAssi private final Type type; - private final TemplateRestriction.Restriction_type template_restriction; + private final TemplateRestriction.Restriction_type templateRestriction; /** * The formal parameter list. Can be null, in that case this template is @@ -115,13 +115,13 @@ public final class Def_Template extends Definition implements IParameterisedAssi private CompilationTimeStamp recursiveDerivationChecked; private NamedBridgeScope bridgeScope = null; - public Def_Template(final TemplateRestriction.Restriction_type template_restriction, final Identifier identifier, final Type type, - final FormalParameterList formalParList, final Reference derived_reference, final TTCN3Template body) { + public Def_Template(final TemplateRestriction.Restriction_type templateRestriction, final Identifier identifier, final Type type, + final FormalParameterList formalParList, final Reference derivedReference, final TTCN3Template body) { super(identifier); - this.template_restriction = template_restriction; + this.templateRestriction = templateRestriction; this.type = type; this.formalParList = formalParList; - this.derivedReference = derived_reference; + this.derivedReference = derivedReference; this.body = body; if (type != null) { @@ -130,8 +130,8 @@ public final class Def_Template extends Definition implements IParameterisedAssi if (formalParList != null) { formalParList.setMyDefinition(this); } - if (derived_reference != null) { - derived_reference.setFullNameParent(this); + if (derivedReference != null) { + derivedReference.setFullNameParent(this); } if (body != null) { body.setFullNameParent(this); @@ -375,9 +375,9 @@ public final class Def_Template extends Definition implements IParameterisedAssi tempBody.checkRecursions(timestamp, tempReferenceChain); tempReferenceChain.release(); - if (template_restriction != TemplateRestriction.Restriction_type.TR_NONE) { + if (templateRestriction != TemplateRestriction.Restriction_type.TR_NONE) { TemplateRestriction.check(timestamp, this, tempBody, null); - if (formalParList != null && template_restriction != TemplateRestriction.Restriction_type.TR_PRESENT) { + if (formalParList != null && templateRestriction != TemplateRestriction.Restriction_type.TR_PRESENT) { int nofFps = formalParList.getNofParameters(); for (int i = 0; i < nofFps; i++) { FormalParameter fp = formalParList.getParameterByIndex(i); @@ -389,7 +389,7 @@ public final class Def_Template extends Definition implements IParameterisedAssi continue; } TemplateRestriction.Restriction_type fpTemplateRestriction = fp.getTemplateRestriction(); - switch (template_restriction) { + switch (templateRestriction) { case TR_VALUE: case TR_OMIT: switch (fpTemplateRestriction) { @@ -633,20 +633,16 @@ public final class Def_Template extends Definition implements IParameterisedAssi @Override public TemplateRestriction.Restriction_type getTemplateRestriction() { - return template_restriction; + return templateRestriction; } @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Testcase.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Testcase.java index ca84db01ab475cba30062ac891229e3666ba5a4d..5b4ba852c5ce3b61d5d3e5310120ed99c774d23f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Testcase.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Testcase.java @@ -67,15 +67,15 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi private final StatementBlock block; private NamedBridgeScope bridgeScope = null; - public Def_Testcase(final Identifier identifier, final FormalParameterList formalParameters, final Reference runs_on_ref, - final Reference system_ref, final StatementBlock block) { + public Def_Testcase(final Identifier identifier, final FormalParameterList formalParameters, final Reference runsOnRef, + final Reference systemRef, final StatementBlock block) { super(identifier); this.formalParList = formalParameters; if (formalParList != null) { formalParList.setMyDefinition(this); } - this.runsOnReference = runs_on_ref; - this.systemReference = system_ref; + this.runsOnReference = runsOnRef; + this.systemReference = systemRef; this.block = block; if (block != null) { block.setMyDefinition(this); @@ -85,11 +85,11 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi if (formalParList != null) { formalParList.setFullNameParent(this); } - if (runs_on_ref != null) { - runs_on_ref.setFullNameParent(this); + if (runsOnRef != null) { + runsOnRef.setFullNameParent(this); } - if (system_ref != null) { - system_ref.setFullNameParent(this); + if (systemRef != null) { + systemRef.setFullNameParent(this); } } @@ -344,14 +344,11 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; int result = 1; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); result = r.parseAndSetNameChanged(); @@ -359,7 +356,6 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi // damage handled if (result == 0) { enveloped = true; - reparser.moduleToBeReanalysed.addAll(referingHere); } else { removeBridge(); throw new ReParseException(result); @@ -375,7 +371,6 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi formalParList.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(formalParList.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -392,7 +387,6 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi runsOnReference.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(runsOnReference.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -409,7 +403,6 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi systemReference.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(systemReference.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; @@ -442,7 +435,6 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi withAttributesPath.updateSyntax(reparser, true); enveloped = true; reparser.updateLocation(withAttributesPath.getLocation()); - reparser.moduleToBeReanalysed.addAll(referingHere); } catch (ReParseException e) { removeBridge(); throw e; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Timer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Timer.java index c0f3ac8288cd7b413d8c43d23514323ca0af5e07..25a61e6f2d45beaf46ef4ac3cafc7591dcfdf389 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Timer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Timer.java @@ -58,18 +58,18 @@ public final class Def_Timer extends Definition { private static final String KIND = "timer"; private final ArrayDimensions dimensions; - private final Value default_duration; + private final Value defaultDuration; - public Def_Timer(final Identifier identifier, final ArrayDimensions dimensions, final Value default_duration) { + public Def_Timer(final Identifier identifier, final ArrayDimensions dimensions, final Value defaultDuration) { super(identifier); this.dimensions = dimensions; - this.default_duration = default_duration; + this.defaultDuration = defaultDuration; if (dimensions != null) { dimensions.setFullNameParent(this); } - if (default_duration != null) { - default_duration.setFullNameParent(this); + if (defaultDuration != null) { + defaultDuration.setFullNameParent(this); } } @@ -84,8 +84,8 @@ public final class Def_Timer extends Definition { if (dimensions != null) { dimensions.setMyScope(scope); } - if (default_duration != null) { - default_duration.setMyScope(scope); + if (defaultDuration != null) { + defaultDuration.setMyScope(scope); } } @@ -95,7 +95,7 @@ public final class Def_Timer extends Definition { if (dimensions == child) { return builder.append(FULLNAMEPART1); - } else if (default_duration == child) { + } else if (defaultDuration == child) { return builder.append(FULLNAMEPART2); } @@ -149,13 +149,13 @@ public final class Def_Timer extends Definition { * @return true if the timer has a default duration, false otherwise. * */ public boolean hasDefaultDuration(final CompilationTimeStamp timestamp, final Reference reference) { - if (default_duration == null) { + if (defaultDuration == null) { return false; } else if (dimensions == null || reference == null) { return true; } - IValue v = default_duration; + IValue v = defaultDuration; List<ISubReference> subreferences = reference.getSubreferences(); int nofDimensions = dimensions.size(); int nofReferences = subreferences.size() - 1; @@ -203,25 +203,25 @@ public final class Def_Timer extends Definition { dimensions.check(timestamp); } - if (default_duration != null) { + if (defaultDuration != null) { if (dimensions == null) { - default_duration.setLoweridToReference(timestamp); - Type_type tempType = default_duration.getExpressionReturntype(timestamp, + defaultDuration.setLoweridToReference(timestamp); + Type_type tempType = defaultDuration.getExpressionReturntype(timestamp, isLocal() ? Expected_Value_type.EXPECTED_DYNAMIC_VALUE : Expected_Value_type.EXPECTED_STATIC_VALUE); switch (tempType) { case TYPE_REAL: - IValue last = default_duration.getValueRefdLast(timestamp, null); + IValue last = defaultDuration.getValueRefdLast(timestamp, null); if (!last.isUnfoldable(timestamp)) { Real_Value real = (Real_Value) last; double value = real.getValue(); if (value < 0.0f) { - default_duration.getLocation().reportSemanticError( + defaultDuration.getLocation().reportSemanticError( MessageFormat.format(NEGATIVDURATIONERROR, value)); } else if (real.isPositiveInfinity()) { final String message = MessageFormat.format(INFINITYDURATIONERROR, real.createStringRepresentation()); - default_duration.getLocation() + defaultDuration.getLocation() .reportSemanticError(message ); } @@ -233,7 +233,7 @@ public final class Def_Timer extends Definition { location.reportSemanticError(OPERANDERROR); } } else { - checkArrayDuration(default_duration, 0); + checkArrayDuration(defaultDuration, 0); } } @@ -245,7 +245,7 @@ public final class Def_Timer extends Definition { lastTimeChecked = timestamp; } - private void checkArrayDuration(final IValue duration, final int start_dimension) { + private void checkArrayDuration(final IValue duration, final int startDimension) { // FIXME implement support for dimension handling } @@ -283,22 +283,22 @@ public final class Def_Timer extends Definition { return false; } - if (default_duration != null) { - if (otherTimer.default_duration != null) { - if (!default_duration.isUnfoldable(timestamp) && !otherTimer.default_duration.isUnfoldable(timestamp) - && !default_duration.checkEquality(timestamp, otherTimer.default_duration)) { + if (defaultDuration != null) { + if (otherTimer.defaultDuration != null) { + if (!defaultDuration.isUnfoldable(timestamp) && !otherTimer.defaultDuration.isUnfoldable(timestamp) + && !defaultDuration.checkEquality(timestamp, otherTimer.defaultDuration)) { final String message = MessageFormat .format("Local timer `{0}'' and the timer inherited from component type `{1}'' have different default durations", identifier.getDisplayName(), otherTimer.getMyScope().getFullName()); - default_duration.getLocation().reportSemanticWarning(message); + defaultDuration.getLocation().reportSemanticWarning(message); } } else { final String message = MessageFormat .format("Local timer `{0}'' has default duration, but the timer inherited from component type `{1}'' does not", identifier.getDisplayName(), otherTimer.getMyScope().getFullName()); - default_duration.getLocation().reportSemanticWarning(message); + defaultDuration.getLocation().reportSemanticWarning(message); } - } else if (otherTimer.default_duration != null) { + } else if (otherTimer.defaultDuration != null) { location.reportSemanticWarning(MessageFormat.format( "Local timer `{0}'' does not have default duration, but the timer inherited from component type `{1}'' has", identifier.getDisplayName(), otherTimer.getMyScope().getFullName())); @@ -337,13 +337,9 @@ public final class Def_Timer extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - int result = 1; Location tempIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(tempIdentifier) || reparser.isExtending(tempIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(tempIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); result = r.parseAndSetNameChanged(); @@ -356,9 +352,9 @@ public final class Def_Timer extends Definition { dimensions.updateSyntax(reparser, false); } - if (default_duration != null) { - default_duration.updateSyntax(reparser, false); - reparser.updateLocation(default_duration.getLocation()); + if (defaultDuration != null) { + defaultDuration.updateSyntax(reparser, false); + reparser.updateLocation(defaultDuration.getLocation()); } if (withAttributesPath != null) { @@ -377,9 +373,9 @@ public final class Def_Timer extends Definition { dimensions.updateSyntax(reparser, false); } - if (default_duration != null) { - default_duration.updateSyntax(reparser, false); - reparser.updateLocation(default_duration.getLocation()); + if (defaultDuration != null) { + defaultDuration.updateSyntax(reparser, false); + reparser.updateLocation(defaultDuration.getLocation()); } if (withAttributesPath != null) { @@ -394,8 +390,8 @@ public final class Def_Timer extends Definition { if (dimensions != null) { dimensions.findReferences(referenceFinder, foundIdentifiers); } - if (default_duration != null) { - default_duration.findReferences(referenceFinder, foundIdentifiers); + if (defaultDuration != null) { + defaultDuration.findReferences(referenceFinder, foundIdentifiers); } } @@ -407,7 +403,7 @@ public final class Def_Timer extends Definition { if (dimensions != null && !dimensions.accept(v)) { return false; } - if (default_duration != null && !default_duration.accept(v)) { + if (defaultDuration != null && !defaultDuration.accept(v)) { return false; } return true; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Type.java index a456d41deb32836711c24e06e82421289ead5130..925ecb4e679e1e0ac88d932975d9ab5e6f651816 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Type.java @@ -367,13 +367,10 @@ public final class Def_Type extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var.java index e8df06e5f88b083da79836fb7a17b4d4539c7177..0b0121d447cde5f146929cd8ce10816d5bede783 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var.java @@ -55,20 +55,20 @@ public final class Def_Var extends Definition { private static final String KIND = " variable definition"; private final Type type; - private final Value initial_value; + private final Value initialValue; private boolean wasAssigned; - public Def_Var(final Identifier identifier, final Type type, final Value initial_value) { + public Def_Var(final Identifier identifier, final Type type, final Value initialValue) { super(identifier); this.type = type; - this.initial_value = initial_value; + this.initialValue = initialValue; if (type != null) { type.setFullNameParent(this); } - if (initial_value != null) { - initial_value.setFullNameParent(this); + if (initialValue != null) { + initialValue.setFullNameParent(this); } } @@ -83,7 +83,7 @@ public final class Def_Var extends Definition { if (type == child) { return builder.append(FULLNAMEPART1); - } else if (initial_value == child) { + } else if (initialValue == child) { return builder.append(FULLNAMEPART2); } @@ -96,8 +96,8 @@ public final class Def_Var extends Definition { if (type != null) { type.setMyScope(scope); } - if (initial_value != null) { - initial_value.setMyScope(scope); + if (initialValue != null) { + initialValue.setMyScope(scope); } } @@ -143,7 +143,7 @@ public final class Def_Var extends Definition { } public Value getInitialValue() { - return initial_value; + return initialValue; } @Override @@ -192,9 +192,9 @@ public final class Def_Var extends Definition { break; } - if (initial_value != null) { - initial_value.setMyGovernor(type); - IValue temporalValue = type.checkThisValueRef(timestamp, initial_value); + if (initialValue != null) { + initialValue.setMyGovernor(type); + IValue temporalValue = type.checkThisValueRef(timestamp, initialValue); if (isLocal()) { type.checkThisValue(timestamp, temporalValue, new ValueCheckingOptions(Expected_Value_type.EXPECTED_DYNAMIC_VALUE, true, false, true, false, false)); @@ -209,7 +209,7 @@ public final class Def_Var extends Definition { public void postCheck() { super.postCheck(); if (!wasAssigned) { - if (initial_value != null && !initial_value.getIsErroneous(lastTimeChecked) && !initial_value.isUnfoldable(lastTimeChecked)) { + if (initialValue != null && !initialValue.getIsErroneous(lastTimeChecked) && !initialValue.isUnfoldable(lastTimeChecked)) { final String message = MessageFormat.format("The {0} seems to be never written, maybe it could be a constant", getDescription()); final String option = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, @@ -249,23 +249,23 @@ public final class Def_Var extends Definition { return false; } - if (initial_value != null) { - if (otherVariable.initial_value != null) { - if (!initial_value.isUnfoldable(timestamp) && !otherVariable.initial_value.isUnfoldable(timestamp) - && !initial_value.checkEquality(timestamp, otherVariable.initial_value)) { + if (initialValue != null) { + if (otherVariable.initialValue != null) { + if (!initialValue.isUnfoldable(timestamp) && !otherVariable.initialValue.isUnfoldable(timestamp) + && !initialValue.checkEquality(timestamp, otherVariable.initialValue)) { final String message = MessageFormat .format("Local variable `{0}'' and the variable inherited from component type `{1}'' have different values", identifier.getDisplayName(), otherVariable.getMyScope().getFullName()); - initial_value.getLocation().reportSemanticWarning(message); + initialValue.getLocation().reportSemanticWarning(message); } } else { - initial_value.getLocation() + initialValue.getLocation() .reportSemanticWarning( MessageFormat.format( "Local variable `{0}'' has initial value, but the variable inherited from component type `{1}'' does not", identifier.getDisplayName(), otherVariable.getMyScope().getFullName())); } - } else if (otherVariable.initial_value != null) { + } else if (otherVariable.initialValue != null) { location.reportSemanticWarning(MessageFormat .format("Local variable `{0}'' does not have initial value, but the variable inherited from component type `{1}'' has", identifier.getDisplayName(), otherVariable.getMyScope().getFullName())); @@ -314,15 +314,11 @@ public final class Def_Var extends Definition { @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; int result = 1; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); result = r.parseAndSetNameChanged(); @@ -346,14 +342,14 @@ public final class Def_Var extends Definition { } } - if (initial_value != null) { + if (initialValue != null) { if (enveloped) { - initial_value.updateSyntax(reparser, false); - reparser.updateLocation(initial_value.getLocation()); - } else if (reparser.envelopsDamage(initial_value.getLocation())) { - initial_value.updateSyntax(reparser, true); + initialValue.updateSyntax(reparser, false); + reparser.updateLocation(initialValue.getLocation()); + } else if (reparser.envelopsDamage(initialValue.getLocation())) { + initialValue.updateSyntax(reparser, true); enveloped = true; - reparser.updateLocation(initial_value.getLocation()); + reparser.updateLocation(initialValue.getLocation()); } } @@ -370,9 +366,9 @@ public final class Def_Var extends Definition { reparser.updateLocation(type.getLocation()); } - if (initial_value != null) { - initial_value.updateSyntax(reparser, false); - reparser.updateLocation(initial_value.getLocation()); + if (initialValue != null) { + initialValue.updateSyntax(reparser, false); + reparser.updateLocation(initialValue.getLocation()); } } @@ -382,8 +378,8 @@ public final class Def_Var extends Definition { if (type != null) { type.findReferences(referenceFinder, foundIdentifiers); } - if (initial_value != null) { - initial_value.findReferences(referenceFinder, foundIdentifiers); + if (initialValue != null) { + initialValue.findReferences(referenceFinder, foundIdentifiers); } } @@ -395,7 +391,7 @@ public final class Def_Var extends Definition { if (type != null && !type.accept(v)) { return false; } - if (initial_value != null && !initial_value.accept(v)) { + if (initialValue != null && !initialValue.accept(v)) { return false; } return true; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var_Template.java index 237236f387f6cf97f37e7223013e56c9472cbcbb..4abb908709059d23a03b809cf4a432ca6488456c 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Def_Var_Template.java @@ -51,23 +51,23 @@ public final class Def_Var_Template extends Definition { private static final String KIND = " template variable definition"; private final Type type; - private final TTCN3Template initial_value; - private final TemplateRestriction.Restriction_type template_restriction; + private final TTCN3Template initialValue; + private final TemplateRestriction.Restriction_type templateRestriction; private boolean wasAssigned; - public Def_Var_Template(final TemplateRestriction.Restriction_type template_restriction, final Identifier identifier, final Type type, - final TTCN3Template initial_value) { + public Def_Var_Template(final TemplateRestriction.Restriction_type templateRestriction, final Identifier identifier, final Type type, + final TTCN3Template initialValue) { super(identifier); - this.template_restriction = template_restriction; + this.templateRestriction = templateRestriction; this.type = type; - this.initial_value = initial_value; + this.initialValue = initialValue; if (type != null) { type.setFullNameParent(this); } - if (initial_value != null) { - initial_value.setFullNameParent(this); + if (initialValue != null) { + initialValue.setFullNameParent(this); } } @@ -82,7 +82,7 @@ public final class Def_Var_Template extends Definition { if (type == child) { return builder.append(FULLNAMEPART1); - } else if (initial_value == child) { + } else if (initialValue == child) { return builder.append(FULLNAMEPART2); } @@ -129,8 +129,8 @@ public final class Def_Var_Template extends Definition { if (type != null) { type.setMyScope(scope); } - if (initial_value != null) { - initial_value.setMyScope(scope); + if (initialValue != null) { + initialValue.setMyScope(scope); } } @@ -161,7 +161,7 @@ public final class Def_Var_Template extends Definition { type.check(timestamp); lastTimeChecked = timestamp; - if (initial_value == null) { + if (initialValue == null) { return; } @@ -174,20 +174,20 @@ public final class Def_Var_Template extends Definition { break; } - TTCN3Template realInitialValue = initial_value; + TTCN3Template realInitialValue = initialValue; - initial_value.setMyGovernor(type); + initialValue.setMyGovernor(type); // Needed in case of universal charstring templates - if (initial_value.getTemplatetype() == Template_type.CSTR_PATTERN && lastType.getTypetype() == Type.Type_type.TYPE_UCHARSTRING) { - realInitialValue = initial_value.setTemplatetype(timestamp, Template_type.USTR_PATTERN); + if (initialValue.getTemplatetype() == Template_type.CSTR_PATTERN && lastType.getTypetype() == Type.Type_type.TYPE_UCHARSTRING) { + realInitialValue = initialValue.setTemplatetype(timestamp, Template_type.USTR_PATTERN); // FIXME implement setting the pattern type, once // universal charstring pattern are supported. } ITTCN3Template temporalValue = type.checkThisTemplateRef(timestamp, realInitialValue); temporalValue.checkThisTemplateGeneric(timestamp, type, true, true, true, true, false); - TemplateRestriction.check(timestamp, this, initial_value, null); + TemplateRestriction.check(timestamp, this, initialValue, null); // Only to follow the pattern, otherwise no such field can exist // here @@ -209,7 +209,7 @@ public final class Def_Var_Template extends Definition { } public TTCN3Template getInitialValue() { - return initial_value; + return initialValue; } /** @@ -243,15 +243,15 @@ public final class Def_Var_Template extends Definition { return false; } - if (initial_value != null) { - if (otherVariable.initial_value == null) { - initial_value.getLocation() + if (initialValue != null) { + if (otherVariable.initialValue == null) { + initialValue.getLocation() .reportSemanticWarning( MessageFormat.format( "Local template variable `{0}'' has initial value, but the template variable inherited from component type `{1}'' does not", identifier.getDisplayName(), otherVariable.getMyScope().getFullName())); } - } else if (otherVariable.initial_value != null) { + } else if (otherVariable.initialValue != null) { location.reportSemanticWarning(MessageFormat .format("Local template variable `{0}'' does not have initial value, but the template variable inherited from component type `{1}'' has", identifier.getDisplayName(), otherVariable.getMyScope().getFullName())); @@ -300,20 +300,16 @@ public final class Def_Var_Template extends Definition { @Override public TemplateRestriction.Restriction_type getTemplateRestriction() { - return template_restriction; + return templateRestriction; } @Override public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException { if (isDamaged) { - reparser.moduleToBeReanalysed.addAll(referingHere); - reparser.moduleToBeReanalysed.add(getMyScope().getModuleScope().getName()); - boolean enveloped = false; Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parseAndSetNameChanged(); @@ -337,14 +333,14 @@ public final class Def_Var_Template extends Definition { } } - if (initial_value != null) { + if (initialValue != null) { if (enveloped) { - initial_value.updateSyntax(reparser, false); - reparser.updateLocation(initial_value.getLocation()); - } else if (reparser.envelopsDamage(initial_value.getLocation())) { - initial_value.updateSyntax(reparser, true); + initialValue.updateSyntax(reparser, false); + reparser.updateLocation(initialValue.getLocation()); + } else if (reparser.envelopsDamage(initialValue.getLocation())) { + initialValue.updateSyntax(reparser, true); enveloped = true; - reparser.updateLocation(initial_value.getLocation()); + reparser.updateLocation(initialValue.getLocation()); } } @@ -372,9 +368,9 @@ public final class Def_Var_Template extends Definition { reparser.updateLocation(type.getLocation()); } - if (initial_value != null) { - initial_value.updateSyntax(reparser, false); - reparser.updateLocation(initial_value.getLocation()); + if (initialValue != null) { + initialValue.updateSyntax(reparser, false); + reparser.updateLocation(initialValue.getLocation()); } if (withAttributesPath != null) { @@ -389,8 +385,8 @@ public final class Def_Var_Template extends Definition { if (type != null) { type.findReferences(referenceFinder, foundIdentifiers); } - if (initial_value != null) { - initial_value.findReferences(referenceFinder, foundIdentifiers); + if (initialValue != null) { + initialValue.findReferences(referenceFinder, foundIdentifiers); } } @@ -402,7 +398,7 @@ public final class Def_Var_Template extends Definition { if (type != null && !type.accept(v)) { return false; } - if (initial_value != null && !initial_value.accept(v)) { + if (initialValue != null && !initialValue.accept(v)) { return false; } return true; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Default_ActualParameter.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Default_ActualParameter.java index 5e853dd053daa3f1f2d8f07ef208d7332b4611e3..4cffb5e1da6d27288b87812466d68c2f57e5782f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Default_ActualParameter.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Default_ActualParameter.java @@ -22,10 +22,10 @@ import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; * */ public final class Default_ActualParameter extends ActualParameter { // generated value - private final ActualParameter default_actualParameter; + private final ActualParameter defaultActualParameter; - public Default_ActualParameter(final ActualParameter default_actualParameter) { - this.default_actualParameter = default_actualParameter; + public Default_ActualParameter(final ActualParameter defaultActualParameter) { + this.defaultActualParameter = defaultActualParameter; } @Override @@ -34,14 +34,14 @@ public final class Default_ActualParameter extends ActualParameter { } public ActualParameter getActualParameter() { - return default_actualParameter; + return defaultActualParameter; } @Override public void checkRecursions(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) { - if (default_actualParameter != null) { + if (defaultActualParameter != null) { referenceChain.markState(); - default_actualParameter.checkRecursions(timestamp, referenceChain); + defaultActualParameter.checkRecursions(timestamp, referenceChain); referenceChain.previousState(); } } @@ -55,8 +55,8 @@ public final class Default_ActualParameter extends ActualParameter { @Override protected boolean memberAccept(ASTVisitor v) { - if (default_actualParameter != null) { - if (!default_actualParameter.accept(v)) { + if (defaultActualParameter != null) { + if (!defaultActualParameter.accept(v)) { return false; } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definition.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definition.java index a3ecd05ca6dca620da6be5bcc6724677de1413bd..c7975bef51b3eefca538fe0a66fd5dc74cc9ed83 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definition.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definition.java @@ -32,7 +32,6 @@ import org.eclipse.titan.designer.GeneralConstants; import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.Assignment; import org.eclipse.titan.designer.AST.FieldSubReference; -import org.eclipse.titan.designer.AST.IReferencingElement; import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Location; @@ -56,7 +55,6 @@ import org.eclipse.titan.designer.AST.TTCN3.attributes.SingleWithAttribute; import org.eclipse.titan.designer.AST.TTCN3.attributes.SingleWithAttribute.Attribute_Type; import org.eclipse.titan.designer.AST.TTCN3.attributes.WithAttributesPath; import org.eclipse.titan.designer.AST.TTCN3.statements.StatementBlock; -import org.eclipse.titan.designer.declarationsearch.Declaration; import org.eclipse.titan.designer.editors.DeclarationCollector; import org.eclipse.titan.designer.editors.ProposalCollector; import org.eclipse.titan.designer.graphics.ImageCache; @@ -75,7 +73,7 @@ import org.eclipse.titan.designer.productUtilities.ProductConstants; * * @author Kristof Szabados * */ -public abstract class Definition extends Assignment implements IAppendableSyntax, IIncrementallyUpdateable, IReferencingElement { +public abstract class Definition extends Assignment implements IAppendableSyntax, IIncrementallyUpdateable { private static final String SHOULD_BE_PRIVATE = "{0} is referenced only locally, it should be private"; protected WithAttributesPath withAttributesPath = null; @@ -86,6 +84,7 @@ public abstract class Definition extends Assignment implements IAppendableSyntax private Location commentLocation = null; + //TODO this should be removed as the same functionality is present in Titanium as codesmell. public List<String> referingHere = new ArrayList<String>(); private static boolean markOccurrences; @@ -323,42 +322,6 @@ public abstract class Definition extends Assignment implements IAppendableSyntax typeArray = new ArrayList<IType>(); boolean validIndexes = definitionType.getSubrefsAsArray(timestamp, reference, 1, subrefsArray, typeArray); - /* - * // debug - * stuff - * StringBuilder - * sb = new - * StringBuilder - * (); - * sb.append( - * '['); for - * (IType t: - * type_array) { - * if - * (sb.length( - * )>1) - * sb.append - * (','); - * sb.append - * (t.get_typename - * ()); } - * sb.append - * (']'); - * actual_qualifier - * . - * getLocation() - * . - * reportSemanticWarning - * ( - * "subrefs_array = " - * + - * subrefs_array - * .toString()+ - * " type_array = " - * + - * sb.toString() - * ); - */ if (!validIndexes) { fieldType = null; subrefsArray = null; @@ -582,11 +545,6 @@ public abstract class Definition extends Assignment implements IAppendableSyntax public boolean shouldMarkOccurrences() { return markOccurrences; } - - @Override - public Declaration getDeclaration() { - return Declaration.createInstance(this); - } private static ErroneousAttributeSpecification parseErrAttrSpecString(final AttributeSpecification aAttrSpec) { ErroneousAttributeSpecification returnValue = null; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definitions.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definitions.java index 1be26c961c41978ae81b9066240eb547af1c3677..87fe8385b5f2d5f64e8c45cb9f6c7485cde879c0 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definitions.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Definitions.java @@ -23,7 +23,6 @@ import org.eclipse.titan.designer.AST.Assignments; import org.eclipse.titan.designer.AST.ILocateableNode; import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IOutlineElement; -import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Location; import org.eclipse.titan.designer.AST.Module; @@ -368,6 +367,30 @@ public final class Definitions extends Assignments implements ILocateableNode { LoadBalancingUtilities.astNodeChecked(); } } + + /** + * Experimental method for BrokenPartsViaInvertedImports. + */ + public void checkWithDefinitions(final CompilationTimeStamp timestamp, final List<Assignment> assignments) { + if (lastCompilationTimeStamp != null && !lastCompilationTimeStamp.isLess(timestamp)) { + return; + } + + checkUniqueness(timestamp); + checkGroups(timestamp); + + lastCompilationTimeStamp = timestamp; + + for (Iterator<Assignment> iterator = assignments.iterator(); iterator.hasNext();) { + Assignment assignmentFrom = iterator.next(); + if(definitionMap.containsKey(assignmentFrom.getIdentifier().getName())) { + assignmentFrom.check(timestamp); + LoadBalancingUtilities.astNodeChecked(); + } + } + + } + @Override public void postCheck() { @@ -437,21 +460,8 @@ public final class Definitions extends Assignments implements ILocateableNode { @Override public void addProposal(final ProposalCollector propCollector) { if (propCollector.getReference().getModuleIdentifier() == null) { - // ToDo:code completition does not work most of the time - // it would be needed HQ66225 - // test implementation - if (lastCompilationTimeStamp != null) { - IType preType = null; - for (Iterator<Definition> iterator = definitions.iterator(); iterator.hasNext();) { - iterator.next().addProposal(propCollector, 0); - IType type = definitions.get(0).getType(lastCompilationTimeStamp); - if (type != null) { - if (type != preType) { - type.addProposal(propCollector, 0); - preType = type; - } - } - } + for (Iterator<Definition> iterator = definitions.iterator(); iterator.hasNext();) { + iterator.next().addProposal(propCollector, 0); } } super.addProposal(propCollector); @@ -777,7 +787,8 @@ public final class Definitions extends Assignments implements ILocateableNode { Location tempLocation = temp.getLocation(); if (reparser.isAffected(tempLocation)) { try { - temp.updateSyntax(reparser, enveloped && reparser.envelopsDamage(tempLocation)); + boolean isDamaged = enveloped && reparser.envelopsDamage(tempLocation); + temp.updateSyntax(reparser, isDamaged); if (reparser.getNameChanged()) { if (doubleDefinitions != null) { doubleDefinitions.clear(); @@ -785,6 +796,9 @@ public final class Definitions extends Assignments implements ILocateableNode { lastUniquenessCheckTimeStamp = null; reparser.setNameChanged(false); } + if(isDamaged) { + temp.resetLastTimeChecked(); + } } catch (ReParseException e) { if (e.getDepth() == 1) { enveloped = false; @@ -892,9 +906,6 @@ public final class Definitions extends Assignments implements ILocateableNode { localImports, allFriends, localFriends, controlParts); if ( parser.isErrorListEmpty() ) { - if (!allDefinitions.isEmpty()) { - aReparser.fullAnalysysNeeded = true; - } addDefinitions(allDefinitions); if (doubleDefinitions != null) { doubleDefinitions.clear(); @@ -902,21 +913,17 @@ public final class Definitions extends Assignments implements ILocateableNode { lastUniquenessCheckTimeStamp = null; for (ImportModule impmod : allImports) { - aReparser.fullAnalysysNeeded = true; module.addImportedModule(impmod); } for (Group group : localGroups) { - aReparser.fullAnalysysNeeded = true; addGroup(group); } for (FriendModule friend : allFriends) { - aReparser.fullAnalysysNeeded = true; module.addFriendModule(friend); } if (controlParts != null && controlParts.size() == 1) { - aReparser.fullAnalysysNeeded = true; ((TTCN3Module) parentScope).addControlpart(controlParts.get(0)); } } @@ -941,7 +948,6 @@ public final class Definitions extends Assignments implements ILocateableNode { for (int i = groups.size() - 1; i >= 0; i--) { Group temp = groups.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); groups.remove(i); } @@ -950,7 +956,6 @@ public final class Definitions extends Assignments implements ILocateableNode { for (int i = importedModules.size() - 1; i >= 0; i--) { ImportModule temp = importedModules.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); importedModules.remove(i); } @@ -959,7 +964,6 @@ public final class Definitions extends Assignments implements ILocateableNode { for (int i = friendModules.size() - 1; i >= 0; i--) { FriendModule temp = friendModules.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); friendModules.remove(i); } @@ -968,8 +972,6 @@ public final class Definitions extends Assignments implements ILocateableNode { for (Iterator<Definition> iterator = definitions.iterator(); iterator.hasNext();) { Definition temp = iterator.next(); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; - reparser.moduleToBeReanalysed.addAll(temp.referingHere); reparser.extendDamagedRegion(temp.getLocation()); definitions.remove(temp); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/FormalParameter.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/FormalParameter.java index 03f393b67b5d9d4d1fcc77989e037f19d65d65e0..ba7fd9820d0ca519a14f095f8f79aa975692d708 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/FormalParameter.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/FormalParameter.java @@ -91,14 +91,14 @@ public final class FormalParameter extends Definition { private boolean wasAssigned; - public FormalParameter(final TemplateRestriction.Restriction_type template_restriction, final Assignment_type assignmentType, + public FormalParameter(final TemplateRestriction.Restriction_type templateRestriction, final Assignment_type assignmentType, final Type type, final Identifier identifier, final TemplateInstance defaultValue, final boolean isLazy) { super(identifier); this.assignmentType = assignmentType; realAssignmentType = assignmentType; this.type = type; this.defaultValue = defaultValue; - this.templateRestriction = template_restriction; + this.templateRestriction = templateRestriction; this.isLazy = isLazy; if (type != null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Group.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Group.java index 62d57f3192d2232ed9fae4177504bd3662061d9a..a113e49ca464ba978c4caf31515c3acbb9086129 100755 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Group.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Group.java @@ -772,7 +772,15 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable tempLocation = temp.getLocation(); if (reparser.isAffected(tempLocation)) { try { - temp.updateSyntax(reparser, enveloped && reparser.envelopsDamage(tempLocation)); + boolean isDamaged = enveloped && reparser.envelopsDamage(tempLocation); + temp.updateSyntax(reparser, isDamaged); + if (reparser.getNameChanged()) { + lastUniquenessCheckTimeStamp = null; + reparser.setNameChanged(false); + } + if(isDamaged) { + temp.resetLastTimeChecked(); + } } catch (ReParseException e) { if (e.getDepth() == 1) { enveloped = false; @@ -841,7 +849,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable } if (!enveloped && reparser.envelopsDamage(innerLocation)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(leftBoundary, rightBoundary); result = reparseModuleDefinitionsList( reparser ); } @@ -872,7 +879,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable for (int i = groups.size() - 1; i >= 0; i--) { Group temp = groups.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); groups.remove(i); } @@ -881,7 +887,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable for (int i = importedModules.size() - 1; i >= 0; i--) { ImportModule temp = importedModules.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); importedModules.remove(i); } @@ -890,7 +895,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable for (int i = allImportedModules.size() - 1; i >= 0; i--) { ImportModule temp = allImportedModules.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); allImportedModules.remove(i); } @@ -899,7 +903,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable for (int i = friendModules.size() - 1; i >= 0; i--) { FriendModule temp = friendModules.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); friendModules.remove(i); } @@ -908,7 +911,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable for (int i = allFriends.size() - 1; i >= 0; i--) { FriendModule temp = allFriends.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temp.getLocation()); allFriends.remove(i); } @@ -917,7 +919,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable for (int i = definitions.size() - 1; i >= 0; i--) { Definition temp = definitions.get(i); if (reparser.isDamaged(temp.getLocation())) { - reparser.moduleToBeReanalysed.addAll(temp.referingHere); reparser.extendDamagedRegion(temp.getLocation()); definitions.remove(i); } @@ -926,7 +927,6 @@ public final class Group extends ASTNode implements IOutlineElement, ILocateable for (Iterator<Definition> iterator = allDefinitions.iterator(); iterator.hasNext();) { Definition temp = iterator.next(); if (reparser.isDamaged(temp.getLocation())) { - reparser.moduleToBeReanalysed.addAll(temp.referingHere); reparser.extendDamagedRegion(temp.getLocation()); allDefinitions.remove(temp); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/ImportModule.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/ImportModule.java index 4ea8aeaeb8f702b3e71152c242ad367d2c5258dd..3d3490f820a089889280c43865434f9e50151084 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/ImportModule.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/ImportModule.java @@ -517,18 +517,18 @@ public final class ImportModule extends ModuleImportation implements ILocateable propCollector.addProposal(identifier, ImageCache.getImage(getOutlineIcon()), KIND); } - final Module savedReferedModule = referredModule; - if (savedReferedModule != null) { - Assignments assignments = savedReferedModule.getAssignments(); + final Module savedReferredModule = referredModule; + if (savedReferredModule != null) { + Assignments assignments = savedReferredModule.getAssignments(); for (int i = 0, size = assignments.getNofAssignments(); i < size; i++) { Assignment temporalAssignment = assignments.getAssignmentByIndex(i); - if (savedReferedModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { + if (savedReferredModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { temporalAssignment.addProposal(propCollector, 0); } } - if (savedReferedModule instanceof TTCN3Module) { - final TTCN3Module ttcnmodule = (TTCN3Module) savedReferedModule; + if (savedReferredModule instanceof TTCN3Module) { + final TTCN3Module ttcnmodule = (TTCN3Module) savedReferredModule; final List<ImportModule> imports = ttcnmodule.getImports(); for (ImportModule importation : imports) { if (importation.getVisibilityModifier() == VisibilityModifier.Public) { @@ -546,18 +546,18 @@ public final class ImportModule extends ModuleImportation implements ILocateable @Override public void addDeclaration(final DeclarationCollector declarationCollector, final Identifier targetModuleId) { - final Module savedReferedModule = referredModule; - if (savedReferedModule != null) { - Assignments assignments = savedReferedModule.getAssignments(); + final Module savedReferredModule = referredModule; + if (savedReferredModule != null) { + Assignments assignments = savedReferredModule.getAssignments(); for (int i = 0; i < assignments.getNofAssignments(); i++) { Assignment temporalAssignment = assignments.getAssignmentByIndex(i); - if (savedReferedModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { + if (savedReferredModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) { temporalAssignment.addDeclaration(declarationCollector, 0); } } - if (savedReferedModule instanceof TTCN3Module) { - final TTCN3Module ttcnmodule = (TTCN3Module) savedReferedModule; + if (savedReferredModule instanceof TTCN3Module) { + final TTCN3Module ttcnmodule = (TTCN3Module) savedReferredModule; final List<ImportModule> imports = ttcnmodule.getImports(); for (ImportModule importation : imports) { if (importation.getVisibilityModifier() == VisibilityModifier.Public) { @@ -575,7 +575,7 @@ public final class ImportModule extends ModuleImportation implements ILocateable Identifier moduleId = declarationCollector.getReference().getModuleIdentifier(); List<ISubReference> subrefs = declarationCollector.getReference().getSubreferences(); if (moduleId == null && subrefs.size() == 1 && identifier.getName().equals(subrefs.get(0).getId().getName())) { - declarationCollector.addDeclaration(savedReferedModule.getIdentifier().getDisplayName(), savedReferedModule + declarationCollector.addDeclaration(savedReferredModule.getIdentifier().getDisplayName(), savedReferredModule .getIdentifier().getLocation(), (Assignment) null); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/TTCN3Module.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/TTCN3Module.java index b962336534eff06a7bace15ccf0bb134841426a0..4d6f9e62abdf8ce4f30569bcac1a15a60905233e 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/TTCN3Module.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/TTCN3Module.java @@ -22,11 +22,14 @@ import org.eclipse.titan.common.product.ProductIdentity; import org.eclipse.titan.designer.GeneralConstants; import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.Assignment.Assignment_type; import org.eclipse.titan.designer.AST.Assignments; import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.ISubReference; import org.eclipse.titan.designer.AST.IType; +import org.eclipse.titan.designer.AST.IType.Type_type; import org.eclipse.titan.designer.AST.Identifier; +import org.eclipse.titan.designer.AST.Identifier.Identifier_type; import org.eclipse.titan.designer.AST.Location; import org.eclipse.titan.designer.AST.Module; import org.eclipse.titan.designer.AST.ModuleImportation; @@ -34,12 +37,9 @@ import org.eclipse.titan.designer.AST.ModuleImportationChain; import org.eclipse.titan.designer.AST.NamingConventionHelper; import org.eclipse.titan.designer.AST.Reference; import org.eclipse.titan.designer.AST.ReferenceFinder; +import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.Type; -import org.eclipse.titan.designer.AST.Assignment.Assignment_type; -import org.eclipse.titan.designer.AST.IType.Type_type; -import org.eclipse.titan.designer.AST.Identifier.Identifier_type; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.attributes.AnytypeAttribute; import org.eclipse.titan.designer.AST.TTCN3.attributes.AttributeSpecification; import org.eclipse.titan.designer.AST.TTCN3.attributes.ExtensionAttribute; @@ -47,12 +47,10 @@ import org.eclipse.titan.designer.AST.TTCN3.attributes.ModuleVersionAttribute; import org.eclipse.titan.designer.AST.TTCN3.attributes.MultipleWithAttributes; import org.eclipse.titan.designer.AST.TTCN3.attributes.Qualifiers; import org.eclipse.titan.designer.AST.TTCN3.attributes.SingleWithAttribute; +import org.eclipse.titan.designer.AST.TTCN3.attributes.SingleWithAttribute.Attribute_Type; import org.eclipse.titan.designer.AST.TTCN3.attributes.TitanVersionAttribute; import org.eclipse.titan.designer.AST.TTCN3.attributes.VersionRequirementAttribute; import org.eclipse.titan.designer.AST.TTCN3.attributes.WithAttributesPath; -import org.eclipse.titan.designer.AST.TTCN3.attributes.SingleWithAttribute.Attribute_Type; -import org.eclipse.titan.designer.AST.TTCN3.statements.Map_Statement; -import org.eclipse.titan.designer.AST.TTCN3.statements.StatementBlock; import org.eclipse.titan.designer.AST.TTCN3.types.Anytype_Type; import org.eclipse.titan.designer.AST.TTCN3.types.CompField; import org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type; @@ -88,9 +86,7 @@ public final class TTCN3Module extends Module { private static final String FULLNAMEPART = ".control"; public static final String MODULE = "module"; - public static final String DUPLICATEIMPORTFIRST = "Duplicate import from module `{0}'' was first declared here"; - public static final String DUPLICATEIMPORTREPEATED = "Duplicate import from module `{0}'' was declared here again"; - public static final String MISSINGREFERENCE = "There is no visible definition with name `{0}'' in module `{1}''"; + private static final String MISSINGREFERENCE = "There is no visible definition with name `{0}'' in module `{1}''"; private final List<ImportModule> importedModules; private final List<FriendModule> friendModules; @@ -441,6 +437,53 @@ public final class TTCN3Module extends Module { controlpart.check(timestamp); } } + + /** + * Experimental method for BrokenPartsViaInvertedImports. + */ + public void checkWithDefinitions(final CompilationTimeStamp timestamp, final List<Assignment> assignments) { + if (lastCompilationTimeStamp != null && !lastCompilationTimeStamp.isLess(timestamp)) { + return; + } + + T3Doc.check(this.getCommentLocation(), MODULE); + + lastCompilationTimeStamp = timestamp; + + NamingConventionHelper.checkConvention(PreferenceConstants.REPORTNAMINGCONVENTION_TTCN3MODULE, identifier, "TTCN-3 module"); + + // re-initialize at the beginning of the cycle. + versionNumber = null; + anytype.clear(); + missingReferences.clear(); + + if (withAttributesPath != null) { + withAttributesPath.checkGlobalAttributes(timestamp, false); + withAttributesPath.checkAttributes(timestamp); + } + + //for (ImportModule impMod : importedModules) { + // impMod.check(timestamp); + //} + + checkFriendModuleUniqueness(); + for (FriendModule friendModule : friendModules) { + friendModule.check(timestamp); + } + + if (withAttributesPath != null) { + analyzeExtensionAttributes(timestamp); + } + + //anytypeDefinition.check(timestamp); + //definitions.check(timestamp); + + definitions.checkWithDefinitions(timestamp, assignments); + + if (controlpart != null) { + controlpart.check(timestamp); + } + } @Override public void postCheck() { @@ -758,13 +801,6 @@ public final class TTCN3Module extends Module { if (temporalAssignment != null) { return temporalAssignment; } - - //map(A:port, system:MyActualNotIdentifiedPort) form shall be accepted in function and altstep - if( reference.getNameParent() != null && reference.getNameParent() instanceof Map_Statement - && reference.getMyScope() != null && (reference.getMyScope() instanceof StatementBlock) - ) { - return null; - } referenceLocation .reportSemanticError(MessageFormat.format(MISSINGREFERENCE, id.getDisplayName(), identifier.getDisplayName())); @@ -948,7 +984,6 @@ public final class TTCN3Module extends Module { return aReparser.parse(new ITTCN3ReparseBase() { @Override public void reparse(final Ttcn3Reparser parser) { - aReparser.fullAnalysysNeeded = true; MultipleWithAttributes attributes = parser.pr_reparser_optionalWithStatement().attributes; parser.pr_EndOfFile(); if ( parser.isErrorListEmpty() ) { @@ -1021,7 +1056,6 @@ public final class TTCN3Module extends Module { // edited the module identifier Location temporalIdentifier = identifier.getLocation(); if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(temporalIdentifier); IIdentifierReparser r = new IdentifierReparser(reparser); int result = r.parse(); @@ -1044,7 +1078,6 @@ public final class TTCN3Module extends Module { } return; } else if (reparser.isDamaged(temporalIdentifier)) { - reparser.fullAnalysysNeeded = true; throw new ReParseException(); } @@ -1056,7 +1089,6 @@ public final class TTCN3Module extends Module { try { definitions.updateSyntax(reparser, importedModules, friendModules, controlpart); } catch (ReParseException e) { - reparser.fullAnalysysNeeded = true; throw e; } @@ -1066,7 +1098,6 @@ public final class TTCN3Module extends Module { try { controlpart.updateSyntax(reparser); } catch (ReParseException e) { - reparser.fullAnalysysNeeded = true; throw e; } @@ -1079,7 +1110,6 @@ public final class TTCN3Module extends Module { if (withAttributesPath != null && reparser.isAffected(withAttributesPath.getLocation())) { // The modification happened inside the attribute list if (reparser.envelopsDamage(withAttributesPath.getLocation())) { - reparser.fullAnalysysNeeded = true; reparser.extendDamagedRegion(withAttributesPath.getLocation()); int result = reparseInsideAttributelist( reparser ); @@ -1094,7 +1124,6 @@ public final class TTCN3Module extends Module { reparser.updateLocation(withAttributesPath.getLocation()); } else { - reparser.fullAnalysysNeeded = true; // Something happened that we can not handle, // for example the with attribute were commented // out diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Activate_Referenced_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Activate_Referenced_Statement.java index 4cb6a3a383d92fa593d8f69afeb7f363ecb65549..a01de0a9259f9fb0bab467fedfcabe0fa185dffa 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Activate_Referenced_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Activate_Referenced_Statement.java @@ -38,15 +38,15 @@ public final class Activate_Referenced_Statement extends Statement { private static final String FULLNAMEPART2 = ".<parameters>"; private static final String STATEMENT_NAME = "activate"; - private final Value dereferedValue; + private final Value dereferredValue; private final ParsedActualParameters actualParameterList; - public Activate_Referenced_Statement(final Value dereferedValue, final ParsedActualParameters actualParameterList) { - this.dereferedValue = dereferedValue; + public Activate_Referenced_Statement(final Value dereferredValue, final ParsedActualParameters actualParameterList) { + this.dereferredValue = dereferredValue; this.actualParameterList = actualParameterList; - if (dereferedValue != null) { - dereferedValue.setFullNameParent(this); + if (dereferredValue != null) { + dereferredValue.setFullNameParent(this); } if (actualParameterList != null) { actualParameterList.setFullNameParent(this); @@ -67,7 +67,7 @@ public final class Activate_Referenced_Statement extends Statement { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (dereferedValue == child) { + if (dereferredValue == child) { return builder.append(FULLNAMEPART1); } else if (actualParameterList == child) { return builder.append(FULLNAMEPART2); @@ -79,8 +79,8 @@ public final class Activate_Referenced_Statement extends Statement { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (dereferedValue != null) { - dereferedValue.setMyScope(scope); + if (dereferredValue != null) { + dereferredValue.setMyScope(scope); } if (actualParameterList != null) { actualParameterList.setMyScope(scope); @@ -96,13 +96,13 @@ public final class Activate_Referenced_Statement extends Statement { isErroneous = false; lastTimeChecked = timestamp; - if (dereferedValue == null) { + if (dereferredValue == null) { setIsErroneous(); return; } - dereferedValue.setLoweridToReference(timestamp); - IType type = dereferedValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE); + dereferredValue.setLoweridToReference(timestamp); + IType type = dereferredValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE); if (type != null) { type = type.getTypeRefdLast(timestamp); } @@ -113,13 +113,13 @@ public final class Activate_Referenced_Statement extends Statement { } if (!Type_type.TYPE_ALTSTEP.equals(type.getTypetype())) { - dereferedValue.getLocation().reportSemanticError(MessageFormat.format(ALTSTEPEXPECTED, type.getTypename())); + dereferredValue.getLocation().reportSemanticError(MessageFormat.format(ALTSTEPEXPECTED, type.getTypename())); setIsErroneous(); return; } if (((Altstep_Type) type).isRunsOnSelf()) { - dereferedValue.getLocation().reportSemanticError(RUNONSELFERROR); + dereferredValue.getLocation().reportSemanticError(RUNONSELFERROR); setIsErroneous(); return; } @@ -148,9 +148,9 @@ public final class Activate_Referenced_Statement extends Statement { throw new ReParseException(); } - if (dereferedValue != null) { - dereferedValue.updateSyntax(reparser, false); - reparser.updateLocation(dereferedValue.getLocation()); + if (dereferredValue != null) { + dereferredValue.updateSyntax(reparser, false); + reparser.updateLocation(dereferredValue.getLocation()); } if (actualParameterList != null) { actualParameterList.updateSyntax(reparser, false); @@ -160,8 +160,8 @@ public final class Activate_Referenced_Statement extends Statement { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (dereferedValue != null) { - dereferedValue.findReferences(referenceFinder, foundIdentifiers); + if (dereferredValue != null) { + dereferredValue.findReferences(referenceFinder, foundIdentifiers); } if (actualParameterList != null) { actualParameterList.findReferences(referenceFinder, foundIdentifiers); @@ -170,7 +170,7 @@ public final class Activate_Referenced_Statement extends Statement { @Override protected boolean memberAccept(ASTVisitor v) { - if (dereferedValue != null && !dereferedValue.accept(v)) { + if (dereferredValue != null && !dereferredValue.accept(v)) { return false; } if (actualParameterList != null && !actualParameterList.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Altstep_Applied_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Altstep_Applied_Statement.java index b5c45f7b52e97b4c477c2e84d68c87085e8dd1f4..81a410dd6f06d6f28e96479cef8917caf9f0df4f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Altstep_Applied_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Altstep_Applied_Statement.java @@ -29,15 +29,15 @@ public final class Altstep_Applied_Statement extends Statement { private static final String FULLNAMEPART2 = ".<parameters>"; private static final String STATEMENT_NAME = "altstep type application"; - private final Value dereferedValue; + private final Value dereferredValue; private final ParsedActualParameters actualParameterList; - public Altstep_Applied_Statement(final Value dereferedValue, final ParsedActualParameters actualParameterList) { - this.dereferedValue = dereferedValue; + public Altstep_Applied_Statement(final Value dereferredValue, final ParsedActualParameters actualParameterList) { + this.dereferredValue = dereferredValue; this.actualParameterList = actualParameterList; - if (dereferedValue != null) { - dereferedValue.setFullNameParent(this); + if (dereferredValue != null) { + dereferredValue.setFullNameParent(this); } if (actualParameterList != null) { actualParameterList.setFullNameParent(this); @@ -58,7 +58,7 @@ public final class Altstep_Applied_Statement extends Statement { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (dereferedValue == child) { + if (dereferredValue == child) { return builder.append(FULLNAMEPART1); } else if (actualParameterList == child) { return builder.append(FULLNAMEPART2); @@ -70,8 +70,8 @@ public final class Altstep_Applied_Statement extends Statement { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (dereferedValue != null) { - dereferedValue.setMyScope(scope); + if (dereferredValue != null) { + dereferredValue.setMyScope(scope); } if (actualParameterList != null) { actualParameterList.setMyScope(scope); @@ -98,9 +98,9 @@ public final class Altstep_Applied_Statement extends Statement { throw new ReParseException(); } - if (dereferedValue != null) { - dereferedValue.updateSyntax(reparser, false); - reparser.updateLocation(dereferedValue.getLocation()); + if (dereferredValue != null) { + dereferredValue.updateSyntax(reparser, false); + reparser.updateLocation(dereferredValue.getLocation()); } if (actualParameterList != null) { @@ -111,8 +111,8 @@ public final class Altstep_Applied_Statement extends Statement { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (dereferedValue != null) { - dereferedValue.findReferences(referenceFinder, foundIdentifiers); + if (dereferredValue != null) { + dereferredValue.findReferences(referenceFinder, foundIdentifiers); } if (actualParameterList != null) { actualParameterList.findReferences(referenceFinder, foundIdentifiers); @@ -121,7 +121,7 @@ public final class Altstep_Applied_Statement extends Statement { @Override protected boolean memberAccept(ASTVisitor v) { - if (dereferedValue != null && !dereferedValue.accept(v)) { + if (dereferredValue != null && !dereferredValue.accept(v)) { return false; } if (actualParameterList != null && !actualParameterList.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Catch_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Catch_Statement.java index c519d21fc83a51ca640649c56d964c83c81786b0..4e38cb55dfac1549a32e0a9c9c1b4f98a0e27175 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Catch_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Catch_Statement.java @@ -206,7 +206,7 @@ public final class Catch_Statement extends Statement { lastTimeChecked = timestamp; } - public static void checkCatch(final CompilationTimeStamp timestamp, final Statement statement, final String statement_name, + public static void checkCatch(final CompilationTimeStamp timestamp, final Statement statement, final String statementName, final Reference portReference, final Reference signatureReference, final TemplateInstance parameter, final boolean timeout, final TemplateInstance fromClause, final Reference redirectValue, final Reference redirectSender) { @@ -251,7 +251,7 @@ public final class Catch_Statement extends Statement { if (OperationModes.OP_Message.equals(body.getOperationMode())) { portReference.getLocation().reportSemanticError( - MessageFormat.format(MESSAGEPORT, statement_name, portType.getTypename())); + MessageFormat.format(MESSAGEPORT, statementName, portType.getTypename())); } else if (!body.catchAllowed(timestamp)) { portReference.getLocation().reportSemanticError( MessageFormat.format(PORTWITHOUTEXCEPTIONSUPPORT, portType.getTypename())); @@ -271,7 +271,7 @@ public final class Catch_Statement extends Statement { if (OperationModes.OP_Message.equals(body.getOperationMode())) { portReference.getLocation().reportSemanticError( - MessageFormat.format(MESSAGEPORT, statement_name, portType.getTypename())); + MessageFormat.format(MESSAGEPORT, statementName, portType.getTypename())); } else if (body.catchAllowed(timestamp)) { TypeSet outSignatures = body.getOutSignatures(); @@ -290,11 +290,11 @@ public final class Catch_Statement extends Statement { } } else if (portReference == null) { if (parameter != null) { - parameter.getLocation().reportSemanticError(MessageFormat.format(ANYPORTWITHPARAMETER, statement_name)); + parameter.getLocation().reportSemanticError(MessageFormat.format(ANYPORTWITHPARAMETER, statementName)); } if (redirectValue != null) { redirectValue.getLocation().reportSemanticError( - MessageFormat.format(ANYPORTWITHVALUEREDIRECT, statement_name)); + MessageFormat.format(ANYPORTWITHVALUEREDIRECT, statementName)); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Connect_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Connect_Statement.java index eb77222c12b72e90bd8616c22ba88f43d3fd9660..039b71645eae68ba1235357727dcaa42770a0808 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Connect_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Connect_Statement.java @@ -13,11 +13,11 @@ import java.util.List; import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IType; -import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.AST.PortReference; import org.eclipse.titan.designer.AST.ReferenceFinder; +import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.Value; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.types.PortTypeBody; import org.eclipse.titan.designer.AST.TTCN3.types.Port_Type; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; @@ -37,12 +37,12 @@ public final class Connect_Statement extends Statement { private static final String STATEMENT_NAME = "connect"; private final Value componentReference1; - private final Reference portReference1; + private final PortReference portReference1; private final Value componentReference2; - private final Reference portReference2; + private final PortReference portReference2; - public Connect_Statement(final Value componentReference1, final Reference portReference1, final Value componentReference2, - final Reference portReference2) { + public Connect_Statement(final Value componentReference1, final PortReference portReference1, final Value componentReference2, + final PortReference portReference2) { this.componentReference1 = componentReference1; this.portReference1 = portReference1; this.componentReference2 = componentReference2; @@ -95,15 +95,9 @@ public final class Connect_Statement extends Statement { if (componentReference1 != null) { componentReference1.setMyScope(scope); } - if (portReference1 != null) { - portReference1.setMyScope(scope); - } if (componentReference2 != null) { componentReference2.setMyScope(scope); } - if (portReference2 != null) { - portReference2.setMyScope(scope); - } } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Disconnect_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Disconnect_Statement.java index de2fba5bf564e5ed2730cf08c076714e5372de3b..ccc5a4e565bf5b1edbaa16057431bb6ad6908413 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Disconnect_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Disconnect_Statement.java @@ -13,11 +13,11 @@ import java.util.List; import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IType; -import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.AST.PortReference; import org.eclipse.titan.designer.AST.ReferenceFinder; +import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.Value; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.types.PortTypeBody; import org.eclipse.titan.designer.AST.TTCN3.types.Port_Type; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; @@ -35,12 +35,12 @@ public final class Disconnect_Statement extends Statement { private static final String STATEMENT_NAME = "disconnect"; private final Value componentReference1; - private final Reference portReference1; + private final PortReference portReference1; private final Value componentReference2; - private final Reference portReference2; + private final PortReference portReference2; - public Disconnect_Statement(final Value componentReference1, final Reference portReference1, final Value componentReference2, - final Reference portReference2) { + public Disconnect_Statement(final Value componentReference1, final PortReference portReference1, final Value componentReference2, + final PortReference portReference2) { this.componentReference1 = componentReference1; this.portReference1 = portReference1; this.componentReference2 = componentReference2; @@ -93,15 +93,9 @@ public final class Disconnect_Statement extends Statement { if (componentReference1 != null) { componentReference1.setMyScope(scope); } - if (portReference1 != null) { - portReference1.setMyScope(scope); - } if (componentReference2 != null) { componentReference2.setMyScope(scope); } - if (portReference2 != null) { - portReference2.setMyScope(scope); - } } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/For_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/For_Statement.java index 5cff67c68789c8aed1647cf304836f3d47987281..19182d07776c66209289e6183182ff2074f3e506 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/For_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/For_Statement.java @@ -23,7 +23,6 @@ import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.definitions.Definition; import org.eclipse.titan.designer.AST.TTCN3.definitions.For_Loop_Definitions; -import org.eclipse.titan.designer.AST.TTCN3.statements.StatementBlock.ReturnStatus_type; import org.eclipse.titan.designer.AST.TTCN3.values.Boolean_Value; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Function_Applied_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Function_Applied_Statement.java index c094bf9a8668b4e96fbf20d757bb56723c23067f..e41f56e785031ceae56fb1c10161336c3cf25c48 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Function_Applied_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Function_Applied_Statement.java @@ -29,15 +29,15 @@ public final class Function_Applied_Statement extends Statement { private static final String FULLNAMEPART2 = ".<parameters>"; private static final String STATEMENT_NAME = "function type application"; - private final Value dereferedValue; + private final Value dereferredValue; private final ParsedActualParameters actualParameterList; - public Function_Applied_Statement(final Value dereferedValue, final ParsedActualParameters actualParameterList) { - this.dereferedValue = dereferedValue; + public Function_Applied_Statement(final Value dereferredValue, final ParsedActualParameters actualParameterList) { + this.dereferredValue = dereferredValue; this.actualParameterList = actualParameterList; - if (dereferedValue != null) { - dereferedValue.setFullNameParent(this); + if (dereferredValue != null) { + dereferredValue.setFullNameParent(this); } if (actualParameterList != null) { actualParameterList.setFullNameParent(this); @@ -58,7 +58,7 @@ public final class Function_Applied_Statement extends Statement { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (dereferedValue == child) { + if (dereferredValue == child) { return builder.append(FULLNAMEPART1); } else if (actualParameterList == child) { return builder.append(FULLNAMEPART2); @@ -70,8 +70,8 @@ public final class Function_Applied_Statement extends Statement { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (dereferedValue != null) { - dereferedValue.setMyScope(scope); + if (dereferredValue != null) { + dereferredValue.setMyScope(scope); } if (actualParameterList != null) { actualParameterList.setMyScope(scope); @@ -93,9 +93,9 @@ public final class Function_Applied_Statement extends Statement { throw new ReParseException(); } - if (dereferedValue != null) { - dereferedValue.updateSyntax(reparser, false); - reparser.updateLocation(dereferedValue.getLocation()); + if (dereferredValue != null) { + dereferredValue.updateSyntax(reparser, false); + reparser.updateLocation(dereferredValue.getLocation()); } if (actualParameterList != null) { @@ -106,8 +106,8 @@ public final class Function_Applied_Statement extends Statement { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (dereferedValue != null) { - dereferedValue.findReferences(referenceFinder, foundIdentifiers); + if (dereferredValue != null) { + dereferredValue.findReferences(referenceFinder, foundIdentifiers); } if (actualParameterList != null) { actualParameterList.findReferences(referenceFinder, foundIdentifiers); @@ -116,7 +116,7 @@ public final class Function_Applied_Statement extends Statement { @Override protected boolean memberAccept(ASTVisitor v) { - if (dereferedValue != null && !dereferedValue.accept(v)) { + if (dereferredValue != null && !dereferredValue.accept(v)) { return false; } if (actualParameterList != null && !actualParameterList.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Getcall_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Getcall_Statement.java index 7c993625f327738ade115c6aae3d56da7821ae0e..32d1fcd76745b68de8d19de316cc28c9c92d0294 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Getcall_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Getcall_Statement.java @@ -144,7 +144,7 @@ public final class Getcall_Statement extends Statement { lastTimeChecked = timestamp; } - public static void checkGetcallStatement(final CompilationTimeStamp timestamp, final Statement statement, final String statement_name, + public static void checkGetcallStatement(final CompilationTimeStamp timestamp, final Statement statement, final String statementName, final Reference portReference, final TemplateInstance parameter, final TemplateInstance fromClause, final Parameter_Redirect redirect, final Reference redirectSender) { Port_Type portType = Port_Utility.checkPortReference(timestamp, statement, portReference); @@ -154,7 +154,7 @@ public final class Getcall_Statement extends Statement { PortTypeBody body = portType.getPortBody(); if (OperationModes.OP_Message.equals(body.getOperationMode())) { portReference.getLocation().reportSemanticError( - MessageFormat.format(MESSAGEBASEDPORT, statement_name, portType.getTypename())); + MessageFormat.format(MESSAGEBASEDPORT, statementName, portType.getTypename())); } else if (body.getInSignatures() == null) { portReference.getLocation().reportSemanticError(MessageFormat.format(NOINSIGNATURES, portType.getTypename())); } @@ -173,7 +173,7 @@ public final class Getcall_Statement extends Statement { TypeSet inSignatures = body.getInSignatures(); if (OperationModes.OP_Message.equals(body.getOperationMode())) { portReference.getLocation().reportSemanticError( - MessageFormat.format(MESSAGEBASEDPORT, statement_name, portType.getTypename())); + MessageFormat.format(MESSAGEBASEDPORT, statementName, portType.getTypename())); } else if (inSignatures != null) { if (inSignatures.getNofTypes() == 1) { signature = inSignatures.getTypeByIndex(0); @@ -198,9 +198,9 @@ public final class Getcall_Statement extends Statement { } else if (portReference == null) { // any port is referenced, or there was a syntax // error - parameter.getLocation().reportSemanticError(MessageFormat.format(ANYWITHPARAMETER, statement_name)); + parameter.getLocation().reportSemanticError(MessageFormat.format(ANYWITHPARAMETER, statementName)); if (redirect != null) { - redirect.getLocation().reportSemanticError(MessageFormat.format(ANYWITHREDIRECT, statement_name)); + redirect.getLocation().reportSemanticError(MessageFormat.format(ANYWITHREDIRECT, statementName)); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/If_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/If_Statement.java index 9fc479457b86de9755f21c475672eb6d828801ec..dc9b6a997a0580c5b8e71abe1b35785a0863e35f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/If_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/If_Statement.java @@ -45,7 +45,7 @@ public final class If_Statement extends Statement { private static final String FULLNAMEPART2 = ".elseblock"; private static final String STATEMENT_NAME = "if"; - private final If_Clauses if_clauses; + private final If_Clauses ifClauses; /** * this statementblock represents the else clause. @@ -80,12 +80,12 @@ public final class If_Statement extends Statement { } } - public If_Statement(final If_Clauses if_clauses, final StatementBlock statementblock) { - this.if_clauses = if_clauses; + public If_Statement(final If_Clauses ifClauses, final StatementBlock statementblock) { + this.ifClauses = ifClauses; this.statementblock = statementblock; - if (if_clauses != null) { - if_clauses.setFullNameParent(this); + if (ifClauses != null) { + ifClauses.setFullNameParent(this); } if (statementblock != null) { statementblock.setFullNameParent(this); @@ -106,7 +106,7 @@ public final class If_Statement extends Statement { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (if_clauses == child) { + if (ifClauses == child) { return builder.append(FULLNAMEPART1); } else if (statementblock == child) { return builder.append(FULLNAMEPART2); @@ -116,7 +116,7 @@ public final class If_Statement extends Statement { } public If_Clauses getIfClauses() { - return if_clauses; + return ifClauses; } public StatementBlock getStatementBlock() { @@ -126,8 +126,8 @@ public final class If_Statement extends Statement { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (if_clauses != null) { - if_clauses.setMyScope(scope); + if (ifClauses != null) { + ifClauses.setMyScope(scope); } if (statementblock != null) { statementblock.setMyScope(scope); @@ -137,8 +137,8 @@ public final class If_Statement extends Statement { @Override public void setMyStatementBlock(final StatementBlock statementBlock, final int index) { super.setMyStatementBlock(statementBlock, index); - if (if_clauses != null) { - if_clauses.setMyStatementBlock(statementBlock, index); + if (ifClauses != null) { + ifClauses.setMyStatementBlock(statementBlock, index); } if (statementblock != null) { statementblock.setMyStatementBlock(statementBlock, index); @@ -147,8 +147,8 @@ public final class If_Statement extends Statement { @Override public void setMyDefinition(final Definition definition) { - if (if_clauses != null) { - if_clauses.setMyDefinition(definition); + if (ifClauses != null) { + ifClauses.setMyDefinition(definition); } if (statementblock != null) { statementblock.setMyDefinition(definition); @@ -157,8 +157,8 @@ public final class If_Statement extends Statement { @Override public void setMyAltguards(final AltGuards altGuards) { - if (if_clauses != null) { - if_clauses.setMyAltguards(altGuards); + if (ifClauses != null) { + ifClauses.setMyAltguards(altGuards); } if (statementblock != null) { statementblock.setMyAltguards(altGuards); @@ -167,8 +167,8 @@ public final class If_Statement extends Statement { @Override public StatementBlock.ReturnStatus_type hasReturn(final CompilationTimeStamp timestamp) { - if (if_clauses != null) { - return if_clauses.hasReturn(timestamp, statementblock); + if (ifClauses != null) { + return ifClauses.hasReturn(timestamp, statementblock); } return StatementBlock.ReturnStatus_type.RS_NO; @@ -181,8 +181,8 @@ public final class If_Statement extends Statement { } boolean unreachable = false; - if (if_clauses != null) { - unreachable = if_clauses.check(timestamp, unreachable); + if (ifClauses != null) { + unreachable = ifClauses.check(timestamp, unreachable); } if (statementblock != null) { @@ -202,8 +202,8 @@ public final class If_Statement extends Statement { @Override public void checkAllowedInterleave() { - if (if_clauses != null) { - if_clauses.checkAllowedInterleave(); + if (ifClauses != null) { + ifClauses.checkAllowedInterleave(); } if (statementblock != null) { statementblock.checkAllowedInterleave(); @@ -212,8 +212,8 @@ public final class If_Statement extends Statement { @Override public void postCheck() { - if (if_clauses != null) { - if_clauses.postCheck(); + if (ifClauses != null) { + ifClauses.postCheck(); } if (statementblock != null) { statementblock.postCheck(); @@ -238,8 +238,8 @@ public final class If_Statement extends Statement { throw new ReParseException(); } - if (if_clauses != null) { - if_clauses.updateSyntax(reparser, false); + if (ifClauses != null) { + ifClauses.updateSyntax(reparser, false); } if (statementblock != null) { @@ -250,8 +250,8 @@ public final class If_Statement extends Statement { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (if_clauses != null) { - if_clauses.findReferences(referenceFinder, foundIdentifiers); + if (ifClauses != null) { + ifClauses.findReferences(referenceFinder, foundIdentifiers); } if (statementblock != null) { statementblock.findReferences(referenceFinder, foundIdentifiers); @@ -260,7 +260,7 @@ public final class If_Statement extends Statement { @Override protected boolean memberAccept(ASTVisitor v) { - if (if_clauses != null && !if_clauses.accept(v)) { + if (ifClauses != null && !ifClauses.accept(v)) { return false; } if (statementblock != null && !statementblock.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Map_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Map_Statement.java index 7bb8216a97add92e583b6295195514ddab4d1e49..79ffa39159209a402b78d6c2bd856ae7e1b85021 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Map_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Map_Statement.java @@ -14,12 +14,12 @@ import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.IValue; -import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.AST.IValue.Value_type; +import org.eclipse.titan.designer.AST.PortReference; import org.eclipse.titan.designer.AST.ReferenceFinder; +import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.Value; -import org.eclipse.titan.designer.AST.IValue.Value_type; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.types.PortTypeBody; import org.eclipse.titan.designer.AST.TTCN3.types.Port_Type; @@ -47,12 +47,12 @@ public final class Map_Statement extends Statement { private static final String STATEMENT_NAME = "map"; private final Value componentReference1; - private final Reference portReference1; + private final PortReference portReference1; private final Value componentReference2; - private final Reference portReference2; + private final PortReference portReference2; - public Map_Statement(final Value componentReference1, final Reference portReference1, final Value componentReference2, - final Reference portReference2) { + public Map_Statement(final Value componentReference1, final PortReference portReference1, final Value componentReference2, + final PortReference portReference2) { this.componentReference1 = componentReference1; this.portReference1 = portReference1; this.componentReference2 = componentReference2; @@ -105,15 +105,9 @@ public final class Map_Statement extends Statement { if (componentReference1 != null) { componentReference1.setMyScope(scope); } - if (portReference1 != null) { - portReference1.setMyScope(scope); - } if (componentReference2 != null) { componentReference2.setMyScope(scope); } - if (portReference2 != null) { - portReference2.setMyScope(scope); - } } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Parameter_Assignments.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Parameter_Assignments.java index f641b83890b0a92b9445a8d1977850f11811719b..a96735750c97f944233c5433f005c1316a30e384 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Parameter_Assignments.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Parameter_Assignments.java @@ -28,18 +28,18 @@ import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; public final class Parameter_Assignments extends ASTNode implements IIncrementallyUpdateable { private static final String FULLNAMEPART = ".parameterassignment_"; - private final List<Parameter_Assignment> parameter_assignments; + private final List<Parameter_Assignment> parameterAssignments; public Parameter_Assignments() { - parameter_assignments = new ArrayList<Parameter_Assignment>(); + parameterAssignments = new ArrayList<Parameter_Assignment>(); } @Override public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - for (int i = 0; i < parameter_assignments.size(); i++) { - if (parameter_assignments.get(i) == child) { + for (int i = 0; i < parameterAssignments.size(); i++) { + if (parameterAssignments.get(i) == child) { return builder.append(FULLNAMEPART).append(Integer.toString(i + 1)); } } @@ -51,22 +51,22 @@ public final class Parameter_Assignments extends ASTNode implements IIncremental public void setMyScope(final Scope scope) { super.setMyScope(scope); - for (int i = 0; i < parameter_assignments.size(); i++) { - parameter_assignments.get(i).setMyScope(scope); + for (int i = 0; i < parameterAssignments.size(); i++) { + parameterAssignments.get(i).setMyScope(scope); } } - public void add(final Parameter_Assignment parameter_assignment) { - parameter_assignments.add(parameter_assignment); - parameter_assignment.setFullNameParent(this); + public void add(final Parameter_Assignment parameterAssignment) { + parameterAssignments.add(parameterAssignment); + parameterAssignment.setFullNameParent(this); } public int getNofParameterAssignments() { - return parameter_assignments.size(); + return parameterAssignments.size(); } public Parameter_Assignment getParameterAssignmentByIndex(final int index) { - return parameter_assignments.get(index); + return parameterAssignments.get(index); } @Override @@ -75,8 +75,8 @@ public final class Parameter_Assignments extends ASTNode implements IIncremental throw new ReParseException(); } - for (int i = 0, size = parameter_assignments.size(); i < size; i++) { - Parameter_Assignment assignment = parameter_assignments.get(i); + for (int i = 0, size = parameterAssignments.size(); i < size; i++) { + Parameter_Assignment assignment = parameterAssignments.get(i); assignment.updateSyntax(reparser, isDamaged); reparser.updateLocation(assignment.getLocation()); @@ -85,19 +85,19 @@ public final class Parameter_Assignments extends ASTNode implements IIncremental @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (parameter_assignments == null) { + if (parameterAssignments == null) { return; } - for (Parameter_Assignment pa : parameter_assignments) { + for (Parameter_Assignment pa : parameterAssignments) { pa.findReferences(referenceFinder, foundIdentifiers); } } @Override protected boolean memberAccept(ASTVisitor v) { - if (parameter_assignments != null) { - for (Parameter_Assignment pa : parameter_assignments) { + if (parameterAssignments != null) { + for (Parameter_Assignment pa : parameterAssignments) { if (!pa.accept(v)) { return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Port_Utility.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Port_Utility.java index 97f8d40b52ddfd2584bab37e78ccca2b698930cf..8a238f04123dfa04f760079a00e42a2b5462c8d7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Port_Utility.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Port_Utility.java @@ -18,6 +18,7 @@ import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.IValue; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Module; +import org.eclipse.titan.designer.AST.PortReference; import org.eclipse.titan.designer.AST.Reference; import org.eclipse.titan.designer.AST.ReferenceChain; import org.eclipse.titan.designer.AST.Value; @@ -308,7 +309,7 @@ public final class Port_Utility { * problems. * */ public static IType checkConnectionEndpoint(final CompilationTimeStamp timestamp, final Statement source, final Value componentReference, - final Reference portReference, final boolean allowSystem) { + final PortReference portReference, final boolean allowSystem) { IType componentType = checkComponentReference(timestamp, source, componentReference, true, allowSystem); if (portReference == null) { return componentType; @@ -363,6 +364,7 @@ public final class Port_Utility { ComponentTypeBody componentBody = ((Component_Type) componentType).getComponentBody(); portReference.setBaseScope(componentBody); + portReference.setComponent((Component_Type) componentType); Identifier portIdentifier = portReference.getId(); if (!componentBody.hasLocalAssignmentWithId(portIdentifier)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Receive_Port_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Receive_Port_Statement.java index 8f2bb143e0f18511c5f9bb610d0e6811583aecac..1ca9f6f42365c2e06c7e640bd0ab86ad7434d36a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Receive_Port_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Receive_Port_Statement.java @@ -178,7 +178,7 @@ public final class Receive_Port_Statement extends Statement { * the timestamp of the actual semantic check cycle. * @param origin * the original statement. - * @param statement_name + * @param statementName * the name of the original statement. * @param portReference * the port reference. @@ -191,7 +191,7 @@ public final class Receive_Port_Statement extends Statement { * @param redirectSender * the sender redirection of the statement. * */ - public static void checkReceivingStatement(final CompilationTimeStamp timestamp, final Statement origin, final String statement_name, + public static void checkReceivingStatement(final CompilationTimeStamp timestamp, final Statement origin, final String statementName, final Reference portReference, final TemplateInstance receiveParameter, final TemplateInstance fromClause, final Reference redirectValue, final Reference redirectSender) { Port_Type portType = Port_Utility.checkPortReference(timestamp, origin, portReference); @@ -201,7 +201,7 @@ public final class Receive_Port_Statement extends Statement { PortTypeBody body = portType.getPortBody(); if (OperationModes.OP_Procedure.equals(body.getOperationMode())) { portReference.getLocation().reportSemanticError( - MessageFormat.format(MESSAGEBASEOPERATIONONPROCEDUREPORT, statement_name, + MessageFormat.format(MESSAGEBASEOPERATIONONPROCEDUREPORT, statementName, portType.getTypename())); } else if (body.getInMessages() == null) { portReference.getLocation().reportSemanticError( @@ -225,7 +225,7 @@ public final class Receive_Port_Statement extends Statement { TypeSet inMessages = portTypeBody.getInMessages(); if (OperationModes.OP_Procedure.equals(portTypeBody.getOperationMode())) { portReference.getLocation().reportSemanticError( - MessageFormat.format(RECEIVEONPORT, statement_name, portType.getTypename())); + MessageFormat.format(RECEIVEONPORT, statementName, portType.getTypename())); } else if (inMessages != null) { if (inMessages.getNofTypes() == 1) { messageType = inMessages.getTypeByIndex(0); @@ -255,10 +255,10 @@ public final class Receive_Port_Statement extends Statement { } } else if (portReference == null) { // any port - receiveParameter.getLocation().reportSemanticError(MessageFormat.format(ANYPORTWITHPARAMETER, statement_name)); + receiveParameter.getLocation().reportSemanticError(MessageFormat.format(ANYPORTWITHPARAMETER, statementName)); if (redirectValue != null) { redirectValue.getLocation().reportSemanticError( - MessageFormat.format(RECEIVEWITHVALUEREDIRECT, statement_name)); + MessageFormat.format(RECEIVEWITHVALUEREDIRECT, statementName)); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Referenced_Testcase_Instance_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Referenced_Testcase_Instance_Statement.java index fb73ba5cf2f24945ebdab799fc738a5553f4fec0..fa5b2e8ee649239f7d38ddf6920d62ebc0e43148 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Referenced_Testcase_Instance_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Referenced_Testcase_Instance_Statement.java @@ -43,18 +43,18 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { private static final String FULLNAMEPART3 = ".timerValue"; private static final String STATEMENT_NAME = "execute"; - private final Value dereferedValue; + private final Value dereferredValue; private final ParsedActualParameters actualParameterList; private final Value timerValue; - public Referenced_Testcase_Instance_Statement(final Value dereferedValue, final ParsedActualParameters actualParameterList, + public Referenced_Testcase_Instance_Statement(final Value dereferredValue, final ParsedActualParameters actualParameterList, final Value timerValue) { - this.dereferedValue = dereferedValue; + this.dereferredValue = dereferredValue; this.actualParameterList = actualParameterList; this.timerValue = timerValue; - if (dereferedValue != null) { - dereferedValue.setFullNameParent(this); + if (dereferredValue != null) { + dereferredValue.setFullNameParent(this); } if (actualParameterList != null) { actualParameterList.setFullNameParent(this); @@ -78,7 +78,7 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (dereferedValue == child) { + if (dereferredValue == child) { return builder.append(FULLNAMEPART1); } else if (actualParameterList == child) { return builder.append(FULLNAMEPART2); @@ -92,8 +92,8 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (dereferedValue != null) { - dereferedValue.setMyScope(scope); + if (dereferredValue != null) { + dereferredValue.setMyScope(scope); } if (actualParameterList != null) { actualParameterList.setMyScope(scope); @@ -111,11 +111,11 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { lastTimeChecked = timestamp; - if (dereferedValue == null) { + if (dereferredValue == null) { return; } - IValue temporalValue = dereferedValue.setLoweridToReference(timestamp); + IValue temporalValue = dereferredValue.setLoweridToReference(timestamp); IType type = temporalValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_TEMPLATE); if (type != null) { type = type.getTypeRefdLast(timestamp); @@ -125,7 +125,7 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { } if (!Type_type.TYPE_TESTCASE.equals(type.getTypetype())) { - dereferedValue.getLocation().reportSemanticError( + dereferredValue.getLocation().reportSemanticError( MessageFormat.format( "A value of type testcase was expected in the argument of `derefers()'' instead of `{0}''", type.getTypename())); @@ -133,7 +133,7 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { } if (myStatementBlock.getScopeRunsOn() != null) { - dereferedValue.getLocation().reportSemanticError(DEFINITIONWITHOUTRUNSONEXPECTED); + dereferredValue.getLocation().reportSemanticError(DEFINITIONWITHOUTRUNSONEXPECTED); return; } @@ -173,9 +173,9 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { throw new ReParseException(); } - if (dereferedValue != null) { - dereferedValue.updateSyntax(reparser, false); - reparser.updateLocation(dereferedValue.getLocation()); + if (dereferredValue != null) { + dereferredValue.updateSyntax(reparser, false); + reparser.updateLocation(dereferredValue.getLocation()); } if (actualParameterList != null) { @@ -191,8 +191,8 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (dereferedValue != null) { - dereferedValue.findReferences(referenceFinder, foundIdentifiers); + if (dereferredValue != null) { + dereferredValue.findReferences(referenceFinder, foundIdentifiers); } if (actualParameterList != null) { actualParameterList.findReferences(referenceFinder, foundIdentifiers); @@ -204,7 +204,7 @@ public final class Referenced_Testcase_Instance_Statement extends Statement { @Override protected boolean memberAccept(ASTVisitor v) { - if (dereferedValue != null && !dereferedValue.accept(v)) { + if (dereferredValue != null && !dereferredValue.accept(v)) { return false; } if (actualParameterList != null && !actualParameterList.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Setverdict_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Setverdict_Statement.java index 6015de9b13655f79cd5604f1ebf325cee92a178c..cdb6e8f5af16c7a85332416a0124380d4d4364e9 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Setverdict_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Setverdict_Statement.java @@ -75,14 +75,14 @@ public final class Setverdict_Statement extends Statement { } } - public Setverdict_Statement(final Value verdictValue, final LogArguments verdict_reason) { + public Setverdict_Statement(final Value verdictValue, final LogArguments verdictReason) { this.verdictValue = verdictValue; - this.verdictReason = verdict_reason; + this.verdictReason = verdictReason; if (verdictValue != null) { verdictValue.setFullNameParent(this); } - if (verdict_reason != null) { + if (verdictReason != null) { this.verdictReason.setFullNameParent(this); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Start_Referenced_Component_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Start_Referenced_Component_Statement.java index 8f4d8279d4501e01c2b0c46153e33202bc006227..220bce9d68a39bc6c87e3b6e5c739bd1278f1982 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Start_Referenced_Component_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Start_Referenced_Component_Statement.java @@ -43,20 +43,20 @@ public final class Start_Referenced_Component_Statement extends Statement { private static final String STATEMENT_NAME = "start test component"; private final Value componentReference; - private final Value dereferedValue; + private final Value dereferredValue; private final ParsedActualParameters parameters; - public Start_Referenced_Component_Statement(final Value componentReference, final Value dereferedValue, + public Start_Referenced_Component_Statement(final Value componentReference, final Value dereferredValue, final ParsedActualParameters parameters) { this.componentReference = componentReference; - this.dereferedValue = dereferedValue; + this.dereferredValue = dereferredValue; this.parameters = parameters; if (componentReference != null) { componentReference.setFullNameParent(this); } - if (dereferedValue != null) { - dereferedValue.setFullNameParent(this); + if (dereferredValue != null) { + dereferredValue.setFullNameParent(this); } if (parameters != null) { parameters.setFullNameParent(this); @@ -79,7 +79,7 @@ public final class Start_Referenced_Component_Statement extends Statement { if (componentReference == child) { return builder.append(FULLNAMEPART1); - } else if (dereferedValue == child) { + } else if (dereferredValue == child) { return builder.append(FULLNAMEPART2); } else if (parameters == child) { return builder.append(FULLNAMEPART3); @@ -89,8 +89,8 @@ public final class Start_Referenced_Component_Statement extends Statement { } /** @return the dereferred value */ - public Value getDereferedValue() { - return dereferedValue; + public Value getDereferredValue() { + return dereferredValue; } @Override @@ -99,8 +99,8 @@ public final class Start_Referenced_Component_Statement extends Statement { if (componentReference != null) { componentReference.setMyScope(scope); } - if (dereferedValue != null) { - dereferedValue.setMyScope(scope); + if (dereferredValue != null) { + dereferredValue.setMyScope(scope); } if (parameters != null) { parameters.setMyScope(scope); @@ -121,14 +121,14 @@ public final class Start_Referenced_Component_Statement extends Statement { compType = Port_Utility.checkComponentReference(timestamp, this, componentReference, false, false); } - if (dereferedValue == null) { + if (dereferredValue == null) { return; } - switch (dereferedValue.getValuetype()) { + switch (dereferredValue.getValuetype()) { case EXPRESSION_VALUE: - if (Operation_type.REFERS_OPERATION.equals(((Expression_Value) dereferedValue).getOperationType())) { - dereferedValue.getLocation().reportSemanticError( + if (Operation_type.REFERS_OPERATION.equals(((Expression_Value) dereferredValue).getOperationType())) { + dereferredValue.getLocation().reportSemanticError( "A value of a function type was expected in the argument instead of a `refers' operation," + " which does not specify any function type."); return; @@ -136,7 +136,7 @@ public final class Start_Referenced_Component_Statement extends Statement { break; case TTCN3_NULL_VALUE: case FAT_NULL_VALUE: - dereferedValue.getLocation() + dereferredValue.getLocation() .reportSemanticError( "A value of a function type was expected in the argument instead of a `null' value, which does not specify any function type."); return; @@ -144,8 +144,8 @@ public final class Start_Referenced_Component_Statement extends Statement { break; } - dereferedValue.setLoweridToReference(timestamp); - IType type = dereferedValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE); + dereferredValue.setLoweridToReference(timestamp); + IType type = dereferredValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE); if (type != null) { type = type.getTypeRefdLast(timestamp); } @@ -155,14 +155,14 @@ public final class Start_Referenced_Component_Statement extends Statement { } if (!Type_type.TYPE_FUNCTION.equals(type.getTypetype())) { - dereferedValue.getLocation().reportSemanticError( + dereferredValue.getLocation().reportSemanticError( MessageFormat.format("A value of type function was expected in the argument of `{0}''", type.getTypename())); return; } Function_Type functionType = (Function_Type) type; if (functionType.isRunsOnSelf()) { - dereferedValue.getLocation().reportSemanticError("The argument cannot be a function reference with 'runs on self' clause"); + dereferredValue.getLocation().reportSemanticError("The argument cannot be a function reference with 'runs on self' clause"); return; } @@ -182,7 +182,7 @@ public final class Start_Referenced_Component_Statement extends Statement { IType returnType = functionType.getReturnType(); if (returnType != null) { if (functionType.returnsTemplate()) { - dereferedValue.getLocation().reportSemanticWarning( + dereferredValue.getLocation().reportSemanticWarning( MessageFormat.format("Function of type `{0}'' return a template of type `{1}''," + " which cannot be retrieved when the test component terminates", functionType.getTypename(), returnType.getTypename())); @@ -209,7 +209,7 @@ public final class Start_Referenced_Component_Statement extends Statement { } if (!returnTypeCorrect) { - dereferedValue.getLocation() + dereferredValue.getLocation() .reportSemanticWarning( MessageFormat.format( "Return type of function type `{0}'' is `{1}'', which does not have the `done'' extension attibute." @@ -238,9 +238,9 @@ public final class Start_Referenced_Component_Statement extends Statement { reparser.updateLocation(componentReference.getLocation()); } - if (dereferedValue != null) { - dereferedValue.updateSyntax(reparser, false); - reparser.updateLocation(dereferedValue.getLocation()); + if (dereferredValue != null) { + dereferredValue.updateSyntax(reparser, false); + reparser.updateLocation(dereferredValue.getLocation()); } if (parameters != null) { parameters.updateSyntax(reparser, false); @@ -253,8 +253,8 @@ public final class Start_Referenced_Component_Statement extends Statement { if (componentReference != null) { componentReference.findReferences(referenceFinder, foundIdentifiers); } - if (dereferedValue != null) { - dereferedValue.findReferences(referenceFinder, foundIdentifiers); + if (dereferredValue != null) { + dereferredValue.findReferences(referenceFinder, foundIdentifiers); } if (parameters != null) { parameters.findReferences(referenceFinder, foundIdentifiers); @@ -266,7 +266,7 @@ public final class Start_Referenced_Component_Statement extends Statement { if (componentReference != null && !componentReference.accept(v)) { return false; } - if (dereferedValue != null && !dereferedValue.accept(v)) { + if (dereferredValue != null && !dereferredValue.accept(v)) { return false; } if (parameters != null && !parameters.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/TestcaseStop_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/TestcaseStop_Statement.java index 0729a95e1fd21ea168c0d4e2f8f8f8d50f9797c8..540aa0bd50b7b3b261aec75b3b1f16759c5212b1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/TestcaseStop_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/TestcaseStop_Statement.java @@ -103,4 +103,9 @@ public final class TestcaseStop_Statement extends Statement { } return true; } + + @Override + public boolean isTerminating(final CompilationTimeStamp timestamp) { + return true; + } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unknown_Applied_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unknown_Applied_Statement.java index 552d7c1146afa076ef5a8b9b6c73758816e1e452..863afbaf417ce65318c6d08a74635eaa0ea7cd73 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unknown_Applied_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unknown_Applied_Statement.java @@ -41,19 +41,19 @@ public final class Unknown_Applied_Statement extends Statement { private static final String FULLNAMEPART2 = ".<parameters>"; private static final String STATEMENT_NAME = "function or altstep type application"; - private final Value dereferedValue; + private final Value dereferredValue; private final ParsedActualParameters actualParameterList; private Statement realStatement; /** The index of this statement in its parent statement block. */ private int statementIndex; - public Unknown_Applied_Statement(final Value dereferedValue, final ParsedActualParameters actualParameterList) { - this.dereferedValue = dereferedValue; + public Unknown_Applied_Statement(final Value dereferredValue, final ParsedActualParameters actualParameterList) { + this.dereferredValue = dereferredValue; this.actualParameterList = actualParameterList; - if (dereferedValue != null) { - dereferedValue.setFullNameParent(this); + if (dereferredValue != null) { + dereferredValue.setFullNameParent(this); } if (actualParameterList != null) { actualParameterList.setFullNameParent(this); @@ -74,7 +74,7 @@ public final class Unknown_Applied_Statement extends Statement { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (dereferedValue == child) { + if (dereferredValue == child) { return builder.append(FULLNAMEPART1); } else if (actualParameterList == child) { return builder.append(FULLNAMEPART2); @@ -86,8 +86,8 @@ public final class Unknown_Applied_Statement extends Statement { @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (dereferedValue != null) { - dereferedValue.setMyScope(scope); + if (dereferredValue != null) { + dereferredValue.setMyScope(scope); } if (actualParameterList != null) { actualParameterList.setMyScope(scope); @@ -108,12 +108,12 @@ public final class Unknown_Applied_Statement extends Statement { lastTimeChecked = timestamp; - if (dereferedValue == null) { + if (dereferredValue == null) { return; } - dereferedValue.setLoweridToReference(timestamp); - IType type = dereferedValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_TEMPLATE); + dereferredValue.setLoweridToReference(timestamp); + IType type = dereferredValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_TEMPLATE); if (type != null) { type = type.getTypeRefdLast(timestamp); } @@ -127,7 +127,7 @@ public final class Unknown_Applied_Statement extends Statement { switch (type.getTypetype()) { case TYPE_FUNCTION: if (realStatement == null || !Statement_type.S_FUNCTION_APPLIED.equals(realStatement.getType())) { - realStatement = new Function_Applied_Statement(dereferedValue, actualParameterList); + realStatement = new Function_Applied_Statement(dereferredValue, actualParameterList); realStatement.setFullNameParent(this); realStatement.setLocation(location); realStatement.setMyStatementBlock(getMyStatementBlock(), statementIndex); @@ -145,7 +145,7 @@ public final class Unknown_Applied_Statement extends Statement { break; case TYPE_ALTSTEP: if (realStatement == null || !Statement_type.S_ALTSTEP_APPLIED.equals(realStatement.getType())) { - realStatement = new Altstep_Applied_Statement(dereferedValue, actualParameterList); + realStatement = new Altstep_Applied_Statement(dereferredValue, actualParameterList); realStatement.setFullNameParent(this); realStatement.setLocation(location); realStatement.setMyStatementBlock(getMyStatementBlock(), statementIndex); @@ -156,7 +156,7 @@ public final class Unknown_Applied_Statement extends Statement { formalParameterList.checkActualParameterList(timestamp, actualParameterList, tempActualParameters); break; default: - dereferedValue.getLocation().reportSemanticError(MessageFormat.format(FUNCTIONORALTSTEPVALUEXPECTED, type.getTypename())); + dereferredValue.getLocation().reportSemanticError(MessageFormat.format(FUNCTIONORALTSTEPVALUEXPECTED, type.getTypename())); break; } @@ -178,9 +178,9 @@ public final class Unknown_Applied_Statement extends Statement { throw new ReParseException(); } - if (dereferedValue != null) { - dereferedValue.updateSyntax(reparser, false); - reparser.updateLocation(dereferedValue.getLocation()); + if (dereferredValue != null) { + dereferredValue.updateSyntax(reparser, false); + reparser.updateLocation(dereferredValue.getLocation()); } if (actualParameterList != null) { @@ -194,8 +194,8 @@ public final class Unknown_Applied_Statement extends Statement { if (realStatement != null) { realStatement.findReferences(referenceFinder, foundIdentifiers); } else { - if (dereferedValue != null) { - dereferedValue.findReferences(referenceFinder, foundIdentifiers); + if (dereferredValue != null) { + dereferredValue.findReferences(referenceFinder, foundIdentifiers); } if (actualParameterList != null) { actualParameterList.findReferences(referenceFinder, foundIdentifiers); @@ -208,7 +208,7 @@ public final class Unknown_Applied_Statement extends Statement { if (realStatement != null) { return realStatement.accept(v); } else { - if (dereferedValue != null && !dereferedValue.accept(v)) { + if (dereferredValue != null && !dereferredValue.accept(v)) { return false; } if (actualParameterList != null && !actualParameterList.accept(v)) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unmap_Statement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unmap_Statement.java index 41f7c282542bdfa9e5258cd4b2d933f2384a9d07..9e55048fd2f08ff6548eae470c6890cd1edc247b 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unmap_Statement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/statements/Unmap_Statement.java @@ -14,12 +14,12 @@ import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.IValue; -import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.AST.IValue.Value_type; +import org.eclipse.titan.designer.AST.PortReference; import org.eclipse.titan.designer.AST.ReferenceFinder; +import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.Value; -import org.eclipse.titan.designer.AST.IValue.Value_type; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.types.PortTypeBody; import org.eclipse.titan.designer.AST.TTCN3.types.Port_Type; @@ -38,12 +38,12 @@ public final class Unmap_Statement extends Statement { private static final String STATEMENT_NAME = "unmap"; private final Value componentReference1; - private final Reference portReference1; + private final PortReference portReference1; private final Value componentReference2; - private final Reference portReference2; + private final PortReference portReference2; - public Unmap_Statement(final Value componentReference1, final Reference portReference1, final Value componentReference2, - final Reference portReference2) { + public Unmap_Statement(final Value componentReference1, final PortReference portReference1, final Value componentReference2, + final PortReference portReference2) { this.componentReference1 = componentReference1; this.portReference1 = portReference1; this.componentReference2 = componentReference2; @@ -96,15 +96,9 @@ public final class Unmap_Statement extends Statement { if (componentReference1 != null) { componentReference1.setMyScope(scope); } - if (portReference1 != null) { - portReference1.setMyScope(scope); - } if (componentReference2 != null) { componentReference2.setMyScope(scope); } - if (portReference2 != null) { - portReference2.setMyScope(scope); - } } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AllElementsFrom.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AllElementsFrom.java index 64dc1c126a109e003ab363c6141e3f444e9c9e25..de401cf336c917cfc8fd5772c07035c8c0c27479 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AllElementsFrom.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AllElementsFrom.java @@ -128,8 +128,8 @@ public class AllElementsFrom extends TemplateBody { break; case TYPE_TTCN3_SEQUENCE: // it = ((TTCN3_Sequence_Type) rt).getFieldType(timestamp, - // reference, actualSubReference, expected_index, - // interrupt_if_optional) + // reference, actualSubReference, expectedIndex, + // interruptIfOptional) break; default: template.getLocation().reportSemanticError(LISTEXPECTED); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AnyOrOmit_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AnyOrOmit_Template.java index efa6d0a7b51ffab7c602c1a64c98adb3ab636c13..af4849db7e10fbcd1267816b36e11386e1dc1d76 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AnyOrOmit_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/AnyOrOmit_Template.java @@ -95,7 +95,7 @@ public final class AnyOrOmit_Template extends TTCN3Template { @Override public boolean checkPresentRestriction(final CompilationTimeStamp timestamp, final String definitionName, final Location usageLocation) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); usageLocation.reportSemanticError(MessageFormat.format(RESTRICTIONERROR, definitionName, getTemplateTypeName())); return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CharString_Pattern_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CharString_Pattern_Template.java index 3b13f046f4375b8782b2f249e03f8c576dfdb7ac..8598a2213618f1da725c2e5fff0f7673bb4fa8c1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CharString_Pattern_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CharString_Pattern_Template.java @@ -100,7 +100,7 @@ public final class CharString_Pattern_Template extends TTCN3Template { } @Override - public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allow_omit) { + public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) { getLocation().reportSemanticError("A specific value expected instead of an charstring pattern"); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ComplementedList_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ComplementedList_Template.java index 8cee218911af02399bed348dbc69026a98aab943..e7f061ed4d0da1534812c7a6ede0a3e38b7066c7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ComplementedList_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ComplementedList_Template.java @@ -8,9 +8,10 @@ package org.eclipse.titan.designer.AST.TTCN3.templates; import java.text.MessageFormat; - import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.IType.Type_type; +import org.eclipse.titan.designer.AST.IValue; +import org.eclipse.titan.designer.AST.IValue.Value_type; import org.eclipse.titan.designer.AST.Location; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.TemplateRestriction; @@ -82,17 +83,24 @@ public final class ComplementedList_Template extends CompositeTemplate { @Override public void checkThisTemplateGeneric(final CompilationTimeStamp timestamp, final IType type, final boolean isModified, final boolean allowOmit, final boolean allowAnyOrOmit, final boolean subCheck, final boolean implicitOmit) { + + if(type == null){ + return; + } + + boolean allowOmitInValueList = allowOmitInValueList(allowOmit); + for (int i = 0, size = templates.getNofTemplates(); i < size; i++) { ITemplateListItem component = templates.getTemplateByIndex(i); component.setMyGovernor(type); ITTCN3Template temporalComponent = type.checkThisTemplateRef(timestamp, component); - temporalComponent.checkThisTemplateGeneric(timestamp, type, false, allowOmit, true, subCheck, implicitOmit); + temporalComponent.checkThisTemplateGeneric(timestamp, type, false, allowOmitInValueList, true, subCheck, implicitOmit); if (Template_type.ANY_OR_OMIT.equals(temporalComponent.getTemplatetype())) { component.getLocation().reportSemanticWarning(ANYOROMITWARNING); } } - + checkLengthRestriction(timestamp, type); if (!allowOmit && isIfpresent) { location.reportSemanticError("`ifpresent' is not allowed here"); @@ -102,13 +110,46 @@ public final class ComplementedList_Template extends CompositeTemplate { } } + /** + * If ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY is switched on + * and has AnyOrOmit (=AnyOrNone) or omit in the list then accepted, otherwise not + */ @Override public boolean checkPresentRestriction(final CompilationTimeStamp timestamp, final String definitionName, final Location usageLocation) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); - - //TODO: if ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY is switched on and has any or omit in the list then accepted, otherwise not - //Old solution has been removed - + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); + + boolean allowOmitInValueList = allowOmitInValueList(true); + if(allowOmitInValueList) { + boolean hasAnyOrOmit = false; + for (int i = 0, size = templates.getNofTemplates(); i < size; i++) { + ITemplateListItem component = templates.getTemplateByIndex(i); + + // === if OMIT_VALUE then hasOmitValue=true and break ==== + // componentType == ITTCN3Template.Template_type.OMIT_VALUE does not work + // TODO: put this if-block to a higher level + //TODO: avoid NPE (?) + if(component instanceof TemplateBody) { + ITTCN3Template template = ((TemplateBody) component).getTemplate(); + if(Template_type.SPECIFIC_VALUE.equals(template.getTemplatetype())){ + IValue value = ((SpecificValue_Template) template).getSpecificValue(); + if( Value_type.OMIT_VALUE.equals(value.getValuetype())){ + hasAnyOrOmit = true; + break; + } + } + } + TTCN3Template.Template_type componentType = component.getTemplatetype(); + if (ITTCN3Template.Template_type.ANY_OR_OMIT.equals(componentType)) { + hasAnyOrOmit = true; + break; + } + + } + if (!hasAnyOrOmit) { + location.reportSemanticError(MessageFormat.format(RESTRICTIONERROR+" without omit or AnyValueOrNone in the list", definitionName, getTemplateTypeName())); + return false; + } + } // some basic check was performed, always needs runtime check return true; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CompositeTemplate.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CompositeTemplate.java index 056e5df08542416a22821f5e67defc998e7307ea..719ee44e02af61d01108272b89fbd049c26f93a7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CompositeTemplate.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/CompositeTemplate.java @@ -9,9 +9,16 @@ package org.eclipse.titan.designer.AST.TTCN3.templates; import java.util.List; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IReferenceChain; +import org.eclipse.titan.designer.AST.Location; +import org.eclipse.titan.designer.AST.NULL_Location; import org.eclipse.titan.designer.AST.ReferenceFinder; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; @@ -19,6 +26,8 @@ import org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException; import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; +import org.eclipse.titan.designer.properties.data.ProjectBuildPropertyData; +import org.eclipse.titan.designer.properties.data.TITANFlagsOptionsData; /** * @author Kristof Szabados @@ -232,4 +241,57 @@ public abstract class CompositeTemplate extends TTCN3Template { } return true; } + + /** Test if omit is allowed in a value list + * <p> + * Uses TITANFlagsOptionsData.ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY: + * (It is the same as -M flag of makefilegen) <p> + * If it is true the old syntax allowed. + * If it is false then only the new syntax is allowed.<p> + * For example:<p/> + * ( 1 ifpresent, 2 ifpresent, omit ) //=> allowed in old solution, + * not allowed in new solution (3 error markers)<p> + * ( 1, 2 ) ifpresent //= only this allowed in new solution when this function returns false<p> + * + * @param allowOmit true if the field is optional field, + * false if the field is mandatory.<p> + * Of course in this case omit value and the ifpresent clause is prohibitied=> returns false<p> + * @return + * If allowOmit == false it returns false + * ( quick exit for mandatory fields). + * If allowOmit == true it returns according to the + * project property setting + * TITANFlagsOptionsData.ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY + */ + final protected boolean allowOmitInValueList(boolean allowOmit) { + if( !allowOmit ) { + return false; + } + + Location loc = this.getLocation(); + if(loc == null || (loc instanceof NULL_Location)) { + return true; + } + + IResource f = loc.getFile(); + if( f == null) { + return true; + } + + IProject project = f.getProject(); + if(project == null) { + return true; + } + + QualifiedName qn = new QualifiedName(ProjectBuildPropertyData.QUALIFIER,TITANFlagsOptionsData.ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY); + try { + String s= project.getPersistentProperty(qn); + return ( "true".equals(s)); + } catch (CoreException e) { + ErrorReporter.logExceptionStackTrace(e); + return true; + } + + } + } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ITTCN3Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ITTCN3Template.java index b39216fe8bee3d8a513eeb17a3a513708e7d2f0d..34c095bc6dba2eaee4b7dfbdcd7ad4b3d0a9fb05 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ITTCN3Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ITTCN3Template.java @@ -226,14 +226,14 @@ public interface ITTCN3Template extends IGovernedSimple { * * @param timestamp * the time stamp of the actual semantic check cycle. - * @param new_type + * @param newType * the new template_type the new template should belong * to. * * @return the new template of the provided kind if the conversion is * possible, or this template otherwise. * */ - ITTCN3Template setTemplatetype(final CompilationTimeStamp timestamp, final Template_type new_type); + ITTCN3Template setTemplatetype(final CompilationTimeStamp timestamp, final Template_type newType); /** * Calculates the return type of the template when used in an @@ -351,7 +351,7 @@ public interface ITTCN3Template extends IGovernedSimple { * @param usageLocation * the location to be used for reporting errors * */ - void checkRestrictionCommon(final String definitionName, final TemplateRestriction.Restriction_type templateRestriction, final Location usageLocation); + void checkRestrictionCommon(final CompilationTimeStamp timestamp, final String definitionName, final TemplateRestriction.Restriction_type templateRestriction, final Location usageLocation); /** * Checks if this template conforms to the restriction TR_OMIT or diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Indexed_Template_List.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Indexed_Template_List.java index c6350faac6cf7de86d15f5cd3e655793f7cfe7c6..3fae5f67a43460d0ffa145ad3f6970bd634dfad2 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Indexed_Template_List.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Indexed_Template_List.java @@ -15,12 +15,12 @@ import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IReferenceChain; import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.IValue; +import org.eclipse.titan.designer.AST.IValue.Value_type; import org.eclipse.titan.designer.AST.Location; import org.eclipse.titan.designer.AST.ReferenceChain; import org.eclipse.titan.designer.AST.ReferenceFinder; -import org.eclipse.titan.designer.AST.Scope; -import org.eclipse.titan.designer.AST.IValue.Value_type; import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; +import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.TemplateRestriction; import org.eclipse.titan.designer.AST.TTCN3.types.Array_Type; @@ -317,9 +317,9 @@ public final class Indexed_Template_List extends TTCN3Template { @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } for (int i = 0, size = indexedTemplates.getNofTemplates(); i < size; i++) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Invoke_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Invoke_Template.java index f00f1c3119031a6394bae30d036288cf5187faca..ab84d0d7ad3d434523b3f0616211deceee06ac2b 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Invoke_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Invoke_Template.java @@ -164,12 +164,12 @@ public final class Invoke_Template extends TTCN3Template { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (getIsErroneous(timestamp) || value == null) { return Type_type.TYPE_UNDEFINED; } - IType type = value.getExpressionGovernor(timestamp, expected_value); + IType type = value.getExpressionGovernor(timestamp, expectedValue); if (type == null) { return Type_type.TYPE_UNDEFINED; } @@ -252,9 +252,9 @@ public final class Invoke_Template extends TTCN3Template { @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } return false; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/LengthRestriction.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/LengthRestriction.java index b99b4707b9192e1b73e514f3e4378ec09d714569..bd96fae38616113128af42c81e4cc656aea63259 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/LengthRestriction.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/LengthRestriction.java @@ -59,10 +59,10 @@ public abstract class LengthRestriction extends ASTNode implements ILocateableNo * * @param timestamp * the time stamp of the actual semantic check cycle. - * @param expected_value + * @param expectedValue * the value kind expected. * */ - public abstract void check(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value); + public abstract void check(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue); /** * Checks if the length restriction is valid for the array type. diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NamedTemplate.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NamedTemplate.java index e24120717cbecd2a47e6a94d07dfc578c2d2b7fd..98441bb228e5f269f9ba104df4caba6698180ce5 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NamedTemplate.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NamedTemplate.java @@ -177,6 +177,9 @@ public final class NamedTemplate extends ASTNode implements ILocateableNode, IIn INamedNode inamedNode = getNameParent(); while (!(inamedNode instanceof Named_Template_List)) { + if( inamedNode == null) { + return null; //FIXME: this is just a temp solution! find the reason! + } inamedNode = inamedNode.getNameParent(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Named_Template_List.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Named_Template_List.java index 2d6dccb262f9e3c4c058a41ab3faba40bc83d80a..5744d7c5e5ad6c1662932a7caee7cd617b0846cb 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Named_Template_List.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Named_Template_List.java @@ -360,9 +360,9 @@ public final class Named_Template_List extends TTCN3Template { @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } boolean needsRuntimeCheck = false; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NotUsed_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NotUsed_Template.java index 696032b6e4cd03c33964f1894e059fb2ae63b259..bcf7515a2f6bd47b063032e6a023245dfa21c86e 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NotUsed_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/NotUsed_Template.java @@ -81,9 +81,9 @@ public final class NotUsed_Template extends TTCN3Template { @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } if (baseTemplate != null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/OmitValue_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/OmitValue_Template.java index d25c5325c9ef825418f737c037a43546a937cf81..a8933e69e9a0a76a9b29c49218505fd162f41eca 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/OmitValue_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/OmitValue_Template.java @@ -120,9 +120,9 @@ public final class OmitValue_Template extends TTCN3Template { @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); usageLocation.reportSemanticError(MessageFormat.format(RESTRICTIONERROR, definitionName, getTemplateTypeName())); } @@ -131,7 +131,7 @@ public final class OmitValue_Template extends TTCN3Template { @Override public boolean checkPresentRestriction(final CompilationTimeStamp timestamp, final String definitionName, final Location usageLocation) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); usageLocation.reportSemanticError(MessageFormat.format(RESTRICTIONERROR, definitionName, getTemplateTypeName())); return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/PermutationMatch_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/PermutationMatch_Template.java index 2764ea185f66faf805f2001b9867f1023317ff2b..31e0e0bce88aa3fdfb3be11b00ff95f28bd510ff 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/PermutationMatch_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/PermutationMatch_Template.java @@ -36,7 +36,7 @@ public final class PermutationMatch_Template extends CompositeTemplate { } @Override - public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allow_omit) { + public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) { getLocation().reportSemanticError("A specific value expected instead of a permutation match"); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/RangeLenghtRestriction.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/RangeLenghtRestriction.java index 253aee00d2162cbb565fdbc108e5b61b18c4de6d..5eab48cf63899b19b19afcb868b94b471e3c3306 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/RangeLenghtRestriction.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/RangeLenghtRestriction.java @@ -126,7 +126,7 @@ public final class RangeLenghtRestriction extends LengthRestriction { } @Override - public void check(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public void check(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) { return; } @@ -135,7 +135,7 @@ public final class RangeLenghtRestriction extends LengthRestriction { Integer_Type integer = new Integer_Type(); lower.setMyGovernor(integer); IValue last = integer.checkThisValueRef(timestamp, lower); - integer.checkThisValueLimit(timestamp, last, expected_value, false, false, true, false); + integer.checkThisValueLimit(timestamp, last, expectedValue, false, false, true, false); IReferenceChain chain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true); IValue valueLower = last.getValueRefdLast(timestamp, chain); @@ -168,7 +168,7 @@ public final class RangeLenghtRestriction extends LengthRestriction { upper.setMyGovernor(integer); last = integer.checkThisValueRef(timestamp, upper); - integer.checkThisValueLimit(timestamp, last, expected_value, false, false, true, false); + integer.checkThisValueLimit(timestamp, last, expectedValue, false, false, true, false); chain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true); IValue valueUpper = last.getValueRefdLast(timestamp, chain); @@ -262,7 +262,7 @@ public final class RangeLenghtRestriction extends LengthRestriction { @Override public void checkNofElements(final CompilationTimeStamp timestamp, final int nofElements, final boolean lessAllowed, - final boolean more_allowed, final boolean has_anyornone, final ILocateableNode locatable) { + final boolean moreAllowed, final boolean hasAnyornone, final ILocateableNode locatable) { if (lower == null) { return; } @@ -293,10 +293,10 @@ public final class RangeLenghtRestriction extends LengthRestriction { if (Value_type.INTEGER_VALUE.equals(last.getValuetype()) && !last.getIsErroneous(timestamp)) { BigInteger length = ((Integer_Value) last).getValueValue(); - if (length.compareTo(BigInteger.valueOf(nofElements)) == -1 && !more_allowed) { + if (length.compareTo(BigInteger.valueOf(nofElements)) == -1 && !moreAllowed) { final String message = MessageFormat.format( "There are more ({0} {1}) elements than it is allowed by the length restriction ({2})", - has_anyornone ? "at least" : "", nofElements, length); + hasAnyornone ? "at least" : "", nofElements, length); locatable.getLocation().reportSemanticError(message); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Referenced_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Referenced_Template.java index ecdf116cc4be7c90e4f889afd92af609a889ca05..16f78a6a0c722369da9dc8cda89fadc73ca61b78 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Referenced_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Referenced_Template.java @@ -182,9 +182,9 @@ public final class Referenced_Template extends TTCN3Template { * reference too. * * @param timestamp - * the time stamp of the actual semantic check cycle. + * the time stamp of the actual semantic check cycle. * @param referenceChain - * the reference chain used to detect cyclic references. + * the reference chain used to detect cyclic references. * * @return the template referenced * */ @@ -263,13 +263,13 @@ public final class Referenced_Template extends TTCN3Template { } /** - * Returns whether in the chain of referenced templates there is one which - * was defined to have the implicit omit attribute set + * Returns whether in the chain of referenced templates there is one + * which was defined to have the implicit omit attribute set * * @param timestamp - * the time stamp of the actual semantic check cycle. + * the time stamp of the actual semantic check cycle. * @param referenceChain - * the ReferenceChain used to detect circular references + * the ReferenceChain used to detect circular references * * @return true if it has, false otherwise. * */ @@ -369,7 +369,7 @@ public final class Referenced_Template extends TTCN3Template { TypeCompatibilityInfo info = new TypeCompatibilityInfo(type, governor, true); if (!type.isCompatible(timestamp, governor, info, null, null)) { - IType last = type.getTypeRefdLast(timestamp); + IType last = type.getTypeRefdLast(timestamp); switch (last.getTypetype()) { case TYPE_PORT: @@ -405,9 +405,9 @@ public final class Referenced_Template extends TTCN3Template { public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } if (reference != null) { @@ -444,7 +444,7 @@ public final class Referenced_Template extends TTCN3Template { @Override public boolean checkPresentRestriction(final CompilationTimeStamp timestamp, final String definitionName, final Location usageLocation) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); if (reference != null) { Assignment ass = reference.getRefdAssignment(timestamp, true); switch (ass.getAssignmentType()) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SingleLenghtRestriction.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SingleLenghtRestriction.java index 6b9b26485a37b5c92066ab7c55de03e63c78dc8d..d71b8cd9f7dcb40a9100bd0e539ac319838d0621 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SingleLenghtRestriction.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SingleLenghtRestriction.java @@ -85,7 +85,7 @@ public final class SingleLenghtRestriction extends LengthRestriction { } @Override - public void check(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public void check(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) { return; } @@ -97,7 +97,7 @@ public final class SingleLenghtRestriction extends LengthRestriction { } value.setMyGovernor(integer); IValue last = integer.checkThisValueRef(timestamp, value); - integer.checkThisValue(timestamp, last, new ValueCheckingOptions(expected_value, false, false, true, false, false)); + integer.checkThisValue(timestamp, last, new ValueCheckingOptions(expectedValue, false, false, true, false, false)); IReferenceChain chain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true); last = last.getValueRefdLast(timestamp, chain); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SpecificValue_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SpecificValue_Template.java index 309f83afa5b84d146d60e809404c5e6e179fd9a1..98b467b7aad50a7f857f6d7617ab563775547679 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SpecificValue_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SpecificValue_Template.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2000-2015 Ericsson Telecom AB + * Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,17 +13,18 @@ import org.eclipse.titan.designer.AST.ASTVisitor; import org.eclipse.titan.designer.AST.Assignment; import org.eclipse.titan.designer.AST.IReferenceChain; import org.eclipse.titan.designer.AST.IType; +import org.eclipse.titan.designer.AST.IType.Type_type; +import org.eclipse.titan.designer.AST.IType.ValueCheckingOptions; import org.eclipse.titan.designer.AST.IValue; +import org.eclipse.titan.designer.AST.IValue.Value_type; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Location; +import org.eclipse.titan.designer.AST.NULL_Location; import org.eclipse.titan.designer.AST.Reference; import org.eclipse.titan.designer.AST.ReferenceChain; import org.eclipse.titan.designer.AST.ReferenceFinder; -import org.eclipse.titan.designer.AST.Scope; -import org.eclipse.titan.designer.AST.IType.Type_type; -import org.eclipse.titan.designer.AST.IType.ValueCheckingOptions; -import org.eclipse.titan.designer.AST.IValue.Value_type; import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; +import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable; import org.eclipse.titan.designer.AST.TTCN3.TemplateRestriction; @@ -31,6 +32,7 @@ import org.eclipse.titan.designer.AST.TTCN3.types.Function_Type; import org.eclipse.titan.designer.AST.TTCN3.values.Bitstring_Value; import org.eclipse.titan.designer.AST.TTCN3.values.Charstring_Value; import org.eclipse.titan.designer.AST.TTCN3.values.Expression_Value; +import org.eclipse.titan.designer.AST.TTCN3.values.Expression_Value.Operation_type; import org.eclipse.titan.designer.AST.TTCN3.values.Function_Reference_Value; import org.eclipse.titan.designer.AST.TTCN3.values.Hexstring_Value; import org.eclipse.titan.designer.AST.TTCN3.values.Octetstring_Value; @@ -39,7 +41,6 @@ import org.eclipse.titan.designer.AST.TTCN3.values.SequenceOf_Value; import org.eclipse.titan.designer.AST.TTCN3.values.SetOf_Value; import org.eclipse.titan.designer.AST.TTCN3.values.Undefined_LowerIdentifier_Value; import org.eclipse.titan.designer.AST.TTCN3.values.UniversalCharstring_Value; -import org.eclipse.titan.designer.AST.TTCN3.values.Expression_Value.Operation_type; import org.eclipse.titan.designer.AST.TTCN3.values.expressions.ApplyExpression; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException; @@ -161,10 +162,7 @@ public final class SpecificValue_Template extends TTCN3Template { lastTimeChecked = timestamp; realTemplate = this; - - if (getIsErroneous(timestamp)) { - return this; - } + isErroneous = false; IValue temp = specificValue.setLoweridToReference(timestamp); @@ -203,7 +201,7 @@ public final class SpecificValue_Template extends TTCN3Template { } @Override - public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allow_omit) { + public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) { if (specificValue == null) { return; } @@ -213,7 +211,7 @@ public final class SpecificValue_Template extends TTCN3Template { // checked later break; case OMIT_VALUE: - if (!allow_omit) { + if (!allowOmit) { getLocation().reportSemanticError(OmitValue_Template.SPECIFICVALUEEXPECTED); } return; @@ -236,7 +234,7 @@ public final class SpecificValue_Template extends TTCN3Template { if (Type_type.TYPE_FUNCTION.equals(type.getTypetype()) && ((Function_Type) type).returnsTemplate()) { ITTCN3Template template = setTemplatetype(timestamp, Template_type.TEMPLATE_INVOKE); - template.checkSpecificValue(timestamp, allow_omit); + template.checkSpecificValue(timestamp, allowOmit); } } @@ -329,7 +327,11 @@ public final class SpecificValue_Template extends TTCN3Template { checkLengthRestriction(timestamp, type); if (!allowOmit && isIfpresent) { - location.reportSemanticError("`ifpresent' is not allowed here"); + if( location != null && !(location instanceof NULL_Location)) { + location.reportSemanticError("`ifpresent' is not allowed here"); + } else if(specificValue != null && !(specificValue.getLocation() instanceof NULL_Location)) { + specificValue.getLocation().reportSemanticError("`ifpresent' is not allowed here"); + } } if (subCheck) { type.checkThisTemplateSubtype(timestamp, this); @@ -445,9 +447,9 @@ public final class SpecificValue_Template extends TTCN3Template { @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } return false; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SubsetMatch_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SubsetMatch_Template.java index 48df97f3a1747bdc8532883f9c9af55963c5b981..959fa4871c15d986c4121e2937d6f0ef11a2d6ba 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SubsetMatch_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SubsetMatch_Template.java @@ -46,7 +46,7 @@ public final class SubsetMatch_Template extends CompositeTemplate { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (getIsErroneous(timestamp)) { return Type_type.TYPE_UNDEFINED; } @@ -55,7 +55,7 @@ public final class SubsetMatch_Template extends CompositeTemplate { } @Override - public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allow_omit) { + public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) { getLocation().reportSemanticError("A specific value expected instead of a subset match"); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SupersetMatch_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SupersetMatch_Template.java index 894d50cf9801add552b7d20bfeaeb4994cfeb2e6..2e7fc935ac27313a6cbc9198a7bff61f1cc840b8 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SupersetMatch_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/SupersetMatch_Template.java @@ -37,7 +37,7 @@ public final class SupersetMatch_Template extends CompositeTemplate { } @Override - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (getIsErroneous(timestamp)) { return Type_type.TYPE_UNDEFINED; } @@ -46,7 +46,7 @@ public final class SupersetMatch_Template extends CompositeTemplate { } @Override - public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allow_omit) { + public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) { getLocation().reportSemanticError("A specific value expected instead of a superset match"); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TTCN3Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TTCN3Template.java index ebba39a8a5ebb995ad6a51d6408037214f59d002..ca1ae8c60e1f64b90753e6fecf4b2912f0638611 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TTCN3Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TTCN3Template.java @@ -56,7 +56,7 @@ import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; public abstract class TTCN3Template extends GovernedSimple implements IReferenceChainElement, ITTCN3Template, IIncrementallyUpdateable { protected static final String RESTRICTIONERROR = "Restriction on {0} does not allow usage of `{1}''"; protected static final String OMITRESTRICTIONERROR = "Restriction 'omit' on {0} does not allow usage of `{1}''"; - protected static final String VALUERESTRICTIONERROR = "Restriction 'value' on {0} does not allow usage of `{1}''"; + protected static final String VALUERESTRICTIONERROR = "Restriction ''value'' on {0} does not allow usage of {1}"; protected static final String PRESENTRESTRICTIONERROR = "Restriction 'present' on {0} does not allow usage of `{1}''"; private static final String LENGTHRESTRICTIONERROR = "Restriction on {0} does not allow usage of length restriction"; @@ -972,9 +972,13 @@ public abstract class TTCN3Template extends GovernedSimple implements IReference * the location to be used for reporting errors * */ @Override - public final void checkRestrictionCommon(final String definitionName, final TemplateRestriction.Restriction_type templateRestriction, final Location usageLocation) { + public final void checkRestrictionCommon(final CompilationTimeStamp timestamp, final String definitionName, final TemplateRestriction.Restriction_type templateRestriction, final Location usageLocation) { switch (templateRestriction) { case TR_VALUE: + if (!isValue(timestamp)) { + usageLocation.reportSemanticError(MessageFormat.format(VALUERESTRICTIONERROR, definitionName, "not completely initialized template")); + } + //Intentional fall-through case TR_OMIT: if (lengthRestriction != null) { usageLocation.reportSemanticError(MessageFormat.format(LENGTHRESTRICTIONERROR, definitionName)); @@ -984,7 +988,7 @@ public abstract class TTCN3Template extends GovernedSimple implements IReference } break; case TR_PRESENT: - if (isIfpresent) { + if (isIfpresent || getTemplateReferencedLast(timestamp).isIfpresent) { usageLocation.reportSemanticError(MessageFormat.format(PRESENTRESTRICTIONERROR, definitionName, "ifpresent")); } break; @@ -1015,9 +1019,9 @@ public abstract class TTCN3Template extends GovernedSimple implements IReference @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } usageLocation.reportSemanticError(MessageFormat.format(RESTRICTIONERROR, definitionName, getTemplateTypeName())); @@ -1063,7 +1067,7 @@ public abstract class TTCN3Template extends GovernedSimple implements IReference */ @Override public boolean checkPresentRestriction(final CompilationTimeStamp timestamp, final String definitionName, final Location usageLocation) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TemplateBody.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TemplateBody.java index 498e84023749f4899d27895252eedaea42360bc3..4676356a3b4f4f0c8c6815060561c76dde264b48 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TemplateBody.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/TemplateBody.java @@ -140,8 +140,8 @@ public class TemplateBody implements ITemplateListItem { @Override public ITTCN3Template setTemplatetype(CompilationTimeStamp timestamp, - Template_type new_type) { - return template.setTemplatetype(timestamp,new_type); + Template_type newType) { + return template.setTemplatetype(timestamp, newType); } @Override @@ -189,9 +189,9 @@ public class TemplateBody implements ITemplateListItem { } @Override - public void checkRestrictionCommon(String definitionName, + public void checkRestrictionCommon(final CompilationTimeStamp timestamp, String definitionName, Restriction_type templateRestriction, final Location usageLocation) { - template.checkRestrictionCommon(definitionName, templateRestriction, usageLocation); + template.checkRestrictionCommon(timestamp, definitionName, templateRestriction, usageLocation); } @Override @@ -219,8 +219,8 @@ public class TemplateBody implements ITemplateListItem { } @Override - public void setIsErroneous(boolean is_erroneous) { - template.setIsErroneous(is_erroneous); + public void setIsErroneous(boolean isErroneous) { + template.setIsErroneous(isErroneous); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Template_List.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Template_List.java index 6f91c24c005925f1a7c48d2255ef17703fcc5166..391316155922def32e2c0e59bf7e24e29a047a87 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Template_List.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/Template_List.java @@ -236,7 +236,7 @@ public final class Template_List extends CompositeTemplate { } @Override - public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allow_omit) { + public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) { for (int i = 0, size = templates.getNofTemplates(); i < size; i++) { templates.getTemplateByIndex(i).checkSpecificValue(timestamp, true); } @@ -256,9 +256,9 @@ public final class Template_List extends CompositeTemplate { @Override public boolean checkValueomitRestriction(final CompilationTimeStamp timestamp, final String definitionName, final boolean omitAllowed, final Location usageLocation) { if (omitAllowed) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_OMIT, usageLocation); } else { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_VALUE, usageLocation); } boolean needsRuntimeCheck = false; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueList_Template.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueList_Template.java index ea0b8574b8308d85cf2a567da3db37d32b8365b3..d5d5552f4ea2c7dbfb979dd6a6932eb8bfa101d0 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueList_Template.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueList_Template.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2000-2015 Ericsson Telecom AB + * Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,7 @@ package org.eclipse.titan.designer.AST.TTCN3.templates; import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.IType.Type_type; import org.eclipse.titan.designer.AST.Location; +import org.eclipse.titan.designer.AST.NULL_Location; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.TemplateRestriction; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; @@ -76,23 +77,27 @@ public final class ValueList_Template extends CompositeTemplate { final boolean allowOmit, final boolean allowAnyOrOmit, final boolean subCheck, final boolean implicitOmit) { if(type == null){ return; - } + } + boolean allowOmitInValueList = allowOmitInValueList(allowOmit); + for (int i = 0, size = templates.getNofTemplates(); i < size; i++) { ITemplateListItem component = templates.getTemplateByIndex(i); component.setMyGovernor(type); ITTCN3Template temporalComponent = type.checkThisTemplateRef(timestamp, component); - temporalComponent.checkThisTemplateGeneric(timestamp, type, false, allowOmit, true, subCheck, implicitOmit); + temporalComponent.checkThisTemplateGeneric(timestamp, type, false, allowOmitInValueList, true, subCheck, implicitOmit); } checkLengthRestriction(timestamp, type); if (!allowOmit && isIfpresent) { - location.reportSemanticError("`ifpresent' is not allowed here"); + if( location != null && !(location instanceof NULL_Location)) { + location.reportSemanticError("`ifpresent' is not allowed here"); + } } if (subCheck) { type.checkThisTemplateSubtype(timestamp, this); } } - + @Override public void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) { getLocation().reportSemanticError("A specific value was expected instead of value list match"); @@ -100,7 +105,7 @@ public final class ValueList_Template extends CompositeTemplate { @Override public boolean checkPresentRestriction(final CompilationTimeStamp timestamp, final String definitionName, final Location usageLocation) { - checkRestrictionCommon(definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); + checkRestrictionCommon(timestamp, definitionName, TemplateRestriction.Restriction_type.TR_PRESENT, usageLocation); boolean needsRuntimeCheck = false; for (int i = 0, size = templates.getNofTemplates(); i < size; i++) { ITTCN3Template component = templates.getTemplateByIndex(i); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueRange.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueRange.java index 371041de76953bdaafbfa27d001b3b2483e430ac..a77520849774edfe386c7ddfe72c405359dcf420 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueRange.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/templates/ValueRange.java @@ -109,21 +109,21 @@ public final class ValueRange extends ASTNode implements IIncrementallyUpdateabl * * @param timestamp * the actual semantic checking cycle - * @param expected_value + * @param expectedValue * the kind of the value to be expected. * * @return the governor of the value range * */ - public IType getExpressionGovernor(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public IType getExpressionGovernor(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (min != null) { - IType type = min.getExpressionGovernor(timestamp, expected_value); + IType type = min.getExpressionGovernor(timestamp, expectedValue); if (type != null) { return type; } } if (max != null) { - IType type = max.getExpressionGovernor(timestamp, expected_value); + IType type = max.getExpressionGovernor(timestamp, expectedValue); if (type != null) { return type; } @@ -137,21 +137,21 @@ public final class ValueRange extends ASTNode implements IIncrementallyUpdateabl * * @param timestamp * the actual semantic checking cycle - * @param expected_value + * @param expectedValue * the kind of the value to be expected. * * @return the returning type of the value range * */ - public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expected_value) { + public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { if (min != null) { - Type_type type = min.getExpressionReturntype(timestamp, expected_value); + Type_type type = min.getExpressionReturntype(timestamp, expectedValue); if (!Type_type.TYPE_UNDEFINED.equals(type)) { return type; } } if (max != null) { - Type_type type = max.getExpressionReturntype(timestamp, expected_value); + Type_type type = max.getExpressionReturntype(timestamp, expectedValue); if (!Type_type.TYPE_UNDEFINED.equals(type)) { return type; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Altstep_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Altstep_Type.java index 1c5bc9b8fbc6bc120a03541a80da4f8a419ade24..9702b47a37e4d725466e7eca1a3ee5604e58a131 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Altstep_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Altstep_Type.java @@ -250,7 +250,7 @@ public final class Altstep_Type extends Type { Def_Altstep altstep = null; switch (last.getValuetype()) { case ALTSTEP_REFERENCE_VALUE: - altstep = ((Altstep_Reference_Value) last).getReferedAltstep(); + altstep = ((Altstep_Reference_Value) last).getReferredAltstep(); if (altstep == null) { setIsErroneous(true); return; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Array_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Array_Type.java index 44bae6331eafd70c283027695f9f881f22c166c8..867587034486ff79b5169f27140803d2d18c5cc1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Array_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Array_Type.java @@ -467,14 +467,9 @@ public final class Array_Type extends Type implements IReferenceableElement { int nofValues = lastValue.getNofComponents(); - if (!dimension.getIsErroneous(timestamp) && dimension.getSize() != nofValues) { - if (nofValues < dimension.getSize()) { - originalValue.getLocation().reportSemanticError(MessageFormat.format(TOOFEWEXPECTED, dimension.getSize(), nofValues)); - originalValue.setIsErroneous(true); - } else { + if (!dimension.getIsErroneous(timestamp) && dimension.getSize() < nofValues) { originalValue.getLocation().reportSemanticError(MessageFormat.format(TOOMANYEXPECTED, dimension.getSize(), nofValues)); originalValue.setIsErroneous(true); - } } if (lastValue.isIndexed()) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/CompField.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/CompField.java index 2451d1168e85f8c1a070d88966b7d75cd7cb743c..1f573ac8a7e1b2f9f4303417b41abbdd550e5553 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/CompField.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/CompField.java @@ -345,6 +345,9 @@ public final class CompField extends ASTNode INamedNode inamedNode = getNameParent(); while (!(inamedNode instanceof Definition)) { + if( inamedNode == null) { + return null; //FIXME: this is just a temp solution! find the reason! + } inamedNode = inamedNode.getNameParent(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/ComponentTypeBody.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/ComponentTypeBody.java index db08e7c71585b9ee614af42b92763aea8b83b630..87fb7c1ed50dd25b3f0aaf28e5fab1d3afb97dd3 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/ComponentTypeBody.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/ComponentTypeBody.java @@ -104,6 +104,7 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha * */ private Map<String, Definition> attributeGainedDefinitions = new HashMap<String, Definition>(); + /** the with attributes of the definition does not belong to the componentTypeBody naturally !*/ private WithAttributesPath withAttributesPath; // the component type to which this body belongs. @@ -596,6 +597,7 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha lastUniquenessCheck = timestamp; compatibleBodies.clear(); + definitions.checkUniqueness(); addDefinitionsOfExtendsParents(timestamp); addDefinitionsOfExtendAttributeParents(timestamp); @@ -660,7 +662,7 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha } } } else { - extendsGainedDefinitions.put(definition.getIdentifier().getName(), definition); + extendsGainedDefinitions.put(name, definition); if (!definition.getMyScope().getModuleScope().equals(parentScope.getModuleScope())) { if (parentScope.hasAssignmentWithId(timestamp, definition.getIdentifier())) { @@ -900,9 +902,6 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha if (attrExtendsReferences != null) { attrExtendsReferences.findReferences(referenceFinder, foundIdentifiers); } - if (withAttributesPath != null) { - withAttributesPath.findReferences(referenceFinder, foundIdentifiers); - } } @Override @@ -931,11 +930,6 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha return false; } } - if (withAttributesPath != null) { - if (!withAttributesPath.accept(v)) { - return false; - } - } if (v.leave(this)==ASTVisitor.V_ABORT) { return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Component_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Component_Type.java index 43b61c15854233ad9bd987ccd702dfae40860db6..934ea0098281c33af8ab2a12022d501e0cc9ef49 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Component_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Component_Type.java @@ -60,6 +60,8 @@ public final class Component_Type extends Type { private static final String COMPONENTVALUEEXPECTED = "Component value was expected"; private static final String TEMPLATENOTALLOWED = "{0} cannot be used for type `{1}''"; private static final String LENGTHRESTRICTIONNOTALLOWED = "Length restriction is not allowed for type `{0}''"; + private static final String INVALIDSUBREFERENCE = "Referencing fields of a component is not allowed"; + private static final String[] SIMPLE_COMPONENT_PROPOSALS = new String[] {"alive", "create;", "create alive;", "done", "kill;", "killed", "running", "stop;" }; @@ -227,7 +229,7 @@ public final class Component_Type extends Type { return null; case fieldSubReference: subreference.getLocation().reportSemanticError( - MessageFormat.format(FieldSubReference.INVALIDSUBREFERENCE, ((FieldSubReference) subreference).getId().getDisplayName(), + MessageFormat.format(INVALIDSUBREFERENCE, ((FieldSubReference) subreference).getId().getDisplayName(), getTypename())); return null; case parameterisedSubReference: diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/DefinitionContainer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/DefinitionContainer.java index 65291ba04730c118b72a9bab5b29b21511f32f68..c0c1bdf854afcc3c9de93227d36be3afc927aeee 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/DefinitionContainer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/DefinitionContainer.java @@ -75,6 +75,22 @@ public class DefinitionContainer implements Iterable<Definition> { } } + public void checkUniqueness() { + definitionMap.clear(); + + for(Definition definition: definitions) { + String definitionName = definition.getIdentifier().getName(); + if (definitionMap.containsKey(definitionName)) { + definitionMap.get(definitionName).getIdentifier().getLocation().reportSingularSemanticError( + MessageFormat.format(CompFieldMap.DUPLICATEFIELDNAMEFIRST, definition.getIdentifier().getDisplayName())); + definition.getIdentifier().getLocation().reportSemanticError( + MessageFormat.format(CompFieldMap.DUPLICATEFIELDNAMEREPEATED, definition.getIdentifier().getDisplayName())); + } else { + definitionMap.put(definitionName, definition); + } + } + } + public boolean isEmpty() { return definitions.isEmpty(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/EnumItem.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/EnumItem.java index 5f4de7ac81eb1c6958163905072033bd375fee31..13083934bdfe69ededd104e54e07b1c5862a1018 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/EnumItem.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/EnumItem.java @@ -11,18 +11,19 @@ import java.util.List; import org.eclipse.titan.designer.AST.ASTNode; import org.eclipse.titan.designer.AST.ASTVisitor; +import org.eclipse.titan.designer.AST.Assignment; import org.eclipse.titan.designer.AST.ILocateableNode; -import org.eclipse.titan.designer.AST.INamedNode; import org.eclipse.titan.designer.AST.IReferencingElement; import org.eclipse.titan.designer.AST.ISubReference; -import org.eclipse.titan.designer.AST.ITypeWithComponents; +import org.eclipse.titan.designer.AST.IType; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Location; +import org.eclipse.titan.designer.AST.Module; import org.eclipse.titan.designer.AST.NULL_Location; import org.eclipse.titan.designer.AST.ReferenceFinder; +import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.Value; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable; import org.eclipse.titan.designer.declarationsearch.Declaration; import org.eclipse.titan.designer.editors.DeclarationCollector; @@ -202,14 +203,15 @@ public final class EnumItem extends ASTNode implements ILocateableNode, IIncreme @Override public Declaration getDeclaration() { - INamedNode inamedNode = getNameParent(); - - while (!(inamedNode instanceof TTCN3_Enumerated_Type)) { - inamedNode = inamedNode.getNameParent(); + Module module = getMyScope().getModuleScope(); + Assignment assignment = module.getEnclosingAssignment(getLocation().getOffset()); + IType type = assignment.getType(CompilationTimeStamp.getBaseTimestamp()); + + if(!(type instanceof TTCN3_Enumerated_Type)) { + return null; } - TTCN3_Enumerated_Type type = (TTCN3_Enumerated_Type) inamedNode; - Identifier id = ((ITypeWithComponents) type).getComponentIdentifierByName(getId()); - return Declaration.createInstance(type.getDefiningAssignment(), id); + Identifier id = ((TTCN3_Enumerated_Type) type).getComponentIdentifierByName(getId()); + return Declaration.createInstance(assignment, id); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Function_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Function_Type.java index de19dc89ca7ee08531c47a8a01990dd005b02bd1..683788496e63caa672566d62a7b5e849e4190665 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Function_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Function_Type.java @@ -342,7 +342,7 @@ public final class Function_Type extends Type { Assignment assignment = null; switch (last.getValuetype()) { case FUNCTION_REFERENCE_VALUE: - assignment = ((Function_Reference_Value) last).getReferedFunction(); + assignment = ((Function_Reference_Value) last).getReferredFunction(); if (assignment == null) { value.setIsErroneous(true); return; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/SequenceOf_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/SequenceOf_Type.java index 9eac2d0408bf3561878a667ba1a2c1e6b3a0438a..80bf31a328087a20d6c7781030b6d078a508ee7b 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/SequenceOf_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/SequenceOf_Type.java @@ -460,11 +460,11 @@ public final class SequenceOf_Type extends AbstractOfType implements IReferencea * @param value the value to be checked * @param expectedValue the kind of value expected here. * @param incompleteAllowed wheather incomplete value is allowed or not. - * @param implicit_omit true if the implicit omit optional attribute was set + * @param implicitOmit true if the implicit omit optional attribute was set * for the value, false otherwise * */ public void checkThisValueSequenceOf(final CompilationTimeStamp timestamp, final SequenceOf_Value value, - final Expected_Value_type expectedValue, final boolean incompleteAllowed , final boolean implicit_omit, final boolean strElem) { + final Expected_Value_type expectedValue, final boolean incompleteAllowed , final boolean implicitOmit, final boolean strElem) { if (value.isIndexed()) { boolean checkHoles = Expected_Value_type.EXPECTED_CONSTANT.equals(expectedValue); BigInteger maxIndex = BigInteger.valueOf(-1); @@ -504,7 +504,7 @@ public final class SequenceOf_Type extends AbstractOfType implements IReferencea component.setMyGovernor(getOfType()); IValue tempValue2 = getOfType().checkThisValueRef(timestamp, component); getOfType().checkThisValue(timestamp, tempValue2, - new ValueCheckingOptions(expectedValue, incompleteAllowed, false, true, implicit_omit, strElem)); + new ValueCheckingOptions(expectedValue, incompleteAllowed, false, true, implicitOmit, strElem)); } if (checkHoles) { if (maxIndex.compareTo(BigInteger.valueOf(indexMap.size() - 1)) != 0) { @@ -522,7 +522,7 @@ public final class SequenceOf_Type extends AbstractOfType implements IReferencea } else { IValue tempValue2 = getOfType().checkThisValueRef(timestamp, component); getOfType().checkThisValue(timestamp, tempValue2, - new ValueCheckingOptions(expectedValue, incompleteAllowed, false, true, implicit_omit, strElem)); + new ValueCheckingOptions(expectedValue, incompleteAllowed, false, true, implicitOmit, strElem)); } } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Enumerated_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Enumerated_Type.java index e98bc30eaaa9f2d8c69aeeeedd62e4c899f10e08..70aa2cd50acb6f043b9009f6ba56dd6ff27049ad 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Enumerated_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Enumerated_Type.java @@ -34,6 +34,7 @@ import org.eclipse.titan.designer.AST.IValue.Value_type; import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type; import org.eclipse.titan.designer.AST.TTCN3.templates.ITTCN3Template; +import org.eclipse.titan.designer.AST.TTCN3.templates.ITTCN3Template.Template_type; import org.eclipse.titan.designer.AST.TTCN3.types.subtypes.SubType; import org.eclipse.titan.designer.AST.TTCN3.values.Integer_Value; import org.eclipse.titan.designer.AST.TTCN3.values.Undefined_LowerIdentifier_Value; @@ -312,10 +313,11 @@ public final class TTCN3_Enumerated_Type extends Type implements ITypeWithCompon final boolean isModified, final boolean implicitOmit) { registerUsage(template); template.setMyGovernor(this); - - template.getLocation().reportSemanticError(MessageFormat.format(TEMPLATENOTALLOWED, template.getTemplateTypeName())); - template.setIsErroneous(true); - + + if (!Template_type.SPECIFIC_VALUE.equals(template.getTemplatetype()) && !Template_type.SPECIFIC_VALUE.equals(template.getTemplatetype())) { + template.getLocation().reportSemanticError(MessageFormat.format(TEMPLATENOTALLOWED, template.getTemplateTypeName())); + template.setIsErroneous(true); + } if (template.getLengthRestriction() != null) { template.getLocation().reportSemanticError(LENGTHRESTRICTIONNOTALLOWED); template.setIsErroneous(true); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java index 53f7ecf81442e372e4cb582d8e6d4186f517f83e..48ad16e81351f1038a7c3f6c1ffe72fb1df086bd 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java @@ -426,17 +426,6 @@ public abstract class TTCN3_Set_Seq_Choice_BaseType extends Type implements ITyp if (subreferences.size() <= i) { return; } - - //ToDo:code completition does not work most of the time it would be needed HQ66225 - // test implementation - if (compFieldMap != null) { - int nofComponents = this.getNofComponents(); - for (int j = 0; j < nofComponents; j++) { - Identifier id = this.getComponentIdentifierByIndex(j); - propCollector.addProposal(id, null, ""); - } - } - ISubReference subreference = subreferences.get(i); if (Subreference_type.fieldSubReference.equals(subreference.getReferenceType())) { if (subreferences.size() > i + 1) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Testcase_Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Testcase_Type.java index 0649aafb58621f358642183970daf2b767d9a1f6..ff8d79b429df296ccc4e4991c67663b3b2e26927 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Testcase_Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/Testcase_Type.java @@ -244,7 +244,7 @@ public final class Testcase_Type extends Type { Def_Testcase testcase = null; switch (last.getValuetype()) { case TESTCASE_REFERENCE_VALUE: - testcase = ((Testcase_Reference_Value) last).getReferedTestcase(); + testcase = ((Testcase_Reference_Value) last).getReferredTestcase(); if (testcase == null) { setIsErroneous(true); return; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/EmptyStringSet.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/EmptyStringSet.java index 621d5aaff08470b02d09c1e3d4c8e8790fc30ad1..a94dbc5871afb5d4a332fc96ddc35bc407326cd1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/EmptyStringSet.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/EmptyStringSet.java @@ -12,8 +12,8 @@ package org.eclipse.titan.designer.AST.TTCN3.types.subtypes; * */ public final class EmptyStringSet extends StringSubtypeTreeElement { - public EmptyStringSet(final StringType string_type) { - super(string_type); + public EmptyStringSet(final StringType stringType) { + super(stringType); } @Override @@ -23,7 +23,7 @@ public final class EmptyStringSet extends StringSubtypeTreeElement { @Override public SubtypeConstraint complement() { - return new FullStringSet(string_type); + return new FullStringSet(stringType); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/FullStringSet.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/FullStringSet.java index cef04607835f62747ee6ce603a3dee6eaf31349c..54f518e8b651bd7d8e75acb31d607019614a2f97 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/FullStringSet.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/FullStringSet.java @@ -12,8 +12,8 @@ package org.eclipse.titan.designer.AST.TTCN3.types.subtypes; * */ public final class FullStringSet extends StringSubtypeTreeElement { - public FullStringSet(final StringType string_type) { - super(string_type); + public FullStringSet(final StringType stringType) { + super(stringType); } @Override @@ -23,7 +23,7 @@ public final class FullStringSet extends StringSubtypeTreeElement { @Override public EmptyStringSet complement() { - return new EmptyStringSet(string_type); + return new EmptyStringSet(stringType); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/IntegerLimit.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/IntegerLimit.java index 20b18152a112b8f7e154b82bcefbb029a95ed5da..63aa1ddd26f50c504b9913a87f4f9ca8d1b85a1b 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/IntegerLimit.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/IntegerLimit.java @@ -16,7 +16,7 @@ public final class IntegerLimit extends LimitType { public static final IntegerLimit MAXIMUM = new IntegerLimit(ValueType.PLUS_INFINITY); public static final IntegerLimit MINIMUM = new IntegerLimit(ValueType.MINUS_INFINITY); - private final ValueType value_type; + private final ValueType valueType; private final BigInteger value; public enum ValueType { @@ -24,12 +24,12 @@ public final class IntegerLimit extends LimitType { } public IntegerLimit(final BigInteger value) { - value_type = ValueType.NUMBER; + valueType = ValueType.NUMBER; this.value = value; } - public IntegerLimit(final ValueType value_type) { - this.value_type = value_type; + public IntegerLimit(final ValueType valueType) { + this.valueType = valueType; value = BigInteger.ZERO; } @@ -40,23 +40,23 @@ public final class IntegerLimit extends LimitType { @Override public LimitType decrement() { - return (value_type == ValueType.NUMBER) ? new IntegerLimit(value.subtract(BigInteger.ONE)) : this; + return (valueType == ValueType.NUMBER) ? new IntegerLimit(value.subtract(BigInteger.ONE)) : this; } @Override public LimitType increment() { - return (value_type == ValueType.NUMBER) ? new IntegerLimit(value.add(BigInteger.ONE)) : this; + return (valueType == ValueType.NUMBER) ? new IntegerLimit(value.add(BigInteger.ONE)) : this; } @Override public boolean isAdjacent(final LimitType other) { final IntegerLimit il = (IntegerLimit) other; - return ((value_type == ValueType.NUMBER) && (il.value_type == ValueType.NUMBER) && value.add(BigInteger.ONE).equals(il.value)); + return ((valueType == ValueType.NUMBER) && (il.valueType == ValueType.NUMBER) && value.add(BigInteger.ONE).equals(il.value)); } @Override public void toString(final StringBuilder sb) { - switch (value_type) { + switch (valueType) { case MINUS_INFINITY: sb.append("-infinity"); break; @@ -72,13 +72,13 @@ public final class IntegerLimit extends LimitType { @Override public int compareTo(final LimitType other) { final IntegerLimit il = (IntegerLimit) other; - switch (value_type) { + switch (valueType) { case MINUS_INFINITY: - return (il.value_type == ValueType.MINUS_INFINITY) ? 0 : -1; + return (il.valueType == ValueType.MINUS_INFINITY) ? 0 : -1; case PLUS_INFINITY: - return (il.value_type == ValueType.PLUS_INFINITY) ? 0 : 1; + return (il.valueType == ValueType.PLUS_INFINITY) ? 0 : 1; default: - switch (il.value_type) { + switch (il.valueType) { case MINUS_INFINITY: return 1; case PLUS_INFINITY: @@ -101,7 +101,7 @@ public final class IntegerLimit extends LimitType { final IntegerLimit other = (IntegerLimit) obj; - return value_type == other.value_type && value.equals(other.value); + return valueType == other.valueType && value.equals(other.value); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/Range_ParsedSubType.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/Range_ParsedSubType.java index e78412d8da22c84662fef22f45165e4152d10e6e..0a4967ddf237f57f13216736765a21bff77d5334 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/Range_ParsedSubType.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/Range_ParsedSubType.java @@ -28,11 +28,11 @@ public final class Range_ParsedSubType extends ParsedSubType { private Value max; private boolean maxExclusive; - public Range_ParsedSubType(final Value min, final boolean min_exclusive, final Value max, final boolean max_exclusive) { + public Range_ParsedSubType(final Value min, final boolean minExclusive, final Value max, final boolean maxExclusive) { this.min = min; - this.minExclusive = min_exclusive; + this.minExclusive = minExclusive; this.max = max; - this.maxExclusive = max_exclusive; + this.maxExclusive = maxExclusive; } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealLimit.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealLimit.java index 0dd449a1f037eb1a46309af5f75092c8bfb88b42..d0996b8e0e7d9b2b2649cafa04de6fab3a82b6a7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealLimit.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealLimit.java @@ -29,11 +29,11 @@ public final class RealLimit extends LimitType { public static final RealLimit MAXIMUM = new RealLimit(Double.POSITIVE_INFINITY); public static final RealLimit MINIMUM = new RealLimit(Double.NEGATIVE_INFINITY); - private final ValueType value_type; + private final ValueType valueType; private final double value; private RealLimit(final ValueType vt, final double d) { - value_type = vt; + valueType = vt; value = d; } @@ -41,7 +41,7 @@ public final class RealLimit extends LimitType { if (Double.isNaN(d)) { ErrorReporter.INTERNAL_ERROR("NaN range limit"); } - value_type = ValueType.EXACT; + valueType = ValueType.EXACT; value = d; } @@ -51,7 +51,7 @@ public final class RealLimit extends LimitType { @Override public LimitType decrement() { - switch (value_type) { + switch (valueType) { case UPPER: return new RealLimit(value); default: @@ -66,7 +66,7 @@ public final class RealLimit extends LimitType { @Override public LimitType increment() { - switch (value_type) { + switch (valueType) { case LOWER: return new RealLimit(value); default: @@ -77,12 +77,12 @@ public final class RealLimit extends LimitType { @Override public boolean isAdjacent(final LimitType other) { RealLimit rl = (RealLimit) other; - return ((Double.compare(value, rl.value) == 0) && ((value_type.value() + 1) == rl.value_type.value())); + return ((Double.compare(value, rl.value) == 0) && ((valueType.value() + 1) == rl.valueType.value())); } @Override public void toString(final StringBuilder sb) { - if (value_type != ValueType.EXACT) { + if (valueType != ValueType.EXACT) { sb.append('!'); } sb.append(value); @@ -94,7 +94,7 @@ public final class RealLimit extends LimitType { // compare the double values with "natural ordering" compare, // where -0.0 < 0.0 ... INF < NaN final int rv = Double.compare(value, rl.value); - return (rv != 0) ? rv : (value_type.value() - rl.value_type.value()); + return (rv != 0) ? rv : (valueType.value() - rl.valueType.value()); } @Override @@ -109,7 +109,7 @@ public final class RealLimit extends LimitType { final RealLimit other = (RealLimit) obj; - return value_type == other.value_type && Double.compare(value, other.value) == 0; + return valueType == other.valueType && Double.compare(value, other.value) == 0; } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealRangeListConstraint.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealRangeListConstraint.java index bd3047f48dc79c1cf522f9bd0c6401bc37d40917..176d86601dabf595c57df3090d23f5c364d05da9 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealRangeListConstraint.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/RealRangeListConstraint.java @@ -16,53 +16,53 @@ package org.eclipse.titan.designer.AST.TTCN3.types.subtypes; * @author Adam Delic */ public final class RealRangeListConstraint extends SubtypeConstraint { - private final boolean has_nan; + private final boolean hasNan; private final RangeListConstraint rlc; /** empty set constructor */ public RealRangeListConstraint() { - has_nan = false; + hasNan = false; rlc = new RangeListConstraint(LimitType.Type.REAL); } /** single value set */ public RealRangeListConstraint(final Double d) { if (Double.isNaN(d)) { - has_nan = true; + hasNan = true; rlc = new RangeListConstraint(LimitType.Type.REAL); return; } - has_nan = false; + hasNan = false; rlc = new RangeListConstraint(new RealLimit(d)); } /** value range set */ - public RealRangeListConstraint(final RealLimit rl_begin, final RealLimit rl_end) { - has_nan = false; - rlc = new RangeListConstraint(rl_begin, rl_end); + public RealRangeListConstraint(final RealLimit rlBegin, final RealLimit rlEnd) { + hasNan = false; + rlc = new RangeListConstraint(rlBegin, rlEnd); } - private RealRangeListConstraint(final boolean has_nan, final RangeListConstraint rlc) { - this.has_nan = has_nan; + private RealRangeListConstraint(final boolean hasNan, final RangeListConstraint rlc) { + this.hasNan = hasNan; this.rlc = rlc; } @Override public RealRangeListConstraint complement() { - return new RealRangeListConstraint(!has_nan, rlc.complement()); + return new RealRangeListConstraint(!hasNan, rlc.complement()); } @Override public RealRangeListConstraint intersection(final SubtypeConstraint other) { RealRangeListConstraint o = (RealRangeListConstraint) other; - return new RealRangeListConstraint(has_nan && o.has_nan, rlc.intersection(o.rlc)); + return new RealRangeListConstraint(hasNan && o.hasNan, rlc.intersection(o.rlc)); } @Override public boolean isElement(final Object o) { Double d = (Double) o; if (d.isNaN()) { - return has_nan; + return hasNan; } return rlc.isElement(new RealLimit(d)); @@ -70,25 +70,25 @@ public final class RealRangeListConstraint extends SubtypeConstraint { @Override public TernaryBool isEmpty() { - return rlc.isEmpty().and(TernaryBool.fromBool(!has_nan)); + return rlc.isEmpty().and(TernaryBool.fromBool(!hasNan)); } @Override public TernaryBool isEqual(final SubtypeConstraint other) { RealRangeListConstraint o = (RealRangeListConstraint) other; - return rlc.isEqual(o.rlc).and(TernaryBool.fromBool(has_nan == o.has_nan)); + return rlc.isEqual(o.rlc).and(TernaryBool.fromBool(hasNan == o.hasNan)); } @Override public TernaryBool isFull() { - return rlc.isFull().and(TernaryBool.fromBool(has_nan)); + return rlc.isFull().and(TernaryBool.fromBool(hasNan)); } @Override public void toString(final StringBuilder sb) { sb.append('('); rlc.toString(sb, false); - if (has_nan) { + if (hasNan) { if (rlc.isEmpty() != TernaryBool.TTRUE) { sb.append(", "); } @@ -100,7 +100,7 @@ public final class RealRangeListConstraint extends SubtypeConstraint { @Override public RealRangeListConstraint union(final SubtypeConstraint other) { RealRangeListConstraint o = (RealRangeListConstraint) other; - return new RealRangeListConstraint(has_nan || o.has_nan, rlc.union(o.rlc)); + return new RealRangeListConstraint(hasNan || o.hasNan, rlc.union(o.rlc)); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetConstraint.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetConstraint.java index 05024abe053c920edfe36950a1043fed4407d291..5efd42d19ea36ff01de1ade649895f71ce411c5d 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetConstraint.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetConstraint.java @@ -26,12 +26,12 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { PATTERN_CONSTRAINT } - private final ConstraintType constraint_type; + private final ConstraintType constraintType; private final SubtypeConstraint constraint; - public StringSetConstraint(final StringType string_type, final ConstraintType constraint_type, final SubtypeConstraint constraint) { - super(string_type); - this.constraint_type = constraint_type; + public StringSetConstraint(final StringType stringType, final ConstraintType constraintType, final SubtypeConstraint constraint) { + super(stringType); + this.constraintType = constraintType; this.constraint = constraint; } @@ -41,7 +41,7 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { } public ConstraintType getType() { - return constraint_type; + return constraintType; } public SubtypeConstraint getConstraint() { @@ -50,7 +50,7 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { @Override public StringSetConstraint complement() { - return new StringSetConstraint(string_type, constraint_type, constraint.complement()); + return new StringSetConstraint(stringType, constraintType, constraint.complement()); } @Override @@ -58,12 +58,12 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { StringSubtypeTreeElement o = (StringSubtypeTreeElement) other; if (o instanceof StringSetConstraint) { StringSetConstraint ssc = (StringSetConstraint) o; - if (ssc.constraint_type == constraint_type) { - return new StringSetConstraint(string_type, constraint_type, + if (ssc.constraintType == constraintType) { + return new StringSetConstraint(stringType, constraintType, constraint.intersection(((StringSetConstraint) o).constraint)); } } - StringSetOperation returnValue = new StringSetOperation(string_type, OperationType.INTERSECTION, this, o); + StringSetOperation returnValue = new StringSetOperation(stringType, OperationType.INTERSECTION, this, o); return returnValue.evaluate(); } @@ -72,11 +72,11 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { StringSubtypeTreeElement o = (StringSubtypeTreeElement) other; if (o instanceof StringSetConstraint) { StringSetConstraint ssc = (StringSetConstraint) o; - if (ssc.constraint_type == constraint_type) { - return new StringSetConstraint(string_type, constraint_type, constraint.union(((StringSetConstraint) o).constraint)); + if (ssc.constraintType == constraintType) { + return new StringSetConstraint(stringType, constraintType, constraint.union(((StringSetConstraint) o).constraint)); } } - StringSetOperation returnValue = new StringSetOperation(string_type, OperationType.UNION, this, o); + StringSetOperation returnValue = new StringSetOperation(stringType, OperationType.UNION, this, o); return returnValue.evaluate(); } @@ -85,11 +85,11 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { StringSubtypeTreeElement o = (StringSubtypeTreeElement) other; if (o instanceof StringSetConstraint) { StringSetConstraint ssc = (StringSetConstraint) o; - if (ssc.constraint_type == constraint_type) { - return new StringSetConstraint(string_type, constraint_type, constraint.except(((StringSetConstraint) o).constraint)); + if (ssc.constraintType == constraintType) { + return new StringSetConstraint(stringType, constraintType, constraint.except(((StringSetConstraint) o).constraint)); } } - StringSetOperation returnValue = new StringSetOperation(string_type, OperationType.EXCEPT, this, o); + StringSetOperation returnValue = new StringSetOperation(stringType, OperationType.EXCEPT, this, o); return returnValue.evaluate(); } @@ -105,7 +105,7 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { StringSubtypeTreeElement o = (StringSubtypeTreeElement) other; if (o instanceof StringSetConstraint) { StringSetConstraint ssc = (StringSetConstraint) o; - if (constraint_type == ssc.constraint_type) { + if (constraintType == ssc.constraintType) { return constraint.isSubset(ssc.constraint); } } @@ -114,9 +114,9 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { @Override public boolean isElement(final Object o) { - switch (constraint_type) { + switch (constraintType) { case ALPHABET_CONSTRAINT: { - if (string_type == StringType.CHARSTRING) { + if (stringType == StringType.CHARSTRING) { String str = (String) o; for (int i = 0; i < str.length(); i++) { if (!constraint.isElement(new CharLimit(str.charAt(i)))) { @@ -135,7 +135,7 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { return true; } case SIZE_CONSTRAINT: { - if (string_type == StringType.CHARSTRING) { + if (stringType == StringType.CHARSTRING) { String str = (String) o; return constraint.isElement(new SizeLimit(str.length())); } @@ -169,7 +169,7 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { @Override public void toString(final StringBuilder sb) { - if (constraint_type == ConstraintType.SIZE_CONSTRAINT) { + if (constraintType == ConstraintType.SIZE_CONSTRAINT) { sb.append("length"); } constraint.toString(sb); @@ -178,10 +178,10 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { @Override public StringSubtypeTreeElement evaluate() { if (constraint.isEmpty() == TernaryBool.TTRUE) { - return new EmptyStringSet(string_type); + return new EmptyStringSet(stringType); } if (constraint.isFull() == TernaryBool.TTRUE) { - return new FullStringSet(string_type); + return new FullStringSet(stringType); } return this; } @@ -190,8 +190,8 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { * if this is a value list and the other is a size/alphabet/pattern * constraint then call the remove function of the value list */ - public StringSetConstraint remove(final StringSubtypeTreeElement other, final boolean if_element) { - if (constraint_type != ConstraintType.VALUE_CONSTRAINT) { + public StringSetConstraint remove(final StringSubtypeTreeElement other, final boolean ifElement) { + if (constraintType != ConstraintType.VALUE_CONSTRAINT) { return this; } @@ -203,25 +203,25 @@ public final class StringSetConstraint extends StringSubtypeTreeElement { switch (o.getType()) { case SIZE_CONSTRAINT: case ALPHABET_CONSTRAINT: { - if (string_type == StringType.CHARSTRING) { + if (stringType == StringType.CHARSTRING) { StringValueConstraint svc = (StringValueConstraint) constraint; - return new StringSetConstraint(string_type, constraint_type, svc.remove((RangeListConstraint) o.getConstraint(), - if_element)); + return new StringSetConstraint(stringType, constraintType, svc.remove((RangeListConstraint) o.getConstraint(), + ifElement)); } UStringValueConstraint usvc = (UStringValueConstraint) constraint; - return new StringSetConstraint(string_type, constraint_type, usvc.remove((RangeListConstraint) o.getConstraint(), if_element)); + return new StringSetConstraint(stringType, constraintType, usvc.remove((RangeListConstraint) o.getConstraint(), ifElement)); } case PATTERN_CONSTRAINT: { - if (string_type == StringType.CHARSTRING) { + if (stringType == StringType.CHARSTRING) { StringValueConstraint svc = (StringValueConstraint) constraint; - return new StringSetConstraint(string_type, constraint_type, svc.remove((StringPatternConstraint) o.getConstraint(), - if_element)); + return new StringSetConstraint(stringType, constraintType, svc.remove((StringPatternConstraint) o.getConstraint(), + ifElement)); } UStringValueConstraint usvc = (UStringValueConstraint) constraint; - return new StringSetConstraint(string_type, constraint_type, usvc.remove((StringPatternConstraint) o.getConstraint(), - if_element)); + return new StringSetConstraint(stringType, constraintType, usvc.remove((StringPatternConstraint) o.getConstraint(), + ifElement)); } default: return this; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetOperation.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetOperation.java index 4db8a21dbcd506adbe6b9355bb25ee084b4024ff..f8cac9f3ee514dadeb346b7a535bfdfe7832c0ef 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetOperation.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSetOperation.java @@ -17,14 +17,14 @@ public final class StringSetOperation extends StringSubtypeTreeElement { INTERSECTION, INHERIT, UNION, EXCEPT } - private final OperationType operation_type; + private final OperationType operationType; private StringSubtypeTreeElement a; private StringSubtypeTreeElement b; - public StringSetOperation(final StringType string_type, final OperationType operation_type, final StringSubtypeTreeElement a, + public StringSetOperation(final StringType stringType, final OperationType operationType, final StringSubtypeTreeElement a, final StringSubtypeTreeElement b) { - super(string_type); - this.operation_type = operation_type; + super(stringType); + this.operationType = operationType; this.a = a; this.b = b; } @@ -36,20 +36,20 @@ public final class StringSetOperation extends StringSubtypeTreeElement { @Override public SubtypeConstraint complement() { - StringSetOperation returnValue = new StringSetOperation(string_type, OperationType.EXCEPT, new FullStringSet(string_type), this); + StringSetOperation returnValue = new StringSetOperation(stringType, OperationType.EXCEPT, new FullStringSet(stringType), this); return returnValue.evaluate(); } @Override public SubtypeConstraint intersection(final SubtypeConstraint other) { - StringSetOperation returnValue = new StringSetOperation(string_type, OperationType.INTERSECTION, this, + StringSetOperation returnValue = new StringSetOperation(stringType, OperationType.INTERSECTION, this, (StringSubtypeTreeElement) other); return returnValue.evaluate(); } @Override public boolean isElement(final Object o) { - switch (operation_type) { + switch (operationType) { case INHERIT: case INTERSECTION: return a.isElement(o) && b.isElement(o); @@ -64,7 +64,7 @@ public final class StringSetOperation extends StringSubtypeTreeElement { @Override public TernaryBool isEmpty() { - switch (operation_type) { + switch (operationType) { case INHERIT: case INTERSECTION: return a.isEmpty().or(b.isEmpty()); @@ -87,7 +87,7 @@ public final class StringSetOperation extends StringSubtypeTreeElement { @Override public TernaryBool isFull() { - switch (operation_type) { + switch (operationType) { case INHERIT: case INTERSECTION: return a.isFull().and(b.isFull()); @@ -104,7 +104,7 @@ public final class StringSetOperation extends StringSubtypeTreeElement { public void toString(final StringBuilder sb) { sb.append('('); a.toString(sb); - switch (operation_type) { + switch (operationType) { case INHERIT: sb.append(" intersection "); break; @@ -126,13 +126,13 @@ public final class StringSetOperation extends StringSubtypeTreeElement { @Override public SubtypeConstraint union(final SubtypeConstraint other) { - StringSetOperation returnValue = new StringSetOperation(string_type, OperationType.UNION, this, (StringSubtypeTreeElement) other); + StringSetOperation returnValue = new StringSetOperation(stringType, OperationType.UNION, this, (StringSubtypeTreeElement) other); return returnValue.evaluate(); } @Override public SubtypeConstraint except(final SubtypeConstraint other) { - StringSetOperation returnValue = new StringSetOperation(string_type, OperationType.EXCEPT, this, (StringSubtypeTreeElement) other); + StringSetOperation returnValue = new StringSetOperation(stringType, OperationType.EXCEPT, this, (StringSubtypeTreeElement) other); return returnValue.evaluate(); } @@ -150,26 +150,26 @@ public final class StringSetOperation extends StringSubtypeTreeElement { // special simple cases when one side is ET_ALL or ET_NONE but // the other can be a tree if ((a instanceof EmptyStringSet) || (b instanceof EmptyStringSet)) { - if ((operation_type == OperationType.INHERIT) || (operation_type == OperationType.INTERSECTION)) { - return new EmptyStringSet(string_type); + if ((operationType == OperationType.INHERIT) || (operationType == OperationType.INTERSECTION)) { + return new EmptyStringSet(stringType); } - if (operation_type == OperationType.UNION) { + if (operationType == OperationType.UNION) { return (a instanceof EmptyStringSet) ? a : b; } } - if ((b instanceof EmptyStringSet) && (operation_type == OperationType.EXCEPT)) { + if ((b instanceof EmptyStringSet) && (operationType == OperationType.EXCEPT)) { return a; } if ((a instanceof FullStringSet) || (b instanceof FullStringSet)) { - if ((operation_type == OperationType.INHERIT) || (operation_type == OperationType.INTERSECTION)) { + if ((operationType == OperationType.INHERIT) || (operationType == OperationType.INTERSECTION)) { return (a instanceof FullStringSet) ? b : a; } - if (operation_type == OperationType.UNION) { + if (operationType == OperationType.UNION) { return (a instanceof FullStringSet) ? a : b; } } - if ((b instanceof FullStringSet) && (operation_type == OperationType.EXCEPT)) { - return new EmptyStringSet(string_type); + if ((b instanceof FullStringSet) && (operationType == OperationType.EXCEPT)) { + return new EmptyStringSet(stringType); } // both operands must be single constraints @@ -181,7 +181,7 @@ public final class StringSetOperation extends StringSubtypeTreeElement { // special case: ALL - some constraint type that can be // complemented - if ((a instanceof FullStringSet) && (operation_type == OperationType.EXCEPT) && (b instanceof StringSetConstraint)) { + if ((a instanceof FullStringSet) && (operationType == OperationType.EXCEPT) && (b instanceof StringSetConstraint)) { switch (((StringSetConstraint) b).getType()) { case SIZE_CONSTRAINT: case ALPHABET_CONSTRAINT: @@ -193,7 +193,7 @@ public final class StringSetOperation extends StringSubtypeTreeElement { // isElement() can be called for the values // and drop values or drop the other operand set or both // depending on the operation - switch (operation_type) { + switch (operationType) { case INHERIT: case INTERSECTION: if (a instanceof StringSetConstraint) { @@ -243,8 +243,8 @@ public final class StringSetOperation extends StringSubtypeTreeElement { if (a.getElementType() == b.getElementType()) { switch (a.getElementType()) { case ALL: - if (operation_type == OperationType.EXCEPT) { - return new EmptyStringSet(string_type); + if (operationType == OperationType.EXCEPT) { + return new EmptyStringSet(stringType); } return a; @@ -255,7 +255,7 @@ public final class StringSetOperation extends StringSubtypeTreeElement { if (((StringSetConstraint) a).getType() == ConstraintType.PATTERN_CONSTRAINT) { break; } - switch (operation_type) { + switch (operationType) { case INHERIT: case INTERSECTION: return (StringSubtypeTreeElement) a.intersection(b); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSizeAndValueListConstraint.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSizeAndValueListConstraint.java index 080a306529b3243f26b4d24add26771af96c78e2..a427395b1cb8cc23a3c1844b6416468c1a8c3df2 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSizeAndValueListConstraint.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSizeAndValueListConstraint.java @@ -226,7 +226,7 @@ public final class StringSizeAndValueListConstraint extends SubtypeConstraint { } } // drop ret_val.has_values elements that are elements of the - // ret_val.size_constraint set + // ret_val.sizeConstraint set for (Iterator<String> i = returnValue.hasValues.iterator(); i.hasNext();) { String str = i.next(); if (returnValue.sizeConstraint.isElement(new SizeLimit(str.length() / type.elemSize()))) { @@ -234,7 +234,7 @@ public final class StringSizeAndValueListConstraint extends SubtypeConstraint { } } // drop ret_val.not_values elements that are not elements of the - // ret_val.size_constraint set + // ret_val.sizeConstraint set for (Iterator<String> i = returnValue.notValues.iterator(); i.hasNext();) { String str = i.next(); if (!returnValue.sizeConstraint.isElement(new SizeLimit(str.length() / type.elemSize()))) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSubtypeTreeElement.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSubtypeTreeElement.java index c5e5905d21926b0b033d97e0040354046d1a25c0..384a28bffc37b8415911be49853032b054e0f2b1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSubtypeTreeElement.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringSubtypeTreeElement.java @@ -26,10 +26,10 @@ public abstract class StringSubtypeTreeElement extends SubtypeConstraint { CONSTRAINT } - protected final StringType string_type; + protected final StringType stringType; - protected StringSubtypeTreeElement(final StringType string_type) { - this.string_type = string_type; + protected StringSubtypeTreeElement(final StringType stringType) { + this.stringType = stringType; } public StringSubtypeTreeElement evaluate() { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringValueConstraint.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringValueConstraint.java index 16937f03c27d540fbeaee9ff815d1bcdc157bce6..393ae9ba6e142f78097d9e9cfa5270eff03e4042 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringValueConstraint.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/StringValueConstraint.java @@ -146,7 +146,7 @@ public final class StringValueConstraint extends SubtypeConstraint { return new StringValueConstraint(returnValue); } default: - // illegal range_constraint type, ignore + // illegal rangeConstraint type, ignore return this; } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/UStringValueConstraint.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/UStringValueConstraint.java index 95a29bfa6e779808561714b1a1b3151f3b8e69ae..b76a628599494ce73863b9bdaeeae7295e110d44 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/UStringValueConstraint.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/UStringValueConstraint.java @@ -113,12 +113,12 @@ public final class UStringValueConstraint extends SubtypeConstraint { sb.append(')'); } - public UStringValueConstraint remove(final RangeListConstraint range_constraint, final boolean ifElement) { - switch (range_constraint.getLimitType()) { + public UStringValueConstraint remove(final RangeListConstraint rangeConstraint, final boolean ifElement) { + switch (rangeConstraint.getLimitType()) { case SIZE: { Set<UniversalCharstring> returnValue = new TreeSet<UniversalCharstring>(); for (UniversalCharstring str : values) { - if (range_constraint.isElement(new SizeLimit(str.length())) != ifElement) { + if (rangeConstraint.isElement(new SizeLimit(str.length())) != ifElement) { returnValue.add(str); } } @@ -129,7 +129,7 @@ public final class UStringValueConstraint extends SubtypeConstraint { for (UniversalCharstring str : values) { boolean allCharsAreElements = true; for (int charIndex = 0; charIndex < str.length(); charIndex++) { - if (!range_constraint.isElement(new UCharLimit(str.get(charIndex)))) { + if (!rangeConstraint.isElement(new UCharLimit(str.get(charIndex)))) { allCharsAreElements = false; break; } @@ -141,7 +141,7 @@ public final class UStringValueConstraint extends SubtypeConstraint { return new UStringValueConstraint(returnValue); } default: - // illegal range_constraint type, ignore + // illegal rangeConstraint type, ignore return this; } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListAndSizeConstraint.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListAndSizeConstraint.java index ae2404bb25b28f36e0a253f3df2a47b729a11e86..c21fbf6bcc67ba034bbf80744937b22e3ed73c40 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListAndSizeConstraint.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListAndSizeConstraint.java @@ -42,8 +42,8 @@ public final class ValueListAndSizeConstraint extends SubtypeConstraint { } /** size range */ - public ValueListAndSizeConstraint(final SizeLimit l_begin, final SizeLimit l_end) { - sizeConstraint = new RangeListConstraint(l_begin, l_end); + public ValueListAndSizeConstraint(final SizeLimit lBegin, final SizeLimit lEnd) { + sizeConstraint = new RangeListConstraint(lBegin, lEnd); hasValues = new ValueListConstraint(); notValues = new ValueListConstraint(); } @@ -57,11 +57,11 @@ public final class ValueListAndSizeConstraint extends SubtypeConstraint { return returnValue; } - public ValueListAndSizeConstraint setOperation(final SubtypeConstraint other, final boolean is_union) { + public ValueListAndSizeConstraint setOperation(final SubtypeConstraint other, final boolean isUnion) { ValueListAndSizeConstraint o = (ValueListAndSizeConstraint) other; ValueListAndSizeConstraint returnValue = new ValueListAndSizeConstraint(); - returnValue.sizeConstraint = sizeConstraint.setOperation(o.sizeConstraint, is_union); - if (is_union) { + returnValue.sizeConstraint = sizeConstraint.setOperation(o.sizeConstraint, isUnion); + if (isUnion) { // V1+V2 returnValue.hasValues = hasValues.union(o.hasValues); // ~S1*N2 @@ -86,10 +86,10 @@ public final class ValueListAndSizeConstraint extends SubtypeConstraint { returnValue.hasValues = returnValue.hasValues.except(vlc); returnValue.notValues = returnValue.notValues.except(vlc); // drop ret_val.has_values elements that are elements of the - // ret_val.size_constraint set + // ret_val.sizeConstraint set returnValue.hasValues = returnValue.hasValues.remove(returnValue.sizeConstraint, true); // drop ret_val.not_values elements that are not elements of the - // ret_val.size_constraint set + // ret_val.sizeConstraint set returnValue.notValues = returnValue.notValues.remove(returnValue.sizeConstraint, false); return returnValue; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListConstraint.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListConstraint.java index c6c072bfd2b0d2d0028fc7183a0125032c363cde..41c9f75d877bdb05c018d9da6dbc5cb5ad47d6bf 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListConstraint.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/subtypes/ValueListConstraint.java @@ -159,24 +159,24 @@ public final class ValueListConstraint extends SubtypeConstraint { /** * remove all elements whose size/length is inside/outside of - * size_constraint + * sizeConstraint */ - public ValueListConstraint remove(final RangeListConstraint size_constraint, final boolean if_element) { + public ValueListConstraint remove(final RangeListConstraint sizeConstraint, final boolean ifElement) { ArrayList<IValue> returnValue = new ArrayList<IValue>(); for (IValue v : values) { switch (v.getValuetype()) { case ARRAY_VALUE: - if (size_constraint.isElement(new SizeLimit(((Array_Value) v).getNofComponents())) != if_element) { + if (sizeConstraint.isElement(new SizeLimit(((Array_Value) v).getNofComponents())) != ifElement) { returnValue.add(v); } break; case SEQUENCEOF_VALUE: - if (size_constraint.isElement(new SizeLimit(((SequenceOf_Value) v).getNofComponents())) != if_element) { + if (sizeConstraint.isElement(new SizeLimit(((SequenceOf_Value) v).getNofComponents())) != ifElement) { returnValue.add(v); } break; case SETOF_VALUE: - if (size_constraint.isElement(new SizeLimit(((SetOf_Value) v).getNofComponents())) != if_element) { + if (sizeConstraint.isElement(new SizeLimit(((SetOf_Value) v).getNofComponents())) != ifElement) { returnValue.add(v); } break; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Altstep_Reference_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Altstep_Reference_Value.java index dc85d66f7223cf8e9ee113491723e0f22093d40b..43f16e3ecc9829b4859182f8c2d9e6407ad4cfe7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Altstep_Reference_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Altstep_Reference_Value.java @@ -37,10 +37,10 @@ import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; */ public final class Altstep_Reference_Value extends Value { - private Def_Altstep referedAltstep; + private Def_Altstep referredAltstep; - public Altstep_Reference_Value(final Def_Altstep referedAltstep) { - this.referedAltstep = referedAltstep; + public Altstep_Reference_Value(final Def_Altstep referredAltstep) { + this.referredAltstep = referredAltstep; } @Override @@ -51,12 +51,12 @@ public final class Altstep_Reference_Value extends Value { @Override public String createStringRepresentation() { StringBuilder builder = new StringBuilder("refers("); - builder.append(referedAltstep.getAssignmentName()).append(')'); + builder.append(referredAltstep.getAssignmentName()).append(')'); return builder.toString(); } - public Def_Altstep getReferedAltstep() { - return referedAltstep; + public Def_Altstep getReferredAltstep() { + return referredAltstep; } @Override @@ -104,7 +104,7 @@ public final class Altstep_Reference_Value extends Value { referenceChain.release(); return Value_type.ALTSTEP_REFERENCE_VALUE.equals(last.getValuetype()) - && referedAltstep == ((Altstep_Reference_Value) last).getReferedAltstep(); + && referredAltstep == ((Altstep_Reference_Value) last).getReferredAltstep(); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Function_Reference_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Function_Reference_Value.java index e28fd30e4780600f3d9ffb7958bd456860c81eb7..ceef067916ebbd440c6ab85433ce0a243a2ce9c3 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Function_Reference_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Function_Reference_Value.java @@ -41,12 +41,12 @@ public final class Function_Reference_Value extends Value { private Definition referredFunction; - public Function_Reference_Value(final Def_Function referedFunction) { - this.referredFunction = referedFunction; + public Function_Reference_Value(final Def_Function referredFunction) { + this.referredFunction = referredFunction; } - public Function_Reference_Value(final Def_Extfunction referedFunction) { - this.referredFunction = referedFunction; + public Function_Reference_Value(final Def_Extfunction referredFunction) { + this.referredFunction = referredFunction; } @Override @@ -61,7 +61,7 @@ public final class Function_Reference_Value extends Value { return builder.toString(); } - public Definition getReferedFunction() { + public Definition getReferredFunction() { return referredFunction; } @@ -110,7 +110,7 @@ public final class Function_Reference_Value extends Value { referenceChain.release(); return Value_type.FUNCTION_REFERENCE_VALUE.equals(last.getValuetype()) - && referredFunction == ((Function_Reference_Value) last).getReferedFunction(); + && referredFunction == ((Function_Reference_Value) last).getReferredFunction(); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/NamedValue.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/NamedValue.java index ba97182669d4799c7f21c4d880f24759699d3ec9..136f64965a0b1cba13249919eb3b17a860b99eb1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/NamedValue.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/NamedValue.java @@ -152,6 +152,9 @@ public final class NamedValue extends ASTNode implements ILocateableNode, IIncre INamedNode inamedNode = getNameParent(); while (!(inamedNode instanceof IValue)) { + if( inamedNode == null) { + return null; //FIXME: this is just a temp solution! find the reason! + } inamedNode = inamedNode.getNameParent(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Testcase_Reference_Value.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Testcase_Reference_Value.java index 1aa69a6e2fb3fb7a9a6230fd2bb3f8db14c768fb..78f09aa63165722114bb8e0a0b6887a2adeb253b 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Testcase_Reference_Value.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/Testcase_Reference_Value.java @@ -37,10 +37,10 @@ import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; */ public final class Testcase_Reference_Value extends Value { - private Def_Testcase referedTestcase; + private Def_Testcase referredTestcase; public Testcase_Reference_Value(final Def_Testcase referredTestcase) { - this.referedTestcase = referredTestcase; + this.referredTestcase = referredTestcase; } @Override @@ -51,12 +51,12 @@ public final class Testcase_Reference_Value extends Value { @Override public String createStringRepresentation() { StringBuilder builder = new StringBuilder("refers("); - builder.append(referedTestcase.getAssignmentName()).append(')'); + builder.append(referredTestcase.getAssignmentName()).append(')'); return builder.toString(); } - public Def_Testcase getReferedTestcase() { - return referedTestcase; + public Def_Testcase getReferredTestcase() { + return referredTestcase; } @Override @@ -104,7 +104,7 @@ public final class Testcase_Reference_Value extends Value { referenceChain.release(); return Value_type.TESTCASE_REFERENCE_VALUE.equals(last.getValuetype()) - && referedTestcase == ((Testcase_Reference_Value) last).getReferedTestcase(); + && referredTestcase == ((Testcase_Reference_Value) last).getReferredTestcase(); } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/MTCComponentExpression.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/MTCComponentExpression.java index 1de4ebd04ddb36a3a39fa8167ee9a46a7359d003..1b88f6054ae8f21f284a403a6ebcac9076000403 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/MTCComponentExpression.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/MTCComponentExpression.java @@ -45,8 +45,10 @@ public final class MTCComponentExpression extends Expression_Value { @Override public IType getExpressionGovernor(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { - if (myGovernor != null) { - return myGovernor; + if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) { + if (myGovernor != null) { + return myGovernor; + } } if (myScope != null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/RefersExpression.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/RefersExpression.java index 3e9c532a0382ed6cf117c06452e1bb6ff4c6f350..833bafdfe3077f32492dea2d67ef23404ffa20f7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/RefersExpression.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/RefersExpression.java @@ -42,14 +42,14 @@ import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater; public final class RefersExpression extends Expression_Value { private static final String OPERANDERROR = "Reference to a function, external function, altstep or testcase was expected."; - private Reference refered; - private Assignment referedAssignment; + private Reference referred; + private Assignment referredAssignment; - public RefersExpression(final Reference refered) { - this.refered = refered; + public RefersExpression(final Reference referred) { + this.referred = referred; - if (refered != null) { - refered.setFullNameParent(this); + if (referred != null) { + referred.setFullNameParent(this); } } @@ -60,20 +60,20 @@ public final class RefersExpression extends Expression_Value { @Override public String createStringRepresentation() { - if (refered == null) { + if (referred == null) { return "<erroneous value>"; } StringBuilder builder = new StringBuilder(); - builder.append("refers(").append(refered.getDisplayName()).append(')'); + builder.append("refers(").append(referred.getDisplayName()).append(')'); return builder.toString(); } @Override public void setMyScope(final Scope scope) { super.setMyScope(scope); - if (refered != null) { - refered.setMyScope(scope); + if (referred != null) { + referred.setMyScope(scope); } } @@ -81,7 +81,7 @@ public final class RefersExpression extends Expression_Value { public StringBuilder getFullName(final INamedNode child) { StringBuilder builder = super.getFullName(child); - if (refered == child) { + if (referred == child) { return builder.append(OPERAND); } @@ -90,11 +90,11 @@ public final class RefersExpression extends Expression_Value { @Override public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { - if (referedAssignment == null) { + if (referredAssignment == null) { return Type_type.TYPE_UNDEFINED; } - switch (referedAssignment.getAssignmentType()) { + switch (referredAssignment.getAssignmentType()) { case A_FUNCTION: case A_FUNCTION_RTEMP: case A_FUNCTION_RVAL: @@ -130,16 +130,16 @@ public final class RefersExpression extends Expression_Value { * */ private void checkExpressionOperands(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { - if (refered == null) { + if (referred == null) { return; } - referedAssignment = refered.getRefdAssignment(timestamp, false); - if (referedAssignment == null) { + referredAssignment = referred.getRefdAssignment(timestamp, false); + if (referredAssignment == null) { return; } - switch (referedAssignment.getAssignmentType()) { + switch (referredAssignment.getAssignmentType()) { case A_FUNCTION: case A_FUNCTION_RTEMP: case A_FUNCTION_RVAL: @@ -167,13 +167,13 @@ public final class RefersExpression extends Expression_Value { lastTimeChecked = timestamp; lastValue = this; - if (refered == null) { + if (referred == null) { return lastValue; } checkExpressionOperands(timestamp, expectedValue, referenceChain); - if (getIsErroneous(timestamp) || referedAssignment == null) { + if (getIsErroneous(timestamp) || referredAssignment == null) { return lastValue; } @@ -181,25 +181,25 @@ public final class RefersExpression extends Expression_Value { return lastValue; } - switch (referedAssignment.getAssignmentType()) { + switch (referredAssignment.getAssignmentType()) { case A_FUNCTION: case A_FUNCTION_RTEMP: case A_FUNCTION_RVAL: - lastValue = new Function_Reference_Value((Def_Function) referedAssignment); + lastValue = new Function_Reference_Value((Def_Function) referredAssignment); lastValue.copyGeneralProperties(this); break; case A_EXT_FUNCTION: case A_EXT_FUNCTION_RTEMP: case A_EXT_FUNCTION_RVAL: - lastValue = new Function_Reference_Value((Def_Extfunction) referedAssignment); + lastValue = new Function_Reference_Value((Def_Extfunction) referredAssignment); lastValue.copyGeneralProperties(this); break; case A_ALTSTEP: - lastValue = new Altstep_Reference_Value((Def_Altstep) referedAssignment); + lastValue = new Altstep_Reference_Value((Def_Altstep) referredAssignment); lastValue.copyGeneralProperties(this); break; case A_TESTCASE: - lastValue = new Testcase_Reference_Value((Def_Testcase) referedAssignment); + lastValue = new Testcase_Reference_Value((Def_Testcase) referredAssignment); lastValue.copyGeneralProperties(this); break; default: @@ -217,24 +217,24 @@ public final class RefersExpression extends Expression_Value { throw new ReParseException(); } - if (refered != null) { - refered.updateSyntax(reparser, false); - reparser.updateLocation(refered.getLocation()); + if (referred != null) { + referred.updateSyntax(reparser, false); + reparser.updateLocation(referred.getLocation()); } } @Override public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) { - if (refered == null) { + if (referred == null) { return; } - refered.findReferences(referenceFinder, foundIdentifiers); + referred.findReferences(referenceFinder, foundIdentifiers); } @Override protected boolean memberAccept(ASTVisitor v) { - if (refered != null && !refered.accept(v)) { + if (referred != null && !referred.accept(v)) { return false; } return true; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SelfComponentExpression.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SelfComponentExpression.java index 3ea315da839d095ce5a36e994a5f73ee01cd5fc8..dc7e257c43e347f8b7464028e612386e75626499 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SelfComponentExpression.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SelfComponentExpression.java @@ -47,8 +47,10 @@ public final class SelfComponentExpression extends Expression_Value { @Override public IType getExpressionGovernor(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { - if (myGovernor != null) { - return myGovernor; + if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) { + if (myGovernor != null) { + return myGovernor; + } } if (myScope == null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SystemComponentExpression.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SystemComponentExpression.java index 0fc5c80899a20ed55609667f32ff0704b5400195..de4dd7a21757f730aff7677649280950bf6a83cd 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SystemComponentExpression.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/SystemComponentExpression.java @@ -45,8 +45,10 @@ public final class SystemComponentExpression extends Expression_Value { @Override public IType getExpressionGovernor(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) { - if (myGovernor != null) { - return myGovernor; + if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) { + if (myGovernor != null) { + return myGovernor; + } } if (myScope != null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Type.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Type.java index ca125ea7ed33cae7923c01dab88a7e18450092b0..5db706c7e8e77ff230820937265f77cf0a402b32 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Type.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/Type.java @@ -239,9 +239,9 @@ public abstract class Type extends Governor implements IType, IIncrementallyUpda @Override public IType getFieldType(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference, - final Expected_Value_type expected_index, final boolean interrupt_if_optional) { + final Expected_Value_type expectedIndex, final boolean interruptIfOptional) { IReferenceChain chain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true); - IType temp = getFieldType(timestamp, reference, actualSubReference, expected_index, chain, interrupt_if_optional); + IType temp = getFieldType(timestamp, reference, actualSubReference, expectedIndex, chain, interruptIfOptional); chain.release(); return temp; @@ -413,15 +413,15 @@ public abstract class Type extends Governor implements IType, IIncrementallyUpda public void checkThisValue(final CompilationTimeStamp timestamp, final IValue value, final ValueCheckingOptions valueCheckingOptions) { value.setIsErroneous(false); - Definition def = getDefiningDefinition(); - if (def != null) { + final Assignment assignment = getDefiningAssignment(); + if (assignment != null && assignment instanceof Definition) { final Scope scope = value.getMyScope(); if (scope != null) { final Module module = scope.getModuleScope(); if (module != null) { final String referingModuleName = module.getName(); - if (!def.referingHere.contains(referingModuleName)) { - def.referingHere.add(referingModuleName); + if (!((Definition)assignment).referingHere.contains(referingModuleName)) { + ((Definition)assignment).referingHere.add(referingModuleName); } } else { ErrorReporter.logError("The value `" + value.getFullName() + "' does not appear to be in a module"); @@ -511,11 +511,11 @@ public abstract class Type extends Governor implements IType, IIncrementallyUpda return; } - Definition def = getDefiningDefinition(); - if (def != null) { + final Assignment myAssignment = getDefiningAssignment(); + if (myAssignment != null && myAssignment instanceof Definition) { String referingModuleName = value.getMyScope().getModuleScope().getName(); - if (!def.referingHere.contains(referingModuleName)) { - def.referingHere.add(referingModuleName); + if (!((Definition)myAssignment).referingHere.contains(referingModuleName)) { + ((Definition)myAssignment).referingHere.add(referingModuleName); } } @@ -929,11 +929,11 @@ public abstract class Type extends Governor implements IType, IIncrementallyUpda * the template to use. * */ protected void registerUsage(final ITTCN3Template template) { - final Definition def = getDefiningDefinition(); - if (def != null) { + final Assignment assignment = getDefiningAssignment(); + if (assignment != null && assignment instanceof Definition) { String referingModuleName = template.getMyScope().getModuleScope().getName(); - if (!def.referingHere.contains(referingModuleName)) { - def.referingHere.add(referingModuleName); + if (!((Definition)assignment).referingHere.contains(referingModuleName)) { + ((Definition)assignment).referingHere.add(referingModuleName); } } } @@ -1310,22 +1310,14 @@ public abstract class Type extends Governor implements IType, IIncrementallyUpda @Override public Assignment getDefiningAssignment() { - INamedNode parent = getNameParent(); - while (parent != null && !(parent instanceof Assignment)) { - parent = parent.getNameParent(); + if(getMyScope() == null) { + return null; } - return (Assignment) parent; - } - - @Override - public Definition getDefiningDefinition() { - INamedNode parent = getNameParent(); - while (parent != null && !(parent instanceof Definition)) { - parent = parent.getNameParent(); - } + Module module = getMyScope().getModuleScope(); + Assignment assignment = module.getEnclosingAssignment(getLocation().getOffset()); - return (Definition) parent; + return assignment; } @Override diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/Activator.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/Activator.java index 436e4fa0e0be46358e0d9ab8a9d1bbea188bac50..c00046b2466c4d98a2f76af9084be73c6e0f098c 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/Activator.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/Activator.java @@ -36,6 +36,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.preferences.IPreferencesService; @@ -51,6 +52,7 @@ import org.eclipse.titan.designer.parsers.GlobalParser; import org.eclipse.titan.designer.preferences.PreferenceConstants; import org.eclipse.titan.designer.productUtilities.ProductConstants; import org.eclipse.titan.designer.properties.PropertyNotificationManager; +import org.eclipse.titan.designer.properties.data.ProjectBuildPropertyData; import org.eclipse.titan.designer.properties.data.ProjectFileHandler; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.activities.IActivityManager; @@ -323,7 +325,6 @@ public final class Activator extends AbstractUIPlugin { if ((projectDelta.getFlags() & IResourceDelta.DESCRIPTION) != 0) { TITANBuilder.markProjectForRebuild(project); - GlobalParser.getProjectSourceParser(project).setFullSemanticAnalysisNeeded(); } if (projectDelta.getKind() == IResourceDelta.ADDED) { @@ -381,9 +382,47 @@ public final class Activator extends AbstractUIPlugin { } catch (CoreException e) { ErrorReporter.logExceptionStackTrace(e); } - tempVisitor.reportOutdatedFiles(); - GlobalParser.getProjectSourceParser(project).analyzeAll(false); - // It is of no importance when this analysis will run, or end for that matter. + final WorkspaceJob[] outdatingJobs = tempVisitor.reportOutdatedFiles(); + + WorkspaceJob analyzeAfterOutdating = new WorkspaceJob("analyzeAfterOutdating") { + @Override + public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { + //Wait for reportOutdatedFiles() to finish + try { + for (WorkspaceJob job : outdatingJobs) { + if(job != null) { + job.join(); + } + } + } catch (InterruptedException e) { + ErrorReporter.logExceptionStackTrace(e); + } + + GlobalParser.getProjectSourceParser(project).analyzeAll(false); + // It is of no importance when this analysis will run, or end for that matter. + + boolean usesInternal; + try { + usesInternal = "true".equals(project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, + ProjectBuildPropertyData.GENERATE_INTERNAL_MAKEFILE_PROPERTY))); + } catch (CoreException e) { + usesInternal = false; + } + if (usesInternal) { + TITANBuilder.markProjectForRebuild(project); + TITANBuilder.removeMakefile(project, false); + } + + return Status.OK_STATUS; + } + }; + analyzeAfterOutdating.setPriority(Job.LONG); + analyzeAfterOutdating.setUser(false); + analyzeAfterOutdating.setSystem(true); + analyzeAfterOutdating.setRule(project.getWorkspace().getRuleFactory().refreshRule(project)); + analyzeAfterOutdating.setProperty(IProgressConstants.ICON_PROPERTY, ImageCache.getImageDescriptor("titan.gif")); + analyzeAfterOutdating.schedule(); + return Status.OK_STATUS; } }; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GeneralConstants.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GeneralConstants.java index 2636ea22e64178db235a4ccd2c2076a7910de91a..38ec739f1584cd10bf30065900a87b811e8f9476 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GeneralConstants.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GeneralConstants.java @@ -20,7 +20,7 @@ import org.eclipse.titan.designer.properties.data.FolderBuildPropertyData; */ public final class GeneralConstants { public static final ProductIdentity ON_THE_FLY_ANALYZER_VERSION = - ProductIdentity.getProductIdentity(ProductIdentity.TITAN_PRODUCT_NUMBER, 5, 4, 2, 0); + ProductIdentity.getProductIdentity(ProductIdentity.TITAN_PRODUCT_NUMBER, 5, 4, 3, 0); public static final boolean DEBUG = true; public static final boolean ETSI_BUILD = false; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GlobalDeltaVisitor.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GlobalDeltaVisitor.java index daca17df6b96ea4a4c0b7c037d31ccde42b0f0b3..4f04e8109b19d93d138270f9af0ec64d20663059 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GlobalDeltaVisitor.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/GlobalDeltaVisitor.java @@ -17,6 +17,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.WorkspaceJob; import org.eclipse.titan.designer.commonFilters.ResourceExclusionHelper; import org.eclipse.titan.designer.core.ProjectBasedBuilder; import org.eclipse.titan.designer.parsers.FileSaveTracker; @@ -83,10 +84,12 @@ public final class GlobalDeltaVisitor implements IResourceDeltaVisitor { /** * Reports the collected list of outdated files, to let the internal storage know, that their data is outdated.. * */ - public void reportOutdatedFiles() { + public WorkspaceJob[] reportOutdatedFiles() { + WorkspaceJob[] jobs = new WorkspaceJob[2]; if (!outdatedFiles.isEmpty()) { - GlobalParser.getProjectSourceParser(project).reportOutdating(outdatedFiles); - GlobalParser.getConfigSourceParser(project).reportOutdating(outdatedFiles); + jobs[0] = GlobalParser.getProjectSourceParser(project).reportOutdating(outdatedFiles); + jobs[1] = GlobalParser.getConfigSourceParser(project).reportOutdating(outdatedFiles); } + return jobs; } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/ConvertXSD2TTCN.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/ConvertXSD2TTCN.java index 914bcbdc182180c34410c0c64a776a273b5b632e..5946e28ea04c716f77b0ba92f4b8d3ded0177ebc 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/ConvertXSD2TTCN.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/ConvertXSD2TTCN.java @@ -21,7 +21,6 @@ import org.eclipse.jface.action.IAction; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.path.PathConverter; import org.eclipse.titan.designer.consoles.TITANDebugConsole; @@ -97,7 +96,7 @@ public final class ConvertXSD2TTCN extends ExternalTitanAction { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - DirectoryDialog dialog = new DirectoryDialog(new Shell(Display.getDefault()), SWT.SAVE); + DirectoryDialog dialog = new DirectoryDialog(null, SWT.SAVE); dialog.setFilterPath(project.getLocation().toOSString()); String outFolder = dialog.open(); if (outFolder != null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/NatureConverter.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/NatureConverter.java index 8559a51ab34694db95f13b61a1e92cb580b29027..a6811d140664a2aedf001fd109e4be268e908632 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/NatureConverter.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/actions/NatureConverter.java @@ -25,7 +25,6 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.utils.SelectionUtils; import org.eclipse.titan.designer.Activator; @@ -149,8 +148,7 @@ public final class NatureConverter extends AbstractHandler implements IObjectAct Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - Shell shell = new Shell(Display.getDefault()); - PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(shell, tempProject, GeneralConstants.PROJECT_PROPERTY_PAGE, null, null); + PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(null, tempProject, GeneralConstants.PROJECT_PROPERTY_PAGE, null, null); if (dialog != null) { dialog.open(); } @@ -160,7 +158,7 @@ public final class NatureConverter extends AbstractHandler implements IObjectAct Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - if (MessageDialog.openConfirm(new Shell(Display.getDefault()), NATURE_REMOVAL_TITLE, NATURE_REMOVAL_MESSAGE + if (MessageDialog.openConfirm(null, NATURE_REMOVAL_TITLE, NATURE_REMOVAL_MESSAGE + tempProject.getName() + '?')) { natureIds.remove(index); description.setNatureIds(natureIds.toArray(new String[natureIds.size()])); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/LoadFromTpd.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/LoadFromTpd.java index bf91507a887041f2e4ae5c4fc5da9e348b25609a..f090f47fa943a0763614c03054f7ee9c3f4c0ad5 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/LoadFromTpd.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/LoadFromTpd.java @@ -21,7 +21,6 @@ import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.GeneralConstants; import org.eclipse.titan.designer.wizards.projectFormat.TpdImporter; @@ -71,7 +70,7 @@ public class LoadFromTpd implements IApplication { } try { - new ProgressMonitorDialog(new Shell(Display.getDefault())).run(true, false, new IRunnableWithProgress() { + new ProgressMonitorDialog(null).run(true, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AnalyzerFactory.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AnalyzerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..853193723e5e1c8edbc8c58ff727fe514c868b3b --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AnalyzerFactory.java @@ -0,0 +1,45 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.titan.designer.parsers.CompilationTimeStamp; +import org.eclipse.titan.designer.preferences.PreferenceConstantValues; +import org.eclipse.titan.designer.preferences.PreferenceConstants; +import org.eclipse.titan.designer.productUtilities.ProductConstants; + +/** + * Factory class to create instance of IBaseAnalyzer. + * + * @author Peter Olah + */ +public final class AnalyzerFactory { + + private AnalyzerFactory() { + } + + public static IBaseAnalyzer getAnalyzer(final CompilationTimeStamp timestamp) { + + SelectionAlgorithm selectionAlgorithm = SelectionAlgorithm.fromString(Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.MODULESELECTIONALGORITHM, PreferenceConstantValues.MODULESELECTIONORIGINAL, null)); + + if (selectionAlgorithm == null) { + selectionAlgorithm = SelectionAlgorithm.getDefaultValue(); + } + + switch (selectionAlgorithm) { + case MODULESELECTIONORIGINAL: + return new OriginalModuleSelection(); + case BROKENREFERENCESINVERTED: + return new BrokenPartsViaReferences(SelectionAlgorithm.BROKENREFERENCESINVERTED, timestamp); + } + + return null; + } + + +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandler.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..54d5c554e0490b69aabea5f5e6d70ba5cffc5afd --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandler.java @@ -0,0 +1,187 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.titan.designer.AST.ASTVisitor; +import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.Module; +import org.eclipse.titan.designer.parsers.CompilationTimeStamp; + +/** + * @author Peter Olah + */ +public abstract class AssignmentHandler extends ASTVisitor implements IAssignmentChecker { + // The assignment this definition is representing + protected Assignment assignment; + + /** + * An infected assignment is an assignment that needs to be re-analyzed. + * + * It is important to note that some assignments can be infected without spreading it. + */ + private boolean isInfected; + + /** + * A contagious assignment is infected and all assignments referencing it need to be re-analyzed too. + * + * It is important to note that some assignments can be infected without spreading it. + */ + private boolean isContagious; + + /** + * The list of reasons an assignment needs to be re-analyzed. + * + * Servers debugging purpose. + * */ + private List<String> reasons; + + /** + * References within the assignment, that are not able to spread the need for analysis. + * */ + private Set<String> nonContagiousReferences; + + /** + * References within the assignment, that are able to spread the need for analysis. + * */ + private Set<String> contagiousReferences; + + /** + * References within the assignment, that are referring to an infected and contagious assignment. + * */ + private Set<String> infectedReferences; + + protected AssignmentHandler(Assignment assignment) { + this.assignment = assignment; + reasons = new ArrayList<String>(); + nonContagiousReferences = new HashSet<String>(); + contagiousReferences = new HashSet<String>(); + infectedReferences = new HashSet<String>(); + isInfected = false; + isContagious = false; + } + + public Assignment getAssignment() { + return assignment; + } + + public boolean getIsInfected() { + return isInfected; + } + + public void setIsInfected(boolean isBroken) { + this.isInfected = isBroken; + } + + public boolean getIsContagious() { + return isContagious; + } + + public void setIsContagious(boolean isAbleToSpread) { + this.isContagious = isAbleToSpread; + } + + public void initStartParts() { + setIsInfected(true); + setIsContagious(true); + } + + public void addReason(String reason) { + reasons.add(reason); + } + + public List<String> getReasons() { + return reasons; + } + + public Set<String> getNonContagiousReferences() { + return nonContagiousReferences; + } + + public boolean doNonContagiousReferencesContains(String name) { + return nonContagiousReferences.contains(name); + } + + public void addNonContagiousReferences(Collection<? extends String> references) { + nonContagiousReferences.addAll(references); + } + + public void addNonContagiousReference(String reference) { + nonContagiousReferences.add(reference); + } + + public Set<String> getContagiousReferences() { + return contagiousReferences; + } + + public boolean isContagiousReferencesContains(String name) { + return contagiousReferences.contains(name); + } + + public void addContagiousReferences(Collection<? extends String> references) { + contagiousReferences.addAll(references); + } + + public void addContagiousReference(String reference) { + contagiousReferences.add(reference); + } + + public void removeFromContagiousReferences(String reference) { + contagiousReferences.remove(reference); + } + + public Set<String> getInfectedReferences() { + return infectedReferences; + } + + public void addInfectedReferences(Collection<? extends String> references) { + infectedReferences.addAll(references); + } + + public void addInfectedReference(String reference) { + infectedReferences.add(reference); + } + + @Override + public String toString() { + return assignment.getIdentifier().getDisplayName(); + } + + public boolean isVisibleIn(Module dependentModule) { + return assignment.getMyScope().getModuleScope().isVisible(CompilationTimeStamp.getBaseTimestamp(), dependentModule.getIdentifier(), assignment); + } + + @Override + public void check(AssignmentHandler definitionHandler) { + checkIsInfected(definitionHandler); + checkIsContagious(definitionHandler); + } + + public void checkIsInfected(AssignmentHandler other) { + String otherName = other.getAssignment().getIdentifier().getDisplayName(); + if (other.getIsInfected() && (doNonContagiousReferencesContains(otherName) || isContagiousReferencesContains(otherName))) { + addInfectedReference(otherName); + setIsInfected(true); + addReason("It uses " + otherName + "@" + other.getAssignment().getMyScope().getModuleScope().getIdentifier().getDisplayName() + " which is infected."); + } + } + + public void checkIsContagious(AssignmentHandler other) { + String otherName = other.getAssignment().getIdentifier().getDisplayName(); + if (other.getIsInfected() && isContagiousReferencesContains(otherName)) { + addInfectedReference(otherName); + setIsContagious(true); + addReason("It uses contagious reference " + otherName + "@" + other.getAssignment().getMyScope().getModuleScope().getIdentifier().getDisplayName() + " which is infected."); + } + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerAFTGeneral.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerAFTGeneral.java new file mode 100644 index 0000000000000000000000000000000000000000..a1c59161ed49c82cfefdb77c6bfe3ac1bdfd8941 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerAFTGeneral.java @@ -0,0 +1,39 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import org.eclipse.titan.designer.AST.IVisitableNode; +import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.AST.TTCN3.definitions.Definition; +import org.eclipse.titan.designer.AST.TTCN3.statements.StatementBlock; + +/** + * @author Peter Olah + */ +public final class AssignmentHandlerAFTGeneral extends AssignmentHandler { + + protected AssignmentHandlerAFTGeneral(Definition definition) { + super(definition); + } + + @Override + public int visit(IVisitableNode node) { + if (node instanceof StatementBlock) { + ReferenceCollector referenceCollector = new ReferenceCollector(); + node.accept(referenceCollector); + addNonContagiousReferences(referenceCollector.getReferencesAsString()); + return V_SKIP; + } + + if (node instanceof Reference) { + addContagiousReference(((Reference) node).getId().getDisplayName()); + } + + return V_CONTINUE; + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerAFTRerences.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerAFTRerences.java new file mode 100644 index 0000000000000000000000000000000000000000..99aa8ab1a745b68fac48c7ddd316afc3ad8cd525 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerAFTRerences.java @@ -0,0 +1,99 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.IVisitableNode; +import org.eclipse.titan.designer.AST.Identifier; +import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.AST.ASN1.ASN1Assignment; +import org.eclipse.titan.designer.AST.TTCN3.statements.StatementBlock; + +/** + * + * @author Peter Olah + */ +public final class AssignmentHandlerAFTRerences extends ReferencesProcessor { + + public AssignmentHandlerAFTRerences(Assignment assignment) { + super(assignment); + } + + @Override + public void check(AssignmentHandler assignmentHandler) { + if (assignmentHandler instanceof AssignmentHandlerComponent) { + checkIsInfected((AssignmentHandlerComponent) assignmentHandler); + } else { + checkIsInfected(assignmentHandler); + } + checkIsContagious(assignmentHandler); + } + + private Set<String> computeIsInfected(Set<String> otherInfectedReferences) { + + Set<String> result = new HashSet<String>(); + + Set<String> intersectionWithNonContagiousReferences = new HashSet<String>(getNonContagiousReferences()); + intersectionWithNonContagiousReferences.retainAll(otherInfectedReferences); + + Set<String> intersectionWithContagiousReferences = new HashSet<String>(getContagiousReferences()); + intersectionWithContagiousReferences.retainAll(otherInfectedReferences); + + result.addAll(intersectionWithNonContagiousReferences); + result.addAll(intersectionWithContagiousReferences); + return result; + } + + public void checkIsInfected(AssignmentHandlerComponent other) { + if (!other.getIsInfected()) { + return; + } + + String otherName = other.getAssignment().getIdentifier().getDisplayName(); + if (other.getAssignment().getLastTimeChecked() == null) { + if (isContagiousReferencesContains(otherName)) { + setIsInfected(true); + addInfectedReference(otherName); + return; + } + } + Set<String> infectedReferences = computeIsInfected(other.getInfectedReferences()); + if (!infectedReferences.isEmpty() || isContagiousReferencesContains(otherName)) { + setIsInfected(true); + addReason("It uses " + otherName + "@" + other.getAssignment().getMyScope().getModuleScope().getIdentifier().getDisplayName() + " which is infected."); + } + } + + @Override + public int visit(IVisitableNode node) { + if (node instanceof ASN1Assignment) { + ASN1Assignment assignment = (ASN1Assignment) node; + if(assignment.getAssPard() != null) { + return V_SKIP; + } + } + if (node instanceof StatementBlock) { + ReferenceCollector referenceCollector = new ReferenceCollector(); + node.accept(referenceCollector); + Set<Reference> references = referenceCollector.getReferences();//TODO: broken if reference does not point anywhere + addNonContagiousReferences(computeReferences(references)); + if(containsErroneousReference(references)) { + setIsInfected(true); + } + return V_SKIP; + } + + if (node instanceof Reference) { + addContagiousReference(((Reference) node).getId().getDisplayName()); + } + return V_CONTINUE; + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerComponent.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..b277bc25a512f536263a40f00ad21ee93e936aeb --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerComponent.java @@ -0,0 +1,123 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.IVisitableNode; +import org.eclipse.titan.designer.AST.TTCN3.definitions.Definition; +import org.eclipse.titan.designer.AST.TTCN3.types.ComponentTypeBody; +import org.eclipse.titan.designer.AST.TTCN3.types.ComponentTypeReferenceList; + +/** + * + * @author Peter Olah + */ +public final class AssignmentHandlerComponent extends ReferencesProcessor { + + public AssignmentHandlerComponent(Assignment assignment) { + super(assignment); + componentDefinitions = new HashMap<Definition, Set<String>>(); + } + + private Map<Definition, Set<String>> componentDefinitions; + + public void collectDataFrom(ComponentTypeBody componentTypeBody) { + for (Definition tempDefinition : componentTypeBody.getDefinitions()) { + ReferenceCollector referenceCollector = new ReferenceCollector(); + tempDefinition.accept(referenceCollector); + Set<String> references = computeReferences(referenceCollector.getReferences()); + if (containsErroneousReference(referenceCollector.getReferences())) { + setIsInfected(true); + } + componentDefinitions.put(tempDefinition, references); + } + + processComponentTypeReferenceList(componentTypeBody.getAttributeExtensions()); + processComponentTypeReferenceList(componentTypeBody.getExtensions()); + } + + private void processComponentTypeReferenceList(ComponentTypeReferenceList componentTypeReferenceList) { + if (componentTypeReferenceList != null) { + ReferenceCollector referenceCollector = new ReferenceCollector(); + componentTypeReferenceList.accept(referenceCollector); + if (containsErroneousReference(referenceCollector.getReferences())) { + setIsInfected(true); + } + addContagiousReferences(computeReferences(referenceCollector.getReferences())); + } + } + + @Override + public Set<String> getNonContagiousReferences() { + Set<String> result = super.getNonContagiousReferences(); + + for (Map.Entry<Definition, Set<String>> entry : componentDefinitions.entrySet()) { + Set<String> references = entry.getValue(); + result.addAll(references); + } + + return result; + } + + @Override + public void check(AssignmentHandler assignmentHandler) { + checkIsInfected(assignmentHandler); + checkIsContagious(assignmentHandler); + } + + @Override + public void checkIsInfected(AssignmentHandler other) { + if (!other.getIsInfected()) { + return; + } + String otherName = other.getAssignment().getIdentifier().getDisplayName(); + if (other.getAssignment().getLastTimeChecked() == null) { + if (isContagiousReferencesContains(otherName)) { + setIsInfected(true); + addInfectedReference(otherName); + addReason("It uses " + otherName + "@" + other.getAssignment().getMyScope().getModuleScope().getIdentifier().getDisplayName() + " which is infected."); + return; + } + } + + Set<String> infectedFields = computeInfectedFields(otherName); + if (!infectedFields.isEmpty()) { + addContagiousReferences(infectedFields); + addInfectedReferences(infectedFields); + setIsInfected(true); + addReason("It uses " + otherName + "@" + other.getAssignment().getMyScope().getModuleScope().getIdentifier().getDisplayName() + " which is infected."); + } + } +//TODO ez lehetne boolean ? + private Set<String> computeInfectedFields(String definitionName) { + Set<String> result = new HashSet<String>(); + for (Map.Entry<Definition, Set<String>> entry : componentDefinitions.entrySet()) { + Set<String> references = entry.getValue(); + for (String referene : references) { + if (referene.equals(definitionName)) { + result.add(definitionName); + } + } + } + return result; + } + + @Override + public int visit(IVisitableNode node) { + if (node instanceof ComponentTypeBody) { + collectDataFrom((ComponentTypeBody) node); + return V_SKIP; + } + return V_CONTINUE; + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerFactory.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..344a2129591146afc7f291278fd953cb3033f220 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/AssignmentHandlerFactory.java @@ -0,0 +1,45 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.IType; +import org.eclipse.titan.designer.AST.TTCN3.types.Component_Type; +import org.eclipse.titan.designer.parsers.CompilationTimeStamp; + +/** + * + * @author Peter Olah + */ +public final class AssignmentHandlerFactory { + + public static AssignmentHandler getDefinitionHandler(Assignment assignment) { + + switch (assignment.getAssignmentType()) { + case A_ALTSTEP: + case A_FUNCTION: + case A_FUNCTION_RTEMP: + case A_FUNCTION_RVAL: + case A_TESTCASE: + return new AssignmentHandlerAFTRerences(assignment); + case A_TYPE: + boolean compilationTimeStampIsNull = assignment.getLastTimeChecked() == null; + IType type = assignment.getType(CompilationTimeStamp.getBaseTimestamp()); + if (compilationTimeStampIsNull) { + assignment.resetLastTimeChecked(); + } + if (type instanceof Component_Type) { + return new AssignmentHandlerComponent(assignment); + } else { + return new AssignmentHandlerAFTRerences(assignment); + } + default: + return new AssignmentHandlerAFTRerences(assignment); + } + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/BrokenPartsChecker.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/BrokenPartsChecker.java new file mode 100644 index 0000000000000000000000000000000000000000..cbaeed601f16c3fad4218ba9b439373fc31cd0e0 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/BrokenPartsChecker.java @@ -0,0 +1,100 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.Module; +import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module; +import org.eclipse.titan.designer.parsers.CompilationTimeStamp; + +/** + * Helper class to check broken parts. + * + * @author Peter Olah + */ +public final class BrokenPartsChecker { + + private final SubProgressMonitor semanticMonitor; + + private final IProgressMonitor monitor; + + private final CompilationTimeStamp compilationCounter; + + private final SelectionMethodBase selectionMethod; + + public BrokenPartsChecker(final IProgressMonitor monitor, final CompilationTimeStamp compilationCounter, final SelectionMethodBase selectionMethod) { + this.compilationCounter = compilationCounter; + this.selectionMethod = selectionMethod; + this.monitor = monitor; + semanticMonitor = new SubProgressMonitor(this.monitor, 1); + } + + public void doChecking() { + monitor.subTask("Semantic checking"); + + switch (selectionMethod.getSelectionAlgorithm()) { + case MODULESELECTIONORIGINAL: + generalChecker(); + break; + case BROKENREFERENCESINVERTED: + BrokenPartsViaReferences brokenParts = (BrokenPartsViaReferences)selectionMethod; + Map<Module, List<Assignment>> moduleAndBrokenDefinitions = brokenParts.getModuleAndBrokenDefs(); + if (brokenParts.getAnalyzeOnlyDefinitions()) { + definitionsChecker(moduleAndBrokenDefinitions); + } else { + generalChecker(); + } + break; + default: + generalChecker(); + break; + } + + + + monitor.subTask("Doing post semantic checks"); + + for (Module module : selectionMethod.getModulesToCheck()) { + module.postCheck(); + } + + semanticMonitor.done(); + } + //TODO check if this can be merged with the following one + private void generalChecker() { + semanticMonitor.beginTask("Semantic check", selectionMethod.getModulesToCheck().size()); + // process the modules one-by-one + for (final Module module : selectionMethod.getModulesToCheck()) { + semanticMonitor.subTask("Semantically checking module: " + module.getName()); + module.check(compilationCounter); + semanticMonitor.worked(1); + } + } + + private void definitionsChecker(Map<Module, List<Assignment>> moduleAndBrokenDefs) { + semanticMonitor.beginTask("Semantic check", moduleAndBrokenDefs.size()); + + for (Map.Entry<Module, List<Assignment>> entry : moduleAndBrokenDefs.entrySet()) { + Module module = entry.getKey(); + + semanticMonitor.subTask("Semantically checking broken parts in module: " + module.getName()); + + if (module instanceof TTCN3Module) { + ((TTCN3Module) module).checkWithDefinitions(compilationCounter, entry.getValue()); + } else { + module.check(compilationCounter); + } + semanticMonitor.worked(1); + } + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/BrokenPartsViaReferences.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/BrokenPartsViaReferences.java new file mode 100644 index 0000000000000000000000000000000000000000..88000002d064f3551741a6b0891caff87671591e --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/BrokenPartsViaReferences.java @@ -0,0 +1,431 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.swt.widgets.Display; +import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.Assignments; +import org.eclipse.titan.designer.AST.Module; +import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module; +import org.eclipse.titan.designer.consoles.TITANDebugConsole; +import org.eclipse.titan.designer.parsers.CompilationTimeStamp; +import org.eclipse.titan.designer.preferences.PreferenceConstants; +import org.eclipse.titan.designer.productUtilities.ProductConstants; + +/** + * @author Peter Olah + */ +public final class BrokenPartsViaReferences extends SelectionMethodBase implements IBaseAnalyzer { + private CompilationTimeStamp timestamp; + private Map<Module, List<Assignment>> moduleAndBrokenAssignments; + private int brokenModulesLimit; + private boolean analyzeOnlyAssignments; + + protected BrokenPartsViaReferences(SelectionAlgorithm selectionAlgorithm, final CompilationTimeStamp timestamp) { + super(selectionAlgorithm); + moduleAndBrokenAssignments = new HashMap<Module, List<Assignment>>(); + analyzeOnlyAssignments = false; + brokenModulesLimit = Platform.getPreferencesService().getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.BROKENMODULESRATIO, 100, null); + this.timestamp = timestamp; + header = "\n**Selection with Broken parts via references is started at:"; + footer = "**Selection with Broken parts via references is ended at: "; + } + + public Map<Module, List<Assignment>> getModuleAndBrokenDefs() { + return moduleAndBrokenAssignments; + } + + public boolean getAnalyzeOnlyDefinitions() { + return analyzeOnlyAssignments; + } + + @Override + public void execute() { + if (writeDebugInfo) { + TITANDebugConsole.println(String.format(format, header, simpleDateFormat.format(new Date()))); + } + start = System.nanoTime(); + + List<Module> startModules = new ArrayList<Module>(); + Map<Module, List<Module>> invertedImports = buildInvertedImportStructure(allModules, startModules); + + computeAnalyzeOnlyDefinitionsFlag(allModules, startModules); + + if (getAnalyzeOnlyDefinitions()) { + Map<Module, List<AssignmentHandler>> result = collectBrokenParts(startModules, invertedImports); + if (writeDebugInfo) { + writeDebugInfo(result); + } + collectRealBrokenParts(result); + } else { + List<Module> modules = collectBrokenModulesViaInvertedImports(startModules, invertedImports); + modulesToCheck.addAll(modules); + } + + afterExecute(); + + end = System.nanoTime() - start; + if (writeDebugInfo) { + TITANDebugConsole.println(String.format(format, footer, simpleDateFormat.format(new Date()))); + infoAfterExecute(); + } + } + + public void computeAnalyzeOnlyDefinitionsFlag(List<Module> allModules, List<Module> startModules) { + float brokenModulesRatio = (float) ((startModules.size() * 100.0) / allModules.size()); + if (Float.compare(brokenModulesRatio, (float) brokenModulesLimit) < 0) { + analyzeOnlyAssignments = true; + } + } + + /** + * It is build an inverted import structure and identify startmodules, which CompilationTimeStamp is null. + * + * @param allModules + * the list of modules to be check. Initially all modules. + * @param startModules + * the list of modules to be check. Initially all modules, but the function will remove those that can be skipped. + * + * @return invertedImports contains the next:<br> + * - key: a module.<br> + * - values: in these modules the key module is used, so all values imported this module, it is an inverted "imported" connection.<br> + * If module A import B, C, D and module B import D, E then the next structure will be built:<br> + * A = [],<br> + * B = [A],<br> + * C = [A],<br> + * D = [A, B],<br> + * E = [B]<br> + */ + protected Map<Module, List<Module>> buildInvertedImportStructure(final List<Module> allModules, final List<Module> startModules) { + + Map<Module, List<Module>> invertedImports = new HashMap<Module, List<Module>>(); + + for (Module actualModule : allModules) { + // Collect injured modules directly into startModules, we will start the checking from these modules. + // Collect modules which have not been checked semantically. + if ((actualModule.getLastCompilationTimeStamp() == null || !semanticallyChecked.contains(actualModule.getName())) && !startModules.contains(actualModule) ) { + startModules.add(actualModule); + } + + // We have to add all module to get a correct inverted import structure. + // It covers the case when a module is a top-level module, so it has't got any import. + if (!invertedImports.containsKey(actualModule)) { + invertedImports.put(actualModule, new ArrayList<Module>()); + } + + for (Module actualImportedModule : actualModule.getImportedModules()) { + if (!invertedImports.containsKey(actualImportedModule)) { + List<Module> temp = new ArrayList<Module>(); + temp.add(actualModule); + invertedImports.put(actualImportedModule, temp); + } else { + List<Module> dependentModules = invertedImports.get(actualImportedModule); + + if (!dependentModules.contains(actualModule)) { + dependentModules.add(actualModule); + } + } + } + } + + return invertedImports; + } + + protected List<Module> collectBrokenModulesViaInvertedImports(final List<Module> startModules, final Map<Module, List<Module>> invertedImports) { + + List<Module> startModulesCopy = new ArrayList<Module>(startModules); + + List<Module> result = new ArrayList<Module>(); + + for (int s = 0; s < startModulesCopy.size(); ++s) { + Module startModule = startModulesCopy.get(s); + if (!result.contains(startModule)) { + result.add(startModule); + } + List<Module> whereStartModuleUsed = invertedImports.get(startModule); + for (int d = 0; d < whereStartModuleUsed.size(); ++d) { + Module dependentModule = whereStartModuleUsed.get(d); + if (!startModulesCopy.contains(dependentModule)) { + startModulesCopy.add(dependentModule); + } + } + } + return result; + } + + protected Map<Module, List<AssignmentHandler>> collectBrokenParts(final List<Module> startModules, Map<Module, List<Module>> invertedImports) { + + List<Module> startModulesCopy = new ArrayList<Module>(startModules); + + Map<Module, List<AssignmentHandler>> moduleAndBrokenAssignments = new HashMap<Module, List<AssignmentHandler>>(); + + processStartModules(startModulesCopy, moduleAndBrokenAssignments); + + for (int i = 0; i < startModulesCopy.size(); ++i) { + Module startModule = startModulesCopy.get(i); + List<AssignmentHandler> startAssignments; + if (moduleAndBrokenAssignments.containsKey(startModule)) { + startAssignments = moduleAndBrokenAssignments.get(startModule); + } else { + startAssignments = getAssignmentsFrom(startModule); + moduleAndBrokenAssignments.put(startModule, startAssignments); + } + + if (!startAssignments.isEmpty()) { + List<Module> whereStartModuleUsed = invertedImports.get(startModule); + for (int j = 0; j < whereStartModuleUsed.size(); ++j) { + Module dependentModule = whereStartModuleUsed.get(j); + List<AssignmentHandler> dependentAssignments; + if (moduleAndBrokenAssignments.containsKey(dependentModule)) { + dependentAssignments = moduleAndBrokenAssignments.get(dependentModule); + } else { + dependentAssignments = getAssignmentsFrom(dependentModule); + moduleAndBrokenAssignments.put(dependentModule, dependentAssignments); + } + + // We have to separate broken and not broken definition, because of postcheck. + List<AssignmentHandler> brokens = new ArrayList<AssignmentHandler>(); + List<AssignmentHandler> notBrokens = new ArrayList<AssignmentHandler>(); + + for (int s = 0; s < startAssignments.size(); ++s) { + AssignmentHandler startAssignment = startAssignments.get(s); + if (startAssignment.getIsContagious()) { + for (int d = 0; d < dependentAssignments.size(); ++d) { + AssignmentHandler dependentAssignment = dependentAssignments.get(d); + dependentAssignment.check(startAssignment); + if (dependentAssignment.getIsInfected()) { + if (!startModulesCopy.contains(dependentModule)) { + startModulesCopy.add(dependentModule); + } + + brokens.add(dependentAssignment); + } + } + } + } + + for (int d = 0; d < dependentAssignments.size(); ++d) { + AssignmentHandler dependentAssignment = dependentAssignments.get(d); + if (!dependentAssignment.getIsInfected()) { + notBrokens.add(dependentAssignment); + } + } + + // Have to post check of local definition of modules. + // A definition can reference an other definition too. + checkLocalAssignments(brokens, notBrokens); + + // If dependent module not added startModules, + // it means it has not got broken definition, + // so we have to delete it from moduleAndBrokenDefs. + if (!startModulesCopy.contains(dependentModule)) { + moduleAndBrokenAssignments.remove(dependentModule); + } + + } + } + + } + + return moduleAndBrokenAssignments; + } + + protected void collectRealBrokenParts(Map<Module, List<AssignmentHandler>> moduleAndAssignments + ) { + for (Map.Entry<Module, List<AssignmentHandler>> entry : moduleAndAssignments.entrySet()) { + List<Assignment> assignments = new ArrayList<Assignment>(); + for (AssignmentHandler assignmentHandler : entry.getValue()) { + if (assignmentHandler.getIsInfected()) { + assignments.add(assignmentHandler.getAssignment()); + } + } + if (!assignments.isEmpty()) { + Module module = entry.getKey(); + moduleAndBrokenAssignments.put(module, assignments); + modulesToCheck.add(module); + } + } + } + + public void processStartModules(final List<Module> startModules, Map<Module, List<AssignmentHandler>> moduleAndBrokenAssignments) { + for (Module startModule : startModules) { + if (startModule instanceof TTCN3Module && startModule.getLastCompilationTimeStamp() != null) { + Assignments startAssignments = startModule.getAssignments(); + List<AssignmentHandler> brokens = new ArrayList<AssignmentHandler>(); + List<AssignmentHandler> notBrokens = new ArrayList<AssignmentHandler>(); + for (int d = 0; d < startAssignments.getNofAssignments(); ++d) { + Assignment startAssignment = startAssignments.getAssignmentByIndex(d); + AssignmentHandler assignmentHandler = AssignmentHandlerFactory.getDefinitionHandler(startAssignment); + boolean wasNull = false; + if (startAssignment.getLastTimeChecked() == null) { + wasNull = true; + startAssignment.check(timestamp); + } + startAssignment.accept(assignmentHandler); + if (wasNull) { + assignmentHandler.initStartParts(); + assignmentHandler.addReason("Definition's CompilationTimeStamp is null, because of incremental parsing."); + brokens.add(assignmentHandler); + } else if (assignmentHandler.getIsInfected()) { + assignmentHandler.addReason("Definition contains an infected reference."); + brokens.add(assignmentHandler); + } else { + notBrokens.add(assignmentHandler); + } + } + + if (!brokens.isEmpty()) { + checkLocalAssignments(brokens, notBrokens); + if (!moduleAndBrokenAssignments.containsKey(startModule)) { + moduleAndBrokenAssignments.put(startModule, brokens); + } else { + moduleAndBrokenAssignments.get(startModule).addAll(brokens); + } + } + } else { + startModule.check(timestamp); + List<AssignmentHandler> startAssignments = getAssignmentsFrom(startModule); + for (AssignmentHandler assignmentHandler : startAssignments) { + assignmentHandler.initStartParts(); + assignmentHandler.addReason("Parent module's CompilationTimeStamp is null."); + } + if (!moduleAndBrokenAssignments.containsKey(startModule)) { + moduleAndBrokenAssignments.put(startModule, startAssignments); + } else { + moduleAndBrokenAssignments.get(startModule).addAll(startAssignments); + } + } + } + } + + public List<AssignmentHandler> getAssignmentsFrom(Module module) { + List<AssignmentHandler> assignmentHandlers = new ArrayList<AssignmentHandler>(); + Assignments assignments = module.getAssignmentsScope(); + for (int d = 0; d < assignments.getNofAssignments(); ++d) { + Assignment assignment = assignments.getAssignmentByIndex(d); + AssignmentHandler assignmentHandler = AssignmentHandlerFactory.getDefinitionHandler(assignment); + assignment.accept(assignmentHandler); + assignmentHandlers.add(assignmentHandler); + } + + return assignmentHandlers; + } + + protected void checkLocalAssignments(final List<AssignmentHandler> brokens, final List<AssignmentHandler> notBrokens) { + + if (brokens.isEmpty() || notBrokens.isEmpty()) { + return; + } + + HashMap<String, AssignmentHandler> brokenMap = new HashMap<String, AssignmentHandler>(brokens.size() + notBrokens.size()); + for(AssignmentHandler handler: brokens) { + brokenMap.put(handler.getAssignment().getIdentifier().getDisplayName(), handler); + } + + boolean proceed = true; + while (proceed) { + proceed = false; + + + for (int i = notBrokens.size() -1; i >=0; --i) { + AssignmentHandler notBroken = notBrokens.get(i); + boolean found = false; + for (String name : notBroken.getContagiousReferences()) { + if(brokenMap.containsKey(name)) { + notBroken.check(brokenMap.get(name)); + found = true; + break; + } + } + if(!found) { + for (String name : notBroken.getNonContagiousReferences()) { + if(brokenMap.containsKey(name)) { + notBroken.check(brokenMap.get(name)); + found = true; + break; + } + } + } + + if(found) { + proceed = true; + notBrokens.remove(i); + brokens.add(notBroken); + brokenMap.put(notBroken.getAssignment().getIdentifier().getDisplayName(), notBroken); + } + } + } + } + + protected void writeDebugInfo(final Map<Module, List<AssignmentHandler>> moduleAndAssignments) { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + + TITANDebugConsole.println(" Detailed info:"); + + for (Map.Entry<Module, List<AssignmentHandler>> entry : moduleAndAssignments.entrySet()) { + List<AssignmentHandler> values = entry.getValue(); + + TITANDebugConsole.println(" module: " + entry.getKey().getIdentifier().getDisplayName()); + + for (AssignmentHandler assignmentHandler : values) { + TITANDebugConsole.println(" " + assignmentHandler + " | " + assignmentHandler.getReasons()); + if(assignmentHandler.getIsInfected() || assignmentHandler.getIsContagious()) { + TITANDebugConsole.println(" " + (assignmentHandler.getIsInfected() ? "[+]" : "[-]") + " : infected"); + TITANDebugConsole.println(" " + (assignmentHandler.getIsContagious() ? "[+]" : "[-]") + " : contagious"); + TITANDebugConsole.println(" nonContagious references: " + assignmentHandler.getNonContagiousReferences()); + TITANDebugConsole.println(" contagious references: " + assignmentHandler.getContagiousReferences()); + TITANDebugConsole.println(" infected references: " + assignmentHandler.getInfectedReferences()); + } + } + } + + TITANDebugConsole.println(" in dot format:"); + TITANDebugConsole.println(" digraph {"); + TITANDebugConsole.println(" rankdir=LR;"); + + ArrayList<Module> modules = new ArrayList<Module>(moduleAndAssignments.keySet()); + Collections.sort(modules, new Comparator<Module>() { + + @Override + public int compare(Module o1, Module o2) { + return o1.getName().compareTo(o2.getName()); + } + + }); + + for (Module module : modules) { + String moduleName = module.getName(); + TITANDebugConsole.println(" subgraph cluster_" + moduleName + " {"); + TITANDebugConsole.println(" label=\" " + module.getIdentifier().getDisplayName() + "\";"); + + List<AssignmentHandler> values = moduleAndAssignments.get(module); + + for (AssignmentHandler assignmentHandler : values) { + for(String reference: assignmentHandler.getInfectedReferences()) { + TITANDebugConsole.println(" " + assignmentHandler.getAssignment().getIdentifier().getDisplayName() + "->" + reference + ";"); + } + } + TITANDebugConsole.println(" }"); + } + TITANDebugConsole.println(" }"); + + } + }); + } +} \ No newline at end of file diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/IAssignmentChecker.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/IAssignmentChecker.java new file mode 100644 index 0000000000000000000000000000000000000000..ebb650df26aa59fd47e5d996c52844a597cb8f19 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/IAssignmentChecker.java @@ -0,0 +1,15 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +/** + * @author Peter Olah + */ +public interface IAssignmentChecker { + public void check(AssignmentHandler definitionChecker); +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/IBaseAnalyzer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/IBaseAnalyzer.java new file mode 100644 index 0000000000000000000000000000000000000000..883e3598845d76f83ed405ebde76d2baf98f4e96 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/IBaseAnalyzer.java @@ -0,0 +1,18 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +/** + * Base interface of selection algorithm. + * All algorithm have to implement this interface. + * + * @author Peter Olah + */ +public interface IBaseAnalyzer { + public void execute(); +} \ No newline at end of file diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/OriginalModuleSelection.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/OriginalModuleSelection.java new file mode 100644 index 0000000000000000000000000000000000000000..c43539e13476e93aa2c403d327ab5983ff191660 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/OriginalModuleSelection.java @@ -0,0 +1,226 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.titan.designer.AST.Module; +import org.eclipse.titan.designer.AST.TTCN3.definitions.ImportModule; +import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module; +import org.eclipse.titan.designer.consoles.TITANDebugConsole; +import org.eclipse.titan.designer.preferences.PreferenceConstants; +import org.eclipse.titan.designer.productUtilities.ProductConstants; +import org.eclipse.ui.console.MessageConsoleStream; + +/** + * Original solution wrapped into class. + * + */ +public final class OriginalModuleSelection extends SelectionMethodBase implements IBaseAnalyzer { + private boolean doIncrementalParsing; + + public OriginalModuleSelection() { + super(SelectionAlgorithm.MODULESELECTIONORIGINAL); + doIncrementalParsing = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.USEINCREMENTALPARSING, false, null); + header = "\n**Selection with Original algorithm is started at:"; + footer = "**Selection with Original algorithm is started at:"; + } + + @Override + public void execute() { + if (writeDebugInfo){ + TITANDebugConsole.println(String.format(format, header, simpleDateFormat.format(new Date()))); + } + start = System.nanoTime(); + + boolean foundSkippable = true; + while (foundSkippable) { + foundSkippable = calculateModulesToSkip(allModules, modulesToSkip); + } + + modulesToCheck.addAll(allModules); + + //TODO check if this can be removed + if (doIncrementalParsing) { + incrementalParsing(); + } + + end = System.nanoTime() - start; + if (writeDebugInfo) { + TITANDebugConsole.println(String.format(format, footer, simpleDateFormat.format(new Date()))); + infoAfterExecute(); + } + } + + /** + * Calculates the list of modules that can be skipped when analyzing this project semantically. + * <p> + * This function might not be able to detect all modules that can be skipped at once. It should be run as long as it reports that it could remove new modules from the list of modules to be + * checked. + * + * @param modulesToCheck + * the list of modules to be check. Initially all modules, but the function will remove those that can be skipped. + * @param modulesToSkip + * the list of modules that can be skipped, to be generated by the function. + * + * @return true if there were modules found that can be skipped from analyzing, false otherwise. + */ + private boolean calculateModulesToSkip(final List<Module> modulesToCheck, final List<Module> modulesToSkip) { + if (modulesToCheck.isEmpty()) { + return false; + } + + boolean foundSkippable = false; + // proven to need checking + List<Module> failed = new ArrayList<Module>(); + List<Module> modulesToCheckCopy = new ArrayList<Module>(); + modulesToCheckCopy.addAll(modulesToCheck); + MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); + + for (Iterator<Module> iterator = modulesToCheckCopy.iterator(); iterator.hasNext();) { + Module module = iterator.next(); + if (module == null) { + continue; + } + if (failed.contains(module) || modulesToSkip.contains(module)) { + continue; + } + + if (module.getLastCompilationTimeStamp() == null || !semanticallyChecked.contains(module.getName())) { + if (writeDebugInfo) { + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it was not yet analyzed.", stream); + } + failed.add(module); + continue; + } + + /** + * The modules that are reachable from the starting one. + */ + List<Module> reachableModules = new ArrayList<Module>(); + reachableModules.add(module); + + boolean valid = true; + for (int i = 0; i < reachableModules.size() && valid; i++) { + Module module2 = reachableModules.get(i); + if (module2 == null) { + valid = false; + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it reaches a module that could not be parsed.", stream); + continue; + } + if (failed.contains(module2)) { + valid = false; + continue; + } + if (module2.getLastCompilationTimeStamp() != null || !semanticallyChecked.contains(module2.getName())) { + if (module2.hasUnhandledImportChanges()) { + valid = false; + failed.add(module2); + if (writeDebugInfo) { + TITANDebugConsole.println(" ** Module " + module2.getName() + " can not be skipped as it has unhandled import changes.", stream); + if (module != module2) { + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it depends on " + module2.getName() + " which has unhandled import changes.", stream); + } + } + continue; + } + List<Module> importedModules = module2.getImportedModules(); + if (!importedModules.isEmpty()) { + boolean allElements = true; + Module module3; + for (int j = 0; j < importedModules.size() && allElements; j++) { + module3 = importedModules.get(j); + if (module3 == null) { + // erroneous + // import + allElements = false; + if (writeDebugInfo) { + if (module2 instanceof TTCN3Module) { + final List<ImportModule> impModules = ((TTCN3Module) module2).getImports(); + if (j < impModules.size()) { + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it imports `" + impModules.get(j).getName() + "' that could not be parsed.", stream); + } + } + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it imports a module that could not be parsed.", stream); + } + } else if (failed.contains(module3)) { + allElements = false; + if (writeDebugInfo) { + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it depends on " + module3.getName() + " which needs to be checked.", stream); + } + } else if (modulesToSkip.contains(module3)) { + // already decided, that it can be skipped + } else if (module3.getLastCompilationTimeStamp() == null|| !semanticallyChecked.contains(module3.getName())) { + // imports a module that was not checked, so + // this must also be re-checked + allElements = false; + if (writeDebugInfo) { + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it depends on " + module3.getName() + " which was not yet analyzed.", stream); + } + } else { + if (!reachableModules.contains(module3)) { + reachableModules.add(module3); + } + } + } + + if (!allElements) { + valid = false; + } + } + } else { + // The module was not yet checked. + valid = false; + TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it depends on " + module2.getName() + " which was not yet checked.", stream); + } + } + + if (valid) { + modulesToSkip.addAll(reachableModules); + modulesToCheck.removeAll(reachableModules); + foundSkippable = true; + } else { + failed.add(module); + } + } + + if (writeDebugInfo) { + TITANDebugConsole.println(" ** Found " + modulesToCheck.size() + " modules that needs to be checked and " + modulesToSkip.size() + " modules to skip.", stream); + } + + return foundSkippable; + } + + // original solution + public void incrementalParsing() + { + // the modules that can be reached directly must + // be checked as the used state of the + // definitions might have changed + List<Module> modulesToCheck2 = new ArrayList<Module>(); + for (Module module2 : modulesToCheck) { + if (module2.getLastCompilationTimeStamp() != null && semanticallyChecked.contains(module2.getName())) { + List<Module> importedModules = module2.getImportedModules(); + if (importedModules != null && !importedModules.isEmpty()) { + for (Module module3 : importedModules) { + if (module3 != null && !modulesToCheck.contains(module3) && !modulesToCheck2.contains(module3)) { + modulesToCheck2.add(module3); + } + } + } + } + } + + modulesToCheck.addAll(modulesToCheck2); + modulesToSkip.removeAll(modulesToCheck2); + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/ReferenceCollector.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/ReferenceCollector.java new file mode 100644 index 0000000000000000000000000000000000000000..22f9c74c733f6dacfc1c00638ebed387fd9dd8f9 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/ReferenceCollector.java @@ -0,0 +1,47 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.titan.designer.AST.ASTVisitor; +import org.eclipse.titan.designer.AST.IVisitableNode; +import org.eclipse.titan.designer.AST.Reference; + +/** + * @author Peter Olah + */ +public final class ReferenceCollector extends ASTVisitor { + + private Set<Reference> references; + + public Set<Reference> getReferences() { + return references; + } + + public Set<String> getReferencesAsString() { + Set<String> result = new HashSet<String>(); + for (Reference reference : references) { + result.add(reference.getId().getDisplayName()); + } + return result; + } + + public ReferenceCollector() { + references = new HashSet<Reference>(); + } + + @Override + public int visit(IVisitableNode node) { + if (node instanceof Reference) { + references.add(((Reference) node)); + } + return V_CONTINUE; + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/ReferencesProcessor.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/ReferencesProcessor.java new file mode 100644 index 0000000000000000000000000000000000000000..330eeb48071c1e9083e66d9edc824eb5f50f5585 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/ReferencesProcessor.java @@ -0,0 +1,58 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.titan.designer.AST.Assignment; +import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.parsers.CompilationTimeStamp; + +/** + * @author Peter Olah + */ +public abstract class ReferencesProcessor extends AssignmentHandler { + + public ReferencesProcessor(Assignment assignment) { + super(assignment); + } + + public Set<String> computeReferences(final Set<Reference> references) { + Set<String> result = new HashSet<String>(); + for (Reference reference : references) { + Assignment assignment = reference.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false); + + if (assignment != null && assignment.getIdentifier() != null) { + // the name of the assignment might differ from the reference in incremental parsing mode + result.add(assignment.getIdentifier().getDisplayName()); + + } else { + // if semantic error occurs, assignment will be null + // have to get reference id + result.add(reference.getId().getDisplayName()); + } + } + return result; + } + + public boolean containsErroneousReference(final Set<Reference> references) { + for (Reference reference : references) { + if(reference.getIsErroneous(CompilationTimeStamp.getBaseTimestamp())) { + return true; + } + + Assignment assignment = reference.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false); + if(assignment == null) { + return true; + } + } + + return false; + } +} diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/SelectionAlgorithm.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/SelectionAlgorithm.java new file mode 100644 index 0000000000000000000000000000000000000000..7c1f0f158cb315e9f69e870b446a92a9209f77b5 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/SelectionAlgorithm.java @@ -0,0 +1,42 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import org.eclipse.titan.designer.preferences.PreferenceConstantValues; + +/** + * This is a helper class to map string of selection algorithm to enum value. + * + * @author Peter Olah + */ +public enum SelectionAlgorithm { + + MODULESELECTIONORIGINAL(PreferenceConstantValues.MODULESELECTIONORIGINAL), + BROKENREFERENCESINVERTED(PreferenceConstantValues.BROKENPARTSVIAREFERENCES); + + private String readableName; + + private SelectionAlgorithm(String name) { + readableName = name; + } + + public static SelectionAlgorithm fromString(String name) { + if (name != null) { + for (SelectionAlgorithm s : SelectionAlgorithm.values()) { + if (name.equalsIgnoreCase(s.readableName)) { + return s; + } + } + } + return null; + } + + public static SelectionAlgorithm getDefaultValue() { + return SelectionAlgorithm.MODULESELECTIONORIGINAL; + } +} \ No newline at end of file diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/SelectionMethodBase.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/SelectionMethodBase.java new file mode 100644 index 0000000000000000000000000000000000000000..91e833f8f8f38122680ca05223260d06e1860ee0 --- /dev/null +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/brokenpartsanalyzers/SelectionMethodBase.java @@ -0,0 +1,103 @@ +/****************************************************************************** + * Copyright (c) 2000-2015 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + ******************************************************************************/ +package org.eclipse.titan.designer.brokenpartsanalyzers; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.titan.designer.AST.Module; +import org.eclipse.titan.designer.consoles.TITANDebugConsole; +import org.eclipse.titan.designer.preferences.PreferenceConstants; +import org.eclipse.titan.designer.productUtilities.ProductConstants; + + +/** + * Base class of selection methods. + * It is responsible for store input, result and other things. + * + * @author Peter Olah + */ +public abstract class SelectionMethodBase { + + private final SelectionAlgorithm selectionAlgorithm; + + public SelectionAlgorithm getSelectionAlgorithm(){ + return selectionAlgorithm; + } + + protected List<Module> allModules; + + protected List<Module> modulesToCheck; + + public List<Module> getModulesToCheck() { + return modulesToCheck; + } + + protected List<Module> modulesToSkip; + + public List<Module> getModulesToSkip() { + return modulesToSkip; + } + + protected List<String> semanticallyChecked; + + protected long start; + + protected long end; + + protected boolean writeDebugInfo; + + protected SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd hh:mm:ss.SSS");; + + protected String format = "%s %s"; + + protected String header; + + protected String footer; + + public void setModules(final List<Module> allModules, final List<String> semanticallyChecked){ + modulesToCheck = new ArrayList<Module>(); + modulesToSkip = new ArrayList<Module>(); + this.allModules = new ArrayList<Module>(allModules); + this.semanticallyChecked = semanticallyChecked; + } + + protected SelectionMethodBase(SelectionAlgorithm selectionAlgorithm) { + this.selectionAlgorithm = selectionAlgorithm; + writeDebugInfo = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null); + } + + protected void afterExecute() { + if (selectionAlgorithm != SelectionAlgorithm.MODULESELECTIONORIGINAL) { + for (Module module : allModules) { + if (!modulesToCheck.contains(module) && !modulesToSkip.contains(module)) { + modulesToSkip.add(module); + } + } + } + } + + protected void infoAfterExecute() { + TITANDebugConsole.println("**Selection time is: " + ( end * (1e-9) ) + " seconds " + "(" + end + " nanoseconds)."); + TITANDebugConsole.println("**Nr. of broken modules: " + modulesToCheck.size()); + TITANDebugConsole.println("**Broken modules name: " + modulesToCheck); + TITANDebugConsole.println(); + } + + public void setSkippedFromSemanticChecking() + { + for (Module module : modulesToSkip) { + module.setSkippedFromSemanticChecking(true); + } + for (Module module : modulesToCheck) { + module.setSkippedFromSemanticChecking(false); + } + } +} \ No newline at end of file diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/commonFilters/ResourceExclusionHelper.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/commonFilters/ResourceExclusionHelper.java index 55e132a49e0700e09b6a2c914d338551da8562ec..4e07028293c2a8666d2a65bf7313688281ed489c 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/commonFilters/ResourceExclusionHelper.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/commonFilters/ResourceExclusionHelper.java @@ -112,7 +112,6 @@ public final class ResourceExclusionHelper { try { return "true".equalsIgnoreCase(file.getPersistentProperty(EXCLUDED_FILE_QUALIFIER)); } catch (CoreException e) { - ErrorReporter.logExceptionStackTrace("Error while checking persistent property of file: " + file.getName(), e); return false; } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/CompilerVersionInformationCollector.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/CompilerVersionInformationCollector.java index 326785d7e15a35f1bb285bc84e0684c2694cc057..54fa4f8df2e0c1d1e5e4a5b308287809563d7b45 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/CompilerVersionInformationCollector.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/CompilerVersionInformationCollector.java @@ -24,6 +24,7 @@ import org.eclipse.titan.common.utils.Cygwin; import org.eclipse.titan.designer.actions.ExternalTitanAction; import org.eclipse.titan.designer.consoles.TITANConsole; import org.eclipse.titan.designer.consoles.TITANDebugConsole; +import org.eclipse.titan.designer.license.License; import org.eclipse.titan.designer.license.LicenseValidator; import org.eclipse.titan.designer.preferences.PreferenceConstants; import org.eclipse.titan.designer.productUtilities.ProductConstants; @@ -137,8 +138,9 @@ public final class CompilerVersionInformationCollector { PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null); String ttcn3Dir = PathConverter.convert(path, reportDebugInformation, TITANDebugConsole.getConsole()); - - env.put(TTCN3_LICENSE_FILE_KEY, LicenseValidator.getResolvedLicenseFilePath(false)); + if( License.isLicenseNeeded() ) { + env.put(TTCN3_LICENSE_FILE_KEY, LicenseValidator.getResolvedLicenseFilePath(false)); + } env.put(TTCN3_DIR_KEY, ttcn3Dir); String temp = env.get(LD_LIBRARY_PATH_KEY); if (temp == null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/OutputAnalyzer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/OutputAnalyzer.java index bc63b69b150e9757c9299541688eed7168ba85cc..eb648151de9bcc1a4a03ccd74249678bf4e0895c 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/OutputAnalyzer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/OutputAnalyzer.java @@ -49,6 +49,7 @@ public final class OutputAnalyzer { private IProject project; private boolean processedErrorMessages; + private int externalErrorCode = 0; static final Pattern BASE_TITAN_ERROR_PATTERN = Pattern.compile("[ ]*(.+):(.+):[ ]+(error|warning|note):[ ]+(.+)"); private final Matcher baseTITANErrorMatcher = BASE_TITAN_ERROR_PATTERN.matcher(""); @@ -70,6 +71,9 @@ public final class OutputAnalyzer { private final Matcher baseGCCErrorMatcher1 = BASE_GCC_ERROR_PATTERN_1.matcher(""); static final Pattern BASE_GCC_ERROR_PATTERN_2 = Pattern.compile("[ ]*(.+):(\\d+):(\\d+):[ ]+(.+)"); private final Matcher baseGCCErrorMatcher2 = BASE_GCC_ERROR_PATTERN_2.matcher(""); + + static final Pattern BASE_LINKER_ERROR_PATTERN_1 = Pattern.compile("^collect2:[ ]+error:[ ]+ld[ ]+returned[ ]+([1-9])[ ]+exit.*"); + private final Matcher baseLinkerErrorMatcher1 = BASE_LINKER_ERROR_PATTERN_1.matcher(""); private static final String ERROR = "error"; private static final String WARNING = "warning"; @@ -99,6 +103,14 @@ public final class OutputAnalyzer { public boolean hasProcessedErrorMessages() { return processedErrorMessages; } + + /** + * @return the error code from the external operation + * */ + public int getExternalErrorCode() { + return externalErrorCode; + } + /** * Disposes the objects that were buffered to speed up marker creation. @@ -185,6 +197,10 @@ public final class OutputAnalyzer { return addTITANMarker(baseGCCErrorMatcher2.group(1), Integer.parseInt(baseGCCErrorMatcher2.group(2)), Integer.parseInt(baseGCCErrorMatcher2.group(3)), Integer.parseInt(baseGCCErrorMatcher2.group(2)), Integer.parseInt(baseGCCErrorMatcher2.group(3)) + 1, WARNING, baseGCCErrorMatcher2.group(4)); + } else if (baseLinkerErrorMatcher1.reset(line).matches()) { + processedErrorMessages = true; + externalErrorCode = Integer.parseInt(baseLinkerErrorMatcher1.group(1)); + return true; } return false; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ProjectBasedBuilder.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ProjectBasedBuilder.java index 2b1c7b885c6fad49a9cc892aa2dae8c864c863cc..5c55e3ba315bc57c687ec1c46c6ace7417ec2e5f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ProjectBasedBuilder.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ProjectBasedBuilder.java @@ -212,6 +212,59 @@ public final class ProjectBasedBuilder { } } + /** + * @return a list of all projects referencing transitively the actual project. + * */ + public List<IProject> getAllReferencingProjects() { + List<IProject> referenceChain = new ArrayList<IProject>(); + List<IProject> knownProjects = new ArrayList<IProject>(); + + getAllReferencingProjects(referenceChain, project, knownProjects); + + return knownProjects; + } + + /** + * Calculates and returns a list of all projects referencing transitively the provided one. + * + * @param referenceChain + * a reference chain used to detect project reference + * cycles. + * @param actualProject + * the project being checked. + * @param knownProjects + * the projects already known, they shall not be added + * any more to the list. + * */ + private void getAllReferencingProjects(final List<IProject> referenceChain, final IProject actualProject, final List<IProject> knownProjects) { + if (knownProjects.contains(actualProject)) { + return; + } + + if (referenceChain.contains(actualProject)) { + knownProjects.add(actualProject); + return; + } + + IProject[] referencingProjects = ProjectBasedBuilder.getProjectBasedBuilder(actualProject).getReferencingProjects(); + + if (referencingProjects.length == 0) { + knownProjects.add(actualProject); + } + + int size = referenceChain.size(); + referenceChain.add(actualProject); + for (IProject temporalProject : referencingProjects) { + getAllReferencingProjects(referenceChain, temporalProject, knownProjects); + } + + referenceChain.remove(size); + + if (!knownProjects.contains(actualProject)) { + knownProjects.add(actualProject); + } + } + public IProject[] getReferencingProjects() { return project.getReferencingProjects(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANBuilder.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANBuilder.java index 72d92aee32b508441ca57b6d31b9ac460f977dc9..924b28a6eb9968a0ae2d8433a5286bb044e012c7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANBuilder.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANBuilder.java @@ -1149,7 +1149,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder { } internalMonitor.done(); - if (buildJob.foundErrors()) { + if (buildJob.foundErrors() || internalMonitor.isCanceled()) { if (getProject() != null && (kind == FULL_BUILD || kind == INCREMENTAL_BUILD)) { final IProject project2 = getProject(); WorkspaceJob op = new WorkspaceJob("Touching the project") { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANInstallationValidator.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANInstallationValidator.java index 19c84fa7db4f5a61aa2e55610eee7b9bf34fa563..8e7b1c8c5de556276e89b94c7af77546b3348f6a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANInstallationValidator.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANInstallationValidator.java @@ -38,7 +38,7 @@ public final class TITANInstallationValidator { super.buttonPressed(buttonId); if (buttonId == 1) { - PreferencesUtil.createPreferenceDialogOn(new Shell(Display.getDefault()), + PreferencesUtil.createPreferenceDialogOn(null, "org.eclipse.titan.designer.preferences.pages.TITANPreferencePage", null, null).open(); } } @@ -48,8 +48,8 @@ public final class TITANInstallationValidator { private TITANInstallationValidator() { } - public static boolean check(final boolean force_dialog) { - if (!force_dialog && wasChecked) { + public static boolean check(final boolean forceDialog) { + if (!forceDialog && wasChecked) { return wasCorrect; } @@ -64,7 +64,7 @@ public final class TITANInstallationValidator { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - InstallationErrorDialog dialog = new InstallationErrorDialog(new Shell(Display.getDefault()), + InstallationErrorDialog dialog = new InstallationErrorDialog(null, "Checking for installed TITAN failed", "The installation path of TITAN is not set.\n\n" + CORRECTION_STRING); dialog.open(); @@ -86,7 +86,7 @@ public final class TITANInstallationValidator { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - InstallationErrorDialog dialog = new InstallationErrorDialog(new Shell(Display.getDefault()), + InstallationErrorDialog dialog = new InstallationErrorDialog(null, "Checking for installed TITAN failed", "No TITAN was found at " + installationPath + "\n\n" + CORRECTION_STRING); dialog.open(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANJob.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANJob.java index ab4d8c646effc21ab158e3ad2ee8dceb7ff23f9d..109b74409e510b8300de37731c62bf45c0408b79 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANJob.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/TITANJob.java @@ -31,7 +31,6 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.preferences.IPreferencesService; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.utils.Cygwin; import org.eclipse.titan.designer.Activator; @@ -42,6 +41,7 @@ import org.eclipse.titan.designer.actions.ExternalTitanAction; import org.eclipse.titan.designer.consoles.TITANConsole; import org.eclipse.ui.console.MessageConsoleStream; import org.eclipse.titan.designer.graphics.ImageCache; +import org.eclipse.titan.designer.license.License; import org.eclipse.titan.designer.license.LicenseValidator; import org.eclipse.titan.designer.preferences.PreferenceConstants; import org.eclipse.titan.designer.productUtilities.ProductConstants; @@ -136,7 +136,9 @@ public class TITANJob extends WorkspaceJob { Map<String, String> env = pb.environment(); String ttcn3Dir = CompilerVersionInformationCollector.getResolvedInstallationPath(false); - env.put(TTCN3_LICENSE_FILE_KEY, LicenseValidator.getResolvedLicenseFilePath(false)); + if(License.isLicenseNeeded()) { + env.put(TTCN3_LICENSE_FILE_KEY, LicenseValidator.getResolvedLicenseFilePath(false)); + } env.put(TTCN3_DIR_KEY, ttcn3Dir); String temp = env.get(LD_LIBRARY_PATH_KEY); if (temp == null) { @@ -313,6 +315,12 @@ public class TITANJob extends WorkspaceJob { TITANConsole.println(line,stream); } int exitval = proc.waitFor(); + + if ((exitval == 0) && (analyzer.hasProcessedErrorMessages())) { + //make returns error if there was a linker error, but does not propagate the error code + exitval = analyzer.getExternalErrorCode(); + } + if (exitval != 0) { TITANConsole.println(FAILURE + exitval,stream); if (!analyzer.hasProcessedErrorMessages()) { @@ -418,19 +426,19 @@ public class TITANJob extends WorkspaceJob { } if (errorOutput == null || errorOutput.length() == 0) { if (cygwin) { - MessageDialog.openError(new Shell(Display.getDefault()), name + FAILED, builder.toString()); + MessageDialog.openError(null, name + FAILED, builder.toString()); ErrorReporter.logError(builder.toString()); } else { - MessageDialog.openError(new Shell(Display.getDefault()), name + FAILED, + MessageDialog.openError(null, name + FAILED, MessageFormat.format(CHECK_PERMISSION, builder.toString())); ErrorReporter.logError(MessageFormat.format(CHECK_PERMISSION, builder.toString())); } } else { if (cygwin) { - MessageDialog.openError(new Shell(Display.getDefault()), name + FAILED, builder.toString()); + MessageDialog.openError(null, name + FAILED, builder.toString()); ErrorReporter.logError(builder.toString()); } else { - MessageDialog.openError(new Shell(Display.getDefault()), name + FAILED, + MessageDialog.openError(null, name + FAILED, MessageFormat.format(ERRORS_FOUND, builder.toString(), errorOutput)); ErrorReporter.logError(MessageFormat.format(ERRORS_FOUND, builder.toString(), errorOutput)); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/declarationsearch/IdentifierFinderVisitor.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/declarationsearch/IdentifierFinderVisitor.java index 9e6b40d1ec8d9b546239aca5a7777eccb6f7f2fa..620f4ffb8e573f5032db62f22b9bb8e70bf85990 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/declarationsearch/IdentifierFinderVisitor.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/declarationsearch/IdentifierFinderVisitor.java @@ -16,6 +16,7 @@ import org.eclipse.titan.designer.AST.IVisitableNode; import org.eclipse.titan.designer.AST.Identifier; import org.eclipse.titan.designer.AST.Location; import org.eclipse.titan.designer.AST.Reference; +import org.eclipse.titan.designer.AST.ASN1.ASN1Assignment; /** * This class is similar to {@link ASTLocationChainVisitor} except it aborts as @@ -23,6 +24,7 @@ import org.eclipse.titan.designer.AST.Reference; * * @author Szabolcs Beres */ +//FIXME why identifierFinderVisitor if it searches for references ? public class IdentifierFinderVisitor extends ASTVisitor { private IReferencingElement reference = null; private ISubReference subReference = null; @@ -35,6 +37,13 @@ public class IdentifierFinderVisitor extends ASTVisitor { @Override public int visit(IVisitableNode node) { + if (node instanceof ASN1Assignment) { + ASN1Assignment assignment = (ASN1Assignment) node; + if(assignment.getAssPard() != null) { + return V_SKIP; + } + } + if (node instanceof ILocateableNode) { final Location loc = ((ILocateableNode) node).getLocation(); if (loc == null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/DeclarationCollector.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/DeclarationCollector.java index 66dd5391c32622d7c214198a9e6891784a68cca1..c87e04e2da2d53b7f2b6017b1a20537fe7378f23 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/DeclarationCollector.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/DeclarationCollector.java @@ -17,26 +17,19 @@ import org.eclipse.titan.designer.AST.Reference; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.TTCN3.definitions.Definition; import org.eclipse.titan.designer.AST.TTCN3.definitions.Group; -import org.eclipse.titan.designer.parsers.ProjectSourceParser; /** * @author Kristof Szabados * */ public final class DeclarationCollector { - /** - * A project parser, used by the collector to reach other modules from - * the given project. Can be null !!! - */ - private final ProjectSourceParser projectSourceParser; /** the reference to identify. */ private final Reference refrence; private final List<DeclarationCollectionHelper> collected; - public DeclarationCollector(final Reference reference, final ProjectSourceParser projectSourceParser) { + public DeclarationCollector(final Reference reference) { this.refrence = reference; - this.projectSourceParser = projectSourceParser; collected = new ArrayList<DeclarationCollectionHelper>(); } @@ -58,10 +51,6 @@ public final class DeclarationCollector { return collected; } - public ProjectSourceParser getProjectParser() { - return projectSourceParser; - } - public void addDeclaration(final String description, final Location location, final Scope scope) { collected.add(new DeclarationCollectionHelper(description, location, scope)); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OccurencesMarker.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OccurencesMarker.java index 72282212c94df237f40d56f3c05c8445a82bb014..cc23ed98a1142ffde031e638ba76c38975b23896 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OccurencesMarker.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OccurencesMarker.java @@ -212,12 +212,14 @@ public abstract class OccurencesMarker { Map<Annotation, Position> annotationMap = new HashMap<Annotation, Position>(); for (Hit hit : result) { - int hitOffset = hit.identifier.getLocation().getOffset(); - int hitEndOffset = hit.identifier.getLocation().getEndOffset(); - if( hitOffset>=0 && hitEndOffset>=0 && hitEndOffset>=hitOffset ) { - final Annotation annotationToAdd = new Annotation(ANNOTATION_TYPE, false, "Occurence of " + hit.identifier.getDisplayName()); - final Position position = new Position(hitOffset, hitEndOffset - hitOffset); - annotationMap.put(annotationToAdd, position); + if (hit.identifier != null) { + int hitOffset = hit.identifier.getLocation().getOffset(); + int hitEndOffset = hit.identifier.getLocation().getEndOffset(); + if( hitOffset>=0 && hitEndOffset>=0 && hitEndOffset>=hitOffset ) { + final Annotation annotationToAdd = new Annotation(ANNOTATION_TYPE, false, "Occurence of " + hit.identifier.getDisplayName()); + final Position position = new Position(hitOffset, hitEndOffset - hitOffset); + annotationMap.put(annotationToAdd, position); + } } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OpenDeclarationHelper.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OpenDeclarationHelper.java index 2244fa0ffa754d2da86e70028cf0a0453fadf70a..69dd576f6e822111ba0ce84135efae5da5b3b0b1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OpenDeclarationHelper.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/OpenDeclarationHelper.java @@ -97,7 +97,7 @@ public final class OpenDeclarationHelper { return null; } - DeclarationCollector declarationCollector = new DeclarationCollector(reference, projectSourceParser); + DeclarationCollector declarationCollector = new DeclarationCollector(reference); scope.addDeclaration(declarationCollector); return declarationCollector; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ProposalCollector.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ProposalCollector.java index ec0de21f82936f236a209ef2eee4b61ecb79869a..6b582dcff4face1bf24062b9694b8be509f7ebd0 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ProposalCollector.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ProposalCollector.java @@ -103,7 +103,7 @@ public final class ProposalCollector { * @param targetIdentifierType * the type identifiers should use to display their * content - * @param context_id + * @param contextId * the identifier of the context where the proposals will * be inserted * @param contextType @@ -116,9 +116,9 @@ public final class ProposalCollector { * @param offset * the offset on which the reference starts * */ - public ProposalCollector(final Identifier_type targetIdentifierType, final String context_id, final TemplateContextType contextType, + public ProposalCollector(final Identifier_type targetIdentifierType, final String contextId, final TemplateContextType contextType, final IDocument doc, final Reference ref, final int offset) { - this(targetIdentifierType, null, context_id, contextType, doc, ref, offset); + this(targetIdentifierType, null, contextId, contextType, doc, ref, offset); } /** @@ -131,7 +131,7 @@ public final class ProposalCollector { * @param projectSourceParser * the projects parser or null. Used to collect * definitions from imported modules too. - * @param context_id + * @param contextId * the identifier of the context where the proposals will * be inserted * @param contextType @@ -144,11 +144,11 @@ public final class ProposalCollector { * @param offset * the offset on which the reference starts * */ - public ProposalCollector(final Identifier_type targetIdentifierType, final ProjectSourceParser projectSourceParser, final String context_id, + public ProposalCollector(final Identifier_type targetIdentifierType, final ProjectSourceParser projectSourceParser, final String contextId, final TemplateContextType contextType, final IDocument doc, final Reference ref, final int offset) { this.targetIdentifierType = targetIdentifierType; this.projectSourceParser = projectSourceParser; - this.contextId = context_id; + this.contextId = contextId; reference = ref; List<ISubReference> subreferences = ref.getSubreferences(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/OpenDeclaration.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/OpenDeclaration.java index 5c7d8b82aa004611303a0f73d4959e76f77663e4..098758839fcf29e78b0f957d0c697c132b0bda26 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/OpenDeclaration.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/OpenDeclaration.java @@ -20,8 +20,6 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.AST.Module; import org.eclipse.titan.designer.AST.ASN1.definitions.ASN1Module; @@ -134,7 +132,7 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct } if (ResourceExclusionHelper.isExcluded(file)) { - MessageDialog.openError(new Shell(Display.getDefault()), "Open Declaration does not work within excluded resources", + MessageDialog.openError(null, "Open Declaration does not work within excluded resources", "This module is excluded from build. To use the Open Declaration " + "feature please click on the 'Toggle exclude from build state' in the context menu of the Project Explorer. "); return; @@ -187,7 +185,7 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct } OpenDeclarationLabelProvider labelProvider = new OpenDeclarationLabelProvider(); - ElementListSelectionDialog dialog = new ElementListSelectionDialog(new Shell(Display.getDefault()), labelProvider); + ElementListSelectionDialog dialog = new ElementListSelectionDialog(null, labelProvider); dialog.setTitle("Open"); dialog.setMessage("Select the element to open"); dialog.setElements(collected.toArray()); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/ReconcilingStrategy.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/ReconcilingStrategy.java index 3585e8de16d0ca1cb98eaa66558e08849caeace6..c401d4dd0621931296981443d66295c869f49846 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/ReconcilingStrategy.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/asn1editor/ReconcilingStrategy.java @@ -74,11 +74,11 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci fullReconciliation(true); } - private void fullReconciliation(final boolean is_initial) { + private void fullReconciliation(final boolean isInitial) { GlobalIntervalHandler.putInterval(document, null); IPreferencesService prefs = Platform.getPreferencesService(); if (prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.USEONTHEFLYPARSING, true, null)) { - analyze(is_initial); + analyze(isInitial); } else { Display.getDefault().asyncExec(new Runnable() { @Override @@ -95,7 +95,7 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci } } - void analyze(final boolean is_initial) { + void analyze(final boolean isInitial) { final IFile editedFile = (IFile) editor.getEditorInput().getAdapter(IFile.class); if (editedFile == null || ResourceExclusionHelper.isExcluded(editedFile)) { return; @@ -117,8 +117,7 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(project); projectSourceParser.reportOutdating(editedFile); - if (is_initial || !editor.isSemanticCheckingDelayed()) { - projectSourceParser.setFullSemanticAnalysisNeeded(); + if (isInitial || !editor.isSemanticCheckingDelayed()) { projectSourceParser.analyzeAll(); ProjectConfigurationParser projectConfigurationParser = GlobalParser.getConfigSourceParser(project); projectConfigurationParser.analyzeAll(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/OpenDeclaration.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/OpenDeclaration.java index 3b34f58a55ece4c6c07ba3312414b37cf7e4664b..21e0c5c1f8ec5f8efee60db9ada0a2a3e72c02e0 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/OpenDeclaration.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/OpenDeclaration.java @@ -23,8 +23,6 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.parsers.Interval; import org.eclipse.titan.common.parsers.cfg.CfgDefinitionInformation; @@ -184,7 +182,7 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct */ public Object openCollectionListDialog(final List<?> collected) { OpenDeclarationLabelProvider labelProvider = new OpenDeclarationLabelProvider(); - ElementListSelectionDialog dialog = new ElementListSelectionDialog(new Shell(Display.getDefault()), labelProvider); + ElementListSelectionDialog dialog = new ElementListSelectionDialog(null, labelProvider); dialog.setTitle("Open"); dialog.setMessage("Select the element to open"); dialog.setElements(collected.toArray()); @@ -269,8 +267,7 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct if (reference == null) { return false; } - DeclarationCollector declarationCollector = new DeclarationCollector(reference, GlobalParser.getProjectSourceParser(file - .getProject())); + DeclarationCollector declarationCollector = new DeclarationCollector(reference); ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(file.getProject()); String exactModuleName = refParser.getExactModuleName(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/GeneralOptionsSubPage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/GeneralOptionsSubPage.java index 59abb6782ca5402a60ccef8594d3b32c39716439..f055f0745f10b4e391e28fdff824cf25322166f7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/GeneralOptionsSubPage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/GeneralOptionsSubPage.java @@ -26,7 +26,6 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; @@ -559,7 +558,7 @@ public final class GeneralOptionsSubPage { loggingPage.createLoggingSection(); } - ParamDialog d = new ParamDialog(new Shell(Display.getDefault()), selectedLogEntry, null); + ParamDialog d = new ParamDialog(null, selectedLogEntry, null); if (d.open() == Window.OK) { PluginSpecificParam psp = createPluginSpecificParamNode(d.getName(), d.getValue()); paramViewer.setInput(selectedLogEntry); @@ -597,7 +596,7 @@ public final class GeneralOptionsSubPage { StructuredSelection selection = (StructuredSelection) paramViewer.getSelection(); PluginSpecificParam psp = (PluginSpecificParam) selection.getFirstElement(); - ParamDialog d = new ParamDialog(new Shell(Display.getDefault()), selectedLogEntry, psp); + ParamDialog d = new ParamDialog(null, selectedLogEntry, psp); if (d.open() == Window.OK) { if (psp.getParam() != null) { ConfigTreeNodeUtilities.removeFromChain(loggingSectionHandler.getLastSectionRoot(), psp.getParam() diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/ParamDialog.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/ParamDialog.java index 5bb0e56828795d7f10cacf01db3c98bd87f0ca83..3aebceb44a3ca4ef072398dd5c280e5d975fa5c7 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/ParamDialog.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/configeditor/pages/logging/ParamDialog.java @@ -46,7 +46,7 @@ public class ParamDialog extends TitleAreaDialog { public ParamDialog(final Shell parentShell, final LogParamEntry logentry, final PluginSpecificParam param) { super(parentShell); - setShellStyle(parentShell.getStyle() | SWT.RESIZE | SWT.PRIMARY_MODAL); + setShellStyle(getShellStyle() | SWT.RESIZE | SWT.PRIMARY_MODAL); isAddition = param == null; this.logentry = logentry; this.param = param; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/AddImport.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/AddImport.java index f241f3a2f9b5e5a7e03e00290471453f45e62d8d..bc43c6ae2d3ca0ab730f23818f1aa4aa255ff930 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/AddImport.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/AddImport.java @@ -20,7 +20,6 @@ import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.window.Window; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.text.edits.InsertEdit; import org.eclipse.text.edits.MultiTextEdit; import org.eclipse.text.edits.TextEdit; @@ -129,7 +128,7 @@ public final class AddImport implements IEditorActionDelegate { resultToInsert = collected.get(0); } else { OpenDeclarationLabelProvider labelProvider = new OpenDeclarationLabelProvider(); - ElementListSelectionDialog dialog = new ElementListSelectionDialog(new Shell(Display.getDefault()), labelProvider); + ElementListSelectionDialog dialog = new ElementListSelectionDialog(null, labelProvider); dialog.setTitle("Add Import"); dialog.setMessage("Choose element to generate an import statement for."); dialog.setElements(collected.toArray()); @@ -186,7 +185,7 @@ public final class AddImport implements IEditorActionDelegate { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openWarning(new Shell(Display.getDefault()), "Study feature", + MessageDialog.openWarning(null, "Study feature", "Adding a missing importation is still under study"); } }); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/OpenDeclaration.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/OpenDeclaration.java index 61c6d21936366d2d10b1d3e0dc89a80a57c6bfe6..585807d2e09f698149077c135ea014888f71cbcf 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/OpenDeclaration.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/OpenDeclaration.java @@ -7,8 +7,6 @@ ******************************************************************************/ package org.eclipse.titan.designer.editors.ttcn3editor; -import java.util.List; - import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; @@ -19,22 +17,14 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.AST.Location; import org.eclipse.titan.designer.AST.Module; -import org.eclipse.titan.designer.AST.ASN1.definitions.ASN1Module; import org.eclipse.titan.designer.commonFilters.ResourceExclusionHelper; import org.eclipse.titan.designer.consoles.TITANDebugConsole; import org.eclipse.titan.designer.core.TITANNature; import org.eclipse.titan.designer.declarationsearch.Declaration; import org.eclipse.titan.designer.declarationsearch.IdentifierFinderVisitor; -import org.eclipse.titan.designer.editors.DeclarationCollectionHelper; -import org.eclipse.titan.designer.editors.DeclarationCollector; -import org.eclipse.titan.designer.editors.OpenDeclarationHelper; -import org.eclipse.titan.designer.editors.OpenDeclarationLabelProvider; import org.eclipse.titan.designer.parsers.GlobalParser; import org.eclipse.titan.designer.parsers.ProjectSourceParser; import org.eclipse.titan.designer.preferences.PreferenceConstants; @@ -45,7 +35,6 @@ import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.AbstractTextEditor; @@ -106,79 +95,6 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct this.targetEditor = targetEditor; } - private void getDeclarationWithoutVisitor(final int offset, final boolean reportDebugInformation, final IFile file) { - DeclarationCollector declarationCollector = OpenDeclarationHelper.findVisibleDeclarations(targetEditor, new TTCN3ReferenceParser( - false), ((TTCN3Editor) targetEditor).getDocument(), offset, false); - - if (declarationCollector == null) { - return; - } - - DeclarationCollectionHelper declaration = null; - List<DeclarationCollectionHelper> collected = declarationCollector.getCollected(); - if (collected.isEmpty()) { - if (reportDebugInformation) { - TITANDebugConsole.println("No visible elements found"); - } - ProjectSourceParser projectSourceParser1 = GlobalParser.getProjectSourceParser(file.getProject()); - for (String moduleName2 : projectSourceParser1.getKnownModuleNames()) { - Module module2 = projectSourceParser1.getModuleByName(moduleName2); - if (module2 != null && module2 instanceof ASN1Module) { - module2.getAssignments().addDeclaration(declarationCollector); - } - } - - if (declarationCollector.getCollectionSize() == 0) { - targetEditor.getEditorSite().getActionBars().getStatusLineManager().setErrorMessage(NOTTTCN3DECLARATION); - return; - } - - if (reportDebugInformation) { - TITANDebugConsole.println("Elements were only found in not visible modules"); - } - - OpenDeclarationLabelProvider labelProvider = new OpenDeclarationLabelProvider(); - ElementListSelectionDialog dialog = new ElementListSelectionDialog(new Shell(Display.getDefault()), labelProvider); - dialog.setTitle("Open"); - dialog.setMessage("Select the element to open"); - dialog.setElements(collected.toArray()); - if (dialog.open() == Window.OK) { - if (reportDebugInformation) { - TITANDebugConsole.println("Selected: " + dialog.getFirstResult()); - } - declaration = (DeclarationCollectionHelper) dialog.getFirstResult(); - } - } else { - declaration = collected.get(0); - } - if (reportDebugInformation) { - for (DeclarationCollectionHelper foundDeclaration : collected) { - TITANDebugConsole.println("Assignment:" + foundDeclaration.location.getFile() + ": " - + foundDeclaration.location.getOffset() + " - " - + foundDeclaration.location.getEndOffset()); - } - } - - if (declaration != null) { - selectAndRevealDeclaration(declaration.location); - } - } - - private void getDeclarationVisitor(final Module module, final IdentifierFinderVisitor visitor, final boolean reportDebugInformation) { - - module.accept(visitor); - final Declaration decl = visitor.getReferencedDeclaration(); - if (decl == null) { - if (reportDebugInformation) { - TITANDebugConsole.println("No visible elements found"); - } - return; - } - - selectAndRevealDeclaration(decl.getIdentifier().getLocation()); - - } - @Override public Object execute(ExecutionEvent event) throws ExecutionException { targetEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); @@ -207,7 +123,7 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct } if (ResourceExclusionHelper.isExcluded(file)) { - MessageDialog.openError(new Shell(Display.getDefault()), "Open Declaration does not work within excluded resources", + MessageDialog.openError(null, "Open Declaration does not work within excluded resources", "This module is excluded from build. To use the Open Declaration " + "feature please click on the 'Toggle exclude from build state' in the context menu of the Project Explorer. "); return; @@ -228,8 +144,6 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct offset = ((TTCN3Editor) targetEditor).getCarretOffset(); } - IdentifierFinderVisitor visitor = new IdentifierFinderVisitor(offset); - ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(file.getProject()); final String ttcn3ModuleName = projectSourceParser.containedModule(file); @@ -243,19 +157,18 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct return; } - // ToDo: In case of minimize memory usage, the code reverts to - // non visitor type of get declaration. - // Think it over. - // if - // (Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, - // PreferenceConstants.MINIMISEMEMORYUSAGE, true, null)) { - // - // getDeclarationWithoutVisitor(offset, reportDebugInformation, - // file); + IdentifierFinderVisitor visitor = new IdentifierFinderVisitor(offset); + module.accept(visitor); + final Declaration decl = visitor.getReferencedDeclaration(); + if (decl == null) { + if (reportDebugInformation) { + TITANDebugConsole.println("No visible elements found"); + } + return; + } + + selectAndRevealDeclaration(decl.getIdentifier().getLocation()); - // } else { - getDeclarationVisitor(module, visitor, reportDebugInformation); - // } return; } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/Reconciler.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/Reconciler.java index 92d51c460ef04f0f29789b7198ff916b3b5e871e..648b81ab990aefebc42f8b4b5d12fd219049ddac 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/Reconciler.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/Reconciler.java @@ -656,6 +656,7 @@ public class Reconciler implements IReconciler { * reimplement this method. */ protected final void initialProcess() { + dirtyRegionQueue.clear(); reconcilingStrategy.initialReconcile(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/ReconcilingStrategy.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/ReconcilingStrategy.java index b42f8144940bc319c648dfb3c56e3d2872a2a9d7..8e9baace262c89c678a329e8233de1288ccea1f0 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/ReconcilingStrategy.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcn3editor/ReconcilingStrategy.java @@ -193,18 +193,15 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci WorkspaceJob op = new WorkspaceJob("reparse information update") { @Override public IStatus runInWorkspace(final IProgressMonitor monitor) { - WorkspaceJob temp_lastIncrementalSyntaxCheck = lastIncrementalSyntaxCheck; - if (temp_lastIncrementalSyntaxCheck != null) { + WorkspaceJob tempLastIncrementalSyntaxCheck = lastIncrementalSyntaxCheck; + if (tempLastIncrementalSyntaxCheck != null) { try { - temp_lastIncrementalSyntaxCheck.join(); + tempLastIncrementalSyntaxCheck.join(); } catch (InterruptedException e) { ErrorReporter.logExceptionStackTrace(e); } } - sourceParser.addModulesToBeSemanticallyAnalyzed(reparser.moduleToBeReanalysed); - if (reparser.fullAnalysysNeeded) { - sourceParser.setFullSemanticAnalysisNeeded(); - } + return Status.OK_STATUS; } }; @@ -219,10 +216,6 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci TITANDebugConsole.println("Refreshing the syntax took " + (System.nanoTime() - parserStart) * (1e-9) + " secs"); } - if (!reparser.fullAnalysysNeeded) { - return; - } - op = new WorkspaceJob(FOLDING_UPDATE) { @Override public IStatus runInWorkspace(final IProgressMonitor monitor) { @@ -255,10 +248,10 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci return; } - final WorkspaceJob temp_lastIncrementalSyntaxCheck = lastIncrementalSyntaxCheck; - if (temp_lastIncrementalSyntaxCheck != null) { + final WorkspaceJob tempLastIncrementalSyntaxCheck = lastIncrementalSyntaxCheck; + if (tempLastIncrementalSyntaxCheck != null) { try { - temp_lastIncrementalSyntaxCheck.join(); + tempLastIncrementalSyntaxCheck.join(); } catch (InterruptedException e) { ErrorReporter.logExceptionStackTrace(e); } @@ -306,13 +299,13 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci fullReconciliation(true); } - private void fullReconciliation(final boolean is_initial) { + private void fullReconciliation(final boolean isInitial) { actualCode = new StringBuilder(document.get()); GlobalIntervalHandler.putInterval(document, null); IPreferencesService prefs = Platform.getPreferencesService(); if (prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.USEONTHEFLYPARSING, true, null)) { - analyze(is_initial); + analyze(isInitial); } else { Display.getDefault().asyncExec(new Runnable() { @Override @@ -328,7 +321,7 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci } } - public void analyze(final boolean is_initial) { + public void analyze(final boolean isInitial) { final IFile editedFile = (IFile) editor.getEditorInput().getAdapter(IFile.class); if (editedFile == null || ResourceExclusionHelper.isExcluded(editedFile)) { return; @@ -348,10 +341,10 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci }); final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(project); - if (is_initial || !editor.isSemanticCheckingDelayed()) { + if (isInitial || !editor.isSemanticCheckingDelayed()) { final boolean minimizeMemoryUsage = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.MINIMISEMEMORYUSAGE, false, null); - if (!is_initial || minimizeMemoryUsage) { + if (!isInitial || minimizeMemoryUsage) { projectSourceParser.reportOutdating(editedFile); } projectSourceParser.analyzeAll(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/Configuration.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/Configuration.java index 7cb606b8c2402b97d6792d5b6214eb4c616357c9..393be4653b1866801ee20f8b6abbac91fa7f8970 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/Configuration.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/Configuration.java @@ -108,14 +108,7 @@ public final class Configuration extends TextSourceViewerConfiguration { @Override public ITextHover getTextHover(final ISourceViewer sourceViewer, final String contentType, final int stateMask) { - // IPreferencesService prefs = Platform.getPreferencesService(); - // if (prefs.getBoolean(Activator.PLUGIN_ID, - // PreferenceConstants.TREATTTCNPPASTTCN, false, null)) { return new org.eclipse.titan.designer.editors.ttcn3editor.TextHover(sourceViewer, editor); - // } - - // return new - // org.eclipse.titan.designer.editors.TextHover(sourceViewer); } @Override @@ -130,17 +123,9 @@ public final class Configuration extends TextSourceViewerConfiguration { strategy.setEditor(editor); IPreferencesService prefs = Platform.getPreferencesService(); - // if (prefs.getBoolean(Activator.PLUGIN_ID, - // PreferenceConstants.TREATTTCNPPASTTCN, false, null)) - // { reconciler = new MonoReconciler(strategy, prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.USEINCREMENTALPARSING, false, null)); reconciler.setProgressMonitor(new NullProgressMonitor()); - // } else { - // reconciler = new MonoReconciler(strategy, false); - // reconciler.setProgressMonitor(new - // NullProgressMonitor()); - // } editor.setReconciler(reconciler); int timeout = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.RECONCILERTIMEOUT, 1, null); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/OpenDeclaration.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/OpenDeclaration.java index 69ce720f368eb3a37037641dde37f19c81af8415..dd374519fe2db5ab58bc8c9d884c91eb63040087 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/OpenDeclaration.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/OpenDeclaration.java @@ -17,8 +17,6 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.AST.Location; import org.eclipse.titan.designer.AST.Module; @@ -127,7 +125,7 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct } if (ResourceExclusionHelper.isExcluded(file)) { - MessageDialog.openError(new Shell(Display.getDefault()), "Open Declaration does not work within excluded resources", + MessageDialog.openError(null, "Open Declaration does not work within excluded resources", "This module is excluded from build. To use the Open Declaration " + "feature please click on the 'Toggle exclude from build state' in the context menu of the Project Explorer. "); return; @@ -144,8 +142,6 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct offset = ((TTCNPPEditor) targetEditor).getCarretOffset(); } - IdentifierFinderVisitor visitor = new IdentifierFinderVisitor(offset); - ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(file.getProject()); final String ttcn3ModuleName = projectSourceParser.containedModule(file); @@ -159,6 +155,7 @@ public final class OpenDeclaration extends AbstractHandler implements IEditorAct return; } + IdentifierFinderVisitor visitor = new IdentifierFinderVisitor(offset); module.accept(visitor); final Declaration decl = visitor.getReferencedDeclaration(); if (decl == null) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/ReconcilingStrategy.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/ReconcilingStrategy.java index c50b9cb614070efaa2b13d20553a84bd41dcc3ad..3acc10d93c295b843a4ca044ad92713166412f9f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/ReconcilingStrategy.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/editors/ttcnppeditor/ReconcilingStrategy.java @@ -137,10 +137,7 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci final ProjectSourceParser sourceParser = GlobalParser.getProjectSourceParser(project); sourceParser.updateSyntax(editedFile, reparser); - sourceParser.addModulesToBeSemanticallyAnalyzed(reparser.moduleToBeReanalysed); - if (reparser.fullAnalysysNeeded) { - sourceParser.setFullSemanticAnalysisNeeded(); - } + if (!editor.isSemanticCheckingDelayed()) { sourceParser.analyzeAll(); @@ -180,13 +177,13 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci fullReconciliation(true); } - private void fullReconciliation(final boolean is_initial) { + private void fullReconciliation(final boolean isInitial) { actualCode = new StringBuilder(document.get()); GlobalIntervalHandler.putInterval(document, null); IPreferencesService prefs = Platform.getPreferencesService(); if (prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.USEONTHEFLYPARSING, true, null)) { - analyze(is_initial); + analyze(isInitial); } else { Display.getDefault().asyncExec(new Runnable() { @Override @@ -199,7 +196,7 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci } } - public void analyze(final boolean is_initial) { + public void analyze(final boolean isInitial) { final IFile editedFile = (IFile) editor.getEditorInput().getAdapter(IFile.class); if (editedFile == null || ResourceExclusionHelper.isExcluded(editedFile)) { return; @@ -219,8 +216,7 @@ public final class ReconcilingStrategy implements IReconcilingStrategy, IReconci }); final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(project); - projectSourceParser.setFullSemanticAnalysisNeeded(); - if (is_initial || !editor.isSemanticCheckingDelayed()) { + if (isInitial || !editor.isSemanticCheckingDelayed()) { projectSourceParser.reportOutdating(editedFile); projectSourceParser.analyzeAll(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/license/LicenseValidator.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/license/LicenseValidator.java index ebc7db31036763406930c4d675ced7b235f5ab79..239c3612864ab714ad3750d2e02ed59398201258 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/license/LicenseValidator.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/license/LicenseValidator.java @@ -52,7 +52,7 @@ public final class LicenseValidator { super.buttonPressed(buttonId); if (buttonId == 1) { - PreferencesUtil.createPreferenceDialogOn(new Shell(Display.getDefault()), + PreferencesUtil.createPreferenceDialogOn(null, "org.eclipse.titan.designer.preferences.pages.TITANPreferencePage", null, null).open(); } } @@ -134,7 +134,7 @@ public final class LicenseValidator { } LicenseErrorDialog.isDialogOpen = true; - LicenseErrorDialog dialog = new LicenseErrorDialog(new Shell(Display.getDefault()), title, message); + LicenseErrorDialog dialog = new LicenseErrorDialog(null, title, message); dialog.open(); LicenseErrorDialog.isDialogOpen = false; } @@ -159,6 +159,9 @@ public final class LicenseValidator { * @return the resolved license file path * */ public static String getResolvedLicenseFilePath(final boolean force) { + if(!License.isLicenseNeeded()){ + return ""; + } final IPreferencesService preferenceService = Platform.getPreferencesService(); boolean reportDebugInformation = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/nativewin32actions/NativeWIN32TITANJob.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/nativewin32actions/NativeWIN32TITANJob.java index a73ff5e7888d1b8cfc48156e46b2518347aa011b..bc07cfd9e9ea941e553d29a2d3d90e7039114419 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/nativewin32actions/NativeWIN32TITANJob.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/nativewin32actions/NativeWIN32TITANJob.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.IPreferencesService; import org.eclipse.titan.designer.core.TITANJob; +import org.eclipse.titan.designer.license.License; import org.eclipse.titan.designer.preferences.PreferenceConstants; import org.eclipse.titan.designer.productUtilities.ProductConstants; @@ -60,10 +61,13 @@ public final class NativeWIN32TITANJob extends TITANJob { final IPreferencesService service = Platform.getPreferencesService(); final String pathOfTITAN = service.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.TITAN_INSTALLATION_PATH, "", null); - final String licenseFilePath = service.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.LICENSE_FILE_PATH, "", - null); + final Map<String, String> env = pb.environment(); - env.put(TTCN3_LICENSE_FILE_KEY, licenseFilePath); + if(License.isLicenseNeeded()) { + final String licenseFilePath = + service.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.LICENSE_FILE_PATH, "", null); + env.put(TTCN3_LICENSE_FILE_KEY, licenseFilePath); + } env.put(TTCN3_DIR_KEY, pathOfTITAN); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceParser.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceParser.java index 6445abb04f93ad3bd7e80becfbaf46248ee7e9e6..3ca4a07530a6e067c407a6794247415626482e8f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceParser.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceParser.java @@ -710,44 +710,6 @@ public final class ProjectSourceParser { return op; } - /** - * Internal function. - * <p> - * Does the analysis of the projects in an incremental fashion. - no - * syntax check (this should have already been done.) - does the - * semantic checking based on data collected at syntax checking time, - * and previous semantic checking. - * - * @param monitor - * the progress monitor to provide feedback to the user - * about the progress. - * */ - private IStatus internalIncrementalAnalysis(final IProgressMonitor monitor) { - if (!checkConfigurationRequirements(project, GeneralConstants.ONTHEFLY_SEMANTIC_MARKER)) { - return Status.OK_STATUS; - } - - // Do the analyzes in the determined order. - CompilationTimeStamp compilationCounter = CompilationTimeStamp.getNewCompilationCounter(); - - IProgressMonitor internalMonitor = monitor == null ? new NullProgressMonitor() : monitor; - internalMonitor.beginTask("Analysis of projects", 1); - IPreferencesService preferenceService = Platform.getPreferencesService(); - boolean reportDebugInformation = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, - PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null); - if (reportDebugInformation) { - TITANDebugConsole.println("On-the-fly analyzation of project " + project.getName() + " started"); - } - - syntacticAnalyzer.internalDoAnalyzeSyntactically(new SubProgressMonitor(internalMonitor, 1)); - semanticAnalyzer.analyzeSemanticallyIncrementally(new SubProgressMonitor(internalMonitor, 1), compilationCounter); - - internalMonitor.done(); - lastTimeChecked = compilationCounter; - - return Status.OK_STATUS; - } - /** * Internal function. * <p> @@ -872,11 +834,7 @@ public final class ProjectSourceParser { } } - List<Module> modulesSkippedGlobally = new ArrayList<Module>(); - for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) { - GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).semanticAnalyzer.internalDoAnalyzeSemantically( - new SubProgressMonitor(internalMonitor, 1), compilationCounter, modulesSkippedGlobally); - } + ProjectSourceSemanticAnalyzer.analyzeMultipleProjectsSemantically(tobeSemanticallyAnalyzed, internalMonitor, compilationCounter); } finally { for (int i = 0; i < tobeAnalyzed.size(); i++) { GlobalParser.getProjectSourceParser(tobeAnalyzed.get(i)).analyzesRunning = false; @@ -1071,11 +1029,7 @@ public final class ProjectSourceParser { } } - if (semanticAnalyzer.getFullAnalysisNeeded()) { - result = internalDoAnalyzeWithReferences(monitor); - } else { - result = internalIncrementalAnalysis(monitor); - } + result = internalDoAnalyzeWithReferences(monitor); boolean reportDebugInformation = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null); @@ -1300,20 +1254,4 @@ public final class ProjectSourceParser { fullAnalyzersRunning.decrementAndGet(); } } - - /** Sets whether full analysis is needed or not. */ - public void setFullSemanticAnalysisNeeded() { - semanticAnalyzer.setFullAnalysisNeeded(); - } - - /** - * Adds a list of modules that must be analyzed in case of incremental - * analysis. - * - * @param modules - * the list of modules to be added. - * */ - public void addModulesToBeSemanticallyAnalyzed(final Set<String> modules) { - semanticAnalyzer.addModulesToBeReanalyzed(modules); - } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSemanticAnalyzer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSemanticAnalyzer.java index 4c2be7eff5497d785a03919947f49b1fd75b062c..36703a79f0915fee602c82f8577074a6bd2ec5ee 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSemanticAnalyzer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSemanticAnalyzer.java @@ -12,7 +12,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; @@ -25,7 +24,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.core.runtime.preferences.IPreferencesService; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.parsers.TITANMarker; @@ -36,8 +34,10 @@ import org.eclipse.titan.designer.AST.MarkerHandler; import org.eclipse.titan.designer.AST.Module; import org.eclipse.titan.designer.AST.ModuleImportationChain; import org.eclipse.titan.designer.AST.ASN1.Ass_pard; -import org.eclipse.titan.designer.AST.TTCN3.definitions.ImportModule; -import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module; +import org.eclipse.titan.designer.brokenpartsanalyzers.AnalyzerFactory; +import org.eclipse.titan.designer.brokenpartsanalyzers.BrokenPartsChecker; +import org.eclipse.titan.designer.brokenpartsanalyzers.IBaseAnalyzer; +import org.eclipse.titan.designer.brokenpartsanalyzers.SelectionMethodBase; import org.eclipse.titan.designer.consoles.TITANDebugConsole; import org.eclipse.titan.designer.core.ProjectBasedBuilder; import org.eclipse.titan.designer.core.TITANNature; @@ -67,18 +67,6 @@ public class ProjectSourceSemanticAnalyzer { /** The names of the modules, which were checked the last time. */ private Set<String> semanticallyUptodateModules; - /** - * The list of modules that should be re-analyzed if incremental - * semantic processing is enabled. - */ - private Set<String> moduleToBeReanalysed = new HashSet<String>(); - - /** - * tells whether a full analysis is required even if incremental - * processing is enabled. - */ - private boolean fullAnalysisNeeded = true; - /** holds the list of modules which had the same module identifiers */ private final Set<IFile> duplicationHolders = new HashSet<IFile>(); @@ -91,32 +79,12 @@ public class ProjectSourceSemanticAnalyzer { semanticallyUptodateModules = new HashSet<String>(); } - boolean getFullAnalysisNeeded() { - return fullAnalysisNeeded; - } - - /** Sets whether full analysis is needed or not. */ - public void setFullAnalysisNeeded() { - fullAnalysisNeeded = true; - } - - /** - * Adds a list of modules that must be analyzed in case of incremental - * analysis. - * - * @param modules - * the list of modules to be added. - * */ - public void addModulesToBeReanalyzed(final Set<String> modules) { - moduleToBeReanalysed.addAll(modules); - } - /** * Checks whether the internal data belonging to the provided file is * semantically out-dated. * * @param file - * the file to check. + * the file to check. * * @return true if the data was reported to be out-dated since the last * analysis. @@ -136,9 +104,9 @@ public class ProjectSourceSemanticAnalyzer { * Returns the module with the provided name, or null. * * @param name - * the name of the module to return. + * the name of the module to return. * @param uptodateOnly - * allow finding only the up-to-date modules. + * allow finding only the up-to-date modules. * * @return the module having the provided name * */ @@ -177,7 +145,7 @@ public class ProjectSourceSemanticAnalyzer { * Checks the only actual project. * * @param moduleName - * the name of the module to be checked. + * the name of the module to be checked. * * @return true if the module is checked, false otherwise. * */ @@ -189,11 +157,11 @@ public class ProjectSourceSemanticAnalyzer { * Handles the renaming of a module. * * @param oldname - * the old name of the module. + * the old name of the module. * @param newName - * the new name of the module. + * the new name of the module. * @param file - * the file in which the change happened. + * the file in which the change happened. * */ void renameModule(final String oldname, final String newName, final IFile file) { if (moduleMap.containsKey(oldname)) { @@ -226,9 +194,9 @@ public class ProjectSourceSemanticAnalyzer { * </p> * * @param outdatedFile - * the file which seems to have changed + * the file which seems to have changed * @param useOnTheFlyParsing - * true if on-the-fly parsing is enabled. + * true if on-the-fly parsing is enabled. * */ public void reportOutdating(final IFile outdatedFile, final boolean useOnTheFlyParsing) { if (!useOnTheFlyParsing) { @@ -240,7 +208,6 @@ public class ProjectSourceSemanticAnalyzer { String moduleName = sourceParser.containedModule(outdatedFile); if (moduleName == null) { // The module was just added - fullAnalysisNeeded = true; return; } @@ -263,7 +230,6 @@ public class ProjectSourceSemanticAnalyzer { synchronized (semanticallyUptodateModules) { semanticallyUptodateModules.remove(moduleName); } - fullAnalysisNeeded = true; } /** @@ -274,7 +240,7 @@ public class ProjectSourceSemanticAnalyzer { * <p> * * @param outdatedFile - * the file which seems to have changed + * the file which seems to have changed * */ public void reportSemanticOutdating(final IFile outdatedFile) { outdateDuplicationHolders(); @@ -287,7 +253,6 @@ public class ProjectSourceSemanticAnalyzer { synchronized (semanticallyUptodateModules) { semanticallyUptodateModules.remove(moduleName); } - fullAnalysisNeeded = true; } /** @@ -298,16 +263,15 @@ public class ProjectSourceSemanticAnalyzer { semanticallyUptodateModules.clear(); } duplicationHolders.clear(); - fullAnalysisNeeded = true; } /** * Removes data related to modules, that were deleted or moved. * * @param file - * the file that was changed. + * the file that was changed. * @param moduleName - * the name of the module in that file. + * the name of the module in that file. **/ void removedReferencestoRemovedFiles(final IFile file, final String moduleName) { outdateDuplicationHolders(); @@ -317,18 +281,16 @@ public class ProjectSourceSemanticAnalyzer { } moduleMap.remove(moduleName); - synchronized (outdatedModuleMap) { outdatedModuleMap.remove(moduleName); } - fullAnalysisNeeded = true; } /** * Removes a module from the set of semantically analyzed modules. * * @param moduleName - * the name of the module to be removed. + * the name of the module to be removed. * */ void removeModule(final String moduleName) { synchronized (outdatedModuleMap) { @@ -359,7 +321,7 @@ public class ProjectSourceSemanticAnalyzer { * Adds a module to the set of semantically analyzed modules. * * @param module - * the module to be added. + * the module to be added. * @return true if it was successfully added, false otherwise. * */ public boolean addModule(final Module module) { @@ -405,343 +367,130 @@ public class ProjectSourceSemanticAnalyzer { /** * Internal function. * <p> - * Does the semantic checking of the modules parsed in this project. It - * is important to call this function after the + * Does the semantic checking of the modules located in multiple projects. + * It is important to call this function after the * {@link #internalDoAnalyzeSyntactically(IProgressMonitor, CompilationTimeStamp)} - * function, as the out-dated markers will be cleared here. + * function was executed on all involved projects, as the out-dated markers will be cleared here. * + * @param tobeSemanticallyAnalyzed the list of projects to be analyzed. * @param monitor * the progress monitor to provide feedback to the user * about the progress. * @param compilationCounter - * the timestamp of the actual build cycle. - * @param modulesSkippedGlobally - * the modules skipped in any earlier projects. + * the timestamp of the actual build cycle. * * @return the status of the operation when it finished. * */ - synchronized IStatus internalDoAnalyzeSemantically(final IProgressMonitor monitor, final CompilationTimeStamp compilationCounter, - final List<Module> modulesSkippedGlobally) { - if (!project.isAccessible() || !TITANNature.hasTITANNature(project)) { - return Status.CANCEL_STATUS; + static IStatus analyzeMultipleProjectsSemantically(final List<IProject> tobeSemanticallyAnalyzed, final IProgressMonitor monitor, final CompilationTimeStamp compilationCounter) { + for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) { + if (!tobeSemanticallyAnalyzed.get(i).isAccessible() || !TITANNature.hasTITANNature(tobeSemanticallyAnalyzed.get(i))) { + return Status.CANCEL_STATUS; + } } + + final long semanticCheckStart = System.nanoTime(); + final IPreferencesService preferenceService = Platform.getPreferencesService(); - analyzeSemantically(monitor, compilationCounter, modulesSkippedGlobally); - - MarkerHandler.removeAllOnTheFlyMarkedMarkers(project); - - return Status.OK_STATUS; - } - - /** - * Internal function. - * <p> - * Does the incremental semantic checking of the modules parsed in this - * project. It is important to call this function after the - * {@link #internalDoAnalyzeSyntactically(IProgressMonitor, CompilationTimeStamp)} - * function, as the out-dated markers will be cleared here. - * - * @param monitor - * the progress monitor to provide feedback to the user - * about the progress. - * @param compilationCounter - * the timestamp of the actual build cycle. - * @param modulesSkippedGlobally - * the modules skipped in any earlier projects. - * - * @return the status of the operation when it finished. - * */ - synchronized IStatus analyzeSemanticallyIncrementally(final IProgressMonitor monitor, final CompilationTimeStamp compilationCounter) { - long semanticCheckStart = System.nanoTime(); - - // remove the out-dated modules, which could not be refreshed - // (they are most probably excluded from analysis) - synchronized (outdatedModuleMap) { - outdatedModuleMap.clear(); + for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) { + ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer(); + synchronized (semanticAnalyzer.outdatedModuleMap) { + semanticAnalyzer.outdatedModuleMap.clear(); + } } - + // Semantic checking starts here - monitor.beginTask("On-the-fly semantic checking of project: " + project.getName(), 5); + monitor.beginTask("On-the-fly semantic checking of everything ", 1); monitor.subTask("Checking the importations of the modules"); - - try { - // report the unsupported constructs in the project, - // should be empty - if (!sourceParser.getSyntacticAnalyzer().unsupportedConstructMap.isEmpty()) { - String option = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, - PreferenceConstants.REPORTUNSUPPORTEDCONSTRUCTS, GeneralConstants.ERROR, null); - for (IFile file : sourceParser.getSyntacticAnalyzer().unsupportedConstructMap.keySet()) { - List<TITANMarker> markers = sourceParser.getSyntacticAnalyzer().unsupportedConstructMap.get(file); + + try{ + final String option = preferenceService.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.REPORTUNSUPPORTEDCONSTRUCTS, GeneralConstants.ERROR, null); + for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) { + // report the unsupported constructs in the project + ProjectSourceSyntacticAnalyzer syntacticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSyntacticAnalyzer(); + for (IFile file : syntacticAnalyzer.unsupportedConstructMap.keySet()) { + List<TITANMarker> markers = syntacticAnalyzer.unsupportedConstructMap.get(file); if (markers != null && file.isAccessible()) { for (TITANMarker marker : markers) { - Location location = new Location(file, marker.getLine(), marker.getOffset(), - marker.getEndOffset()); + Location location = new Location(file, marker.getLine(), marker.getOffset(), marker.getEndOffset()); location.reportConfigurableSemanticProblem(option, marker.getMessage()); } } } } - + // clean the instantiated parameterized assignments, // from their instances Ass_pard.resetAllInstanceCounters(); - monitor.worked(1); - monitor.subTask("Calculating the list of modules to be checked"); - - List<Module> modulesToCheck = new ArrayList<Module>(); - for (String name : moduleToBeReanalysed) { - Module module = moduleMap.get(name); - if (module != null) { - modulesToCheck.add(module); - } - } - - List<Module> modulesToSkip = new ArrayList<Module>(); - for (String modulename : moduleMap.keySet()) { - if (!moduleToBeReanalysed.contains(modulename)) { - Module module = moduleMap.get(modulename); - if (module != null) { - modulesToSkip.add(module); + // collect all modules and semantically checked modules to work on. + final List<Module> allModules = new ArrayList<Module>(); + final List<String> semanticallyChecked = new ArrayList<String>(); + for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) { + ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer(); + for (Module moduleToCheck : semanticAnalyzer.moduleMap.values()) { + if (moduleToCheck != null) { + allModules.add(moduleToCheck); } } - } - - for (Module module2 : modulesToCheck) { - module2.setSkippedFromSemanticChecking(false); - } - for (Module module2 : modulesToSkip) { - module2.setSkippedFromSemanticChecking(true); - } - - monitor.worked(1); - monitor.subTask("Semantic checking"); - final SubProgressMonitor semanticMonitor = new SubProgressMonitor(monitor, 1); - semanticMonitor.beginTask("Semantic check", modulesToCheck.size()); - - // process the modules one-by-one - for (final Module module2 : modulesToCheck) { - MarkerHandler.markAllSemanticMarkersForRemoval((IFile) module2.getLocation().getFile()); - semanticMonitor.subTask("Semantically checking module: " + module2.getName()); - module2.check(compilationCounter); - semanticMonitor.worked(1); - } - - semanticMonitor.done(); - monitor.subTask("Doing post semantic checks"); - - for (Module module2 : modulesToCheck) { - module2.postCheck(); - } - - monitor.worked(1); - monitor.subTask("Cleanup operations"); - - synchronized (semanticallyUptodateModules) { - semanticallyUptodateModules.clear(); - semanticallyUptodateModules.addAll(moduleMap.keySet()); - } - - moduleToBeReanalysed.clear(); - - for (Module module2 : modulesToCheck) { - MarkerHandler.removeAllOnTheFlyMarkedMarkers(module2.getLocation().getFile()); - } - - IPreferencesService preferenceService = Platform.getPreferencesService(); - if (preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, - null)) { - MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" **Incremental on-the-fly semantic checking of project " + project.getName() + " (" - + semanticallyUptodateModules.size() + " modules) took " - + (System.nanoTime() - semanticCheckStart) * (1e-9) + " seconds",stream); - TITANDebugConsole.println(" **Checked " + modulesToCheck.size() + " modules", stream); - } - monitor.worked(1); - } catch (Exception e) { - // This catch is extremely important, as it is supposed - // to protect the project parser, from whatever might go - // wrong inside the analysis. - ErrorReporter.logExceptionStackTrace(e); - } - - fullAnalysisNeeded = false; - sourceParser.setLastTimeChecked(compilationCounter); - monitor.done(); - - ProjectStructureDataCollector collector = GlobalProjectStructureTracker.getDataCollector(project); - for (Module module : moduleMap.values()) { - collector.addKnownModule(module.getIdentifier()); - module.extractStructuralInformation(collector); - } - - return Status.OK_STATUS; - } - - /** - * Internal function. Does the actual semantic checking of the modules. - * - * @param monitor - * the progress monitor to provide feedback to the user - * about the progress. - * @param compilationCounter - * the timestamp of the actual build cycle. - * @param modulesSkippedGlobally - * the modules skipped in any earlier projects. - * - * */ - private void analyzeSemantically(final IProgressMonitor monitor, final CompilationTimeStamp compilationCounter, - final List<Module> modulesSkippedGlobally) { - long semanticCheckStart = System.nanoTime(); - IPreferencesService preferenceService = Platform.getPreferencesService(); - - // remove the out-dated modules, which could not be refreshed - // (they are most probably excluded from analysis) - synchronized (outdatedModuleMap) { - outdatedModuleMap.clear(); - } - - // Semantic checking starts here - monitor.beginTask("On-the-fly semantic checking of project: " + project.getName(), 1); - monitor.subTask("Checking the importations of the modules"); - - try { - // report the unsupported constructs in the project - if (!sourceParser.getSyntacticAnalyzer().unsupportedConstructMap.isEmpty()) { - String option = preferenceService.getString(ProductConstants.PRODUCT_ID_DESIGNER, - PreferenceConstants.REPORTUNSUPPORTEDCONSTRUCTS, GeneralConstants.ERROR, null); - for (IFile file : sourceParser.getSyntacticAnalyzer().unsupportedConstructMap.keySet()) { - List<TITANMarker> markers = sourceParser.getSyntacticAnalyzer().unsupportedConstructMap.get(file); - if (markers != null && file.isAccessible()) { - for (TITANMarker marker : markers) { - Location location = new Location(file, marker.getLine(), marker.getOffset(), - marker.getEndOffset()); - location.reportConfigurableSemanticProblem(option, marker.getMessage()); + synchronized (semanticAnalyzer.semanticallyUptodateModules) { + for (String modulename : semanticAnalyzer.semanticallyUptodateModules) { + if (semanticAnalyzer.moduleMap.containsKey(modulename)) { + Module module = semanticAnalyzer.moduleMap.get(modulename); + if (module != null) { + semanticallyChecked.add(module.getName()); + } } } } } - // clean the instantiated parameterized assignments, - // from their instances - Ass_pard.resetAllInstanceCounters(); - - Module module; - - // check and build the import hierarchy of the modules - ModuleImportationChain referenceChain = new ModuleImportationChain(CIRCULARIMPORTCHAIN, false); - for (String modulename : moduleMap.keySet()) { - module = moduleMap.get(modulename); - if (module != null) { + int nofModulesTobeChecked = 0; + if(allModules.size() > semanticallyChecked.size()) { + // check and build the import hierarchy of the modules + ModuleImportationChain referenceChain = new ModuleImportationChain(CIRCULARIMPORTCHAIN, false); + for(Module module : allModules) { module.checkImports(compilationCounter, referenceChain, new ArrayList<Module>()); referenceChain.clear(); } - } - monitor.subTask("Calculating the list of modules to be checked"); + monitor.subTask("Calculating the list of modules to be checked"); - // To know the correct elements - List<String> semanticallyChecked = new ArrayList<String>(); - synchronized (semanticallyUptodateModules) { - for (String modulename : semanticallyUptodateModules) { - if (moduleMap.containsKey(modulename)) { - module = moduleMap.get(modulename); - if (module != null) { - semanticallyChecked.add(module.getName()); - } - } - } - } + IBaseAnalyzer selectionMethod = AnalyzerFactory.getAnalyzer(compilationCounter); + SelectionMethodBase selectionMethodBase = (SelectionMethodBase)selectionMethod; + selectionMethodBase.setModules(allModules, semanticallyChecked); + selectionMethod.execute(); - List<Module> modulesToCheck = new ArrayList<Module>(); - for (Module moduleToCheck : moduleMap.values()) { - if (moduleToCheck != null) { - modulesToCheck.add(moduleToCheck); - } - } - - List<Module> modulesToSkip = new ArrayList<Module>(); - boolean foundSkippable = true; - while (foundSkippable) { - foundSkippable = calculateModulesToSkip(modulesToCheck, modulesToSkip, modulesSkippedGlobally); - } + selectionMethodBase.setSkippedFromSemanticChecking(); - if (preferenceService - .getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.USEINCREMENTALPARSING, false, null)) { - // the modules that can be reached directly must - // be checked as the used state of the - // definitions might have changed - List<Module> modulesToCheck2 = new ArrayList<Module>(); - for (Module module2 : modulesToCheck) { - if (module2.getLastCompilationTimeStamp() != null && semanticallyChecked.contains(module2.getName())) { - List<Module> importedModules = module2.getImportedModules(); - if (importedModules != null && !importedModules.isEmpty()) { - for (Module module3 : importedModules) { - if (module3 != null && !modulesToCheck.contains(module3) - && !modulesToCheck2.contains(module3)) { - modulesToCheck2.add(module3); - } - } - } - } + BrokenPartsChecker brokenPartsChecker = new BrokenPartsChecker(monitor, compilationCounter, selectionMethodBase); + brokenPartsChecker.doChecking(); + + // re-enable the markers on the skipped modules. + for (Module module2 : selectionMethodBase.getModulesToSkip()) { + MarkerHandler.reEnableAllMarkers((IFile) module2.getLocation().getFile()); } - modulesToCheck.addAll(modulesToCheck2); - modulesToSkip.removeAll(modulesToCheck2); - } - - for (Module module2 : modulesToSkip) { - module2.setSkippedFromSemanticChecking(true); - } - for (Module module2 : modulesSkippedGlobally) { - module2.setSkippedFromSemanticChecking(true); - } - for (Module module2 : modulesToCheck) { - module2.setSkippedFromSemanticChecking(false); - } - - monitor.subTask("Semantic checking"); - final SubProgressMonitor semanticMonitor = new SubProgressMonitor(monitor, 1); - semanticMonitor.beginTask("Semantic check", modulesToCheck.size()); - - // process the modules one-by-one - for (final Module module2 : modulesToCheck) { - semanticMonitor.subTask("Semantically checking module: " + module2.getName()); - module2.check(compilationCounter); - semanticMonitor.worked(1); + nofModulesTobeChecked = selectionMethodBase.getModulesToCheck().size(); + } else { + //re-enable all markers + for (Module module2 : allModules) { + MarkerHandler.reEnableAllMarkers((IFile) module2.getLocation().getFile()); + } } - semanticMonitor.done(); - monitor.subTask("Doing post semantic checks"); - - for (Module module2 : modulesToCheck) { - module2.postCheck(); + if (preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null)) { + MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); + TITANDebugConsole.println(" ** Had to start checking at " + nofModulesTobeChecked + " modules. ", stream); + TITANDebugConsole.println(" **On-the-fly semantic checking of projects (" + allModules.size() + " modules) took " + (System.nanoTime() - semanticCheckStart) * (1e-9) + " seconds", stream); } - monitor.subTask("Cleanup operations"); - - synchronized (semanticallyUptodateModules) { - semanticallyUptodateModules.clear(); - semanticallyUptodateModules.addAll(moduleMap.keySet()); - } - - // re-enable the markers on the skipped modules. - for (Module module2 : modulesToSkip) { - MarkerHandler.reEnableAllMarkers((IFile) module2.getLocation().getFile()); - } - - modulesSkippedGlobally.addAll(modulesToSkip); - - moduleToBeReanalysed.clear(); - - if (preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, - null)) { - MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" ** Has to start checking at " + modulesToCheck.size() + " modules. ", stream); - TITANDebugConsole.println(" **On-the-fly semantic checking of project " + project.getName() + " (" - + semanticallyUptodateModules.size() + " modules) took " - + (System.nanoTime() - semanticCheckStart) * (1e-9) + " seconds", stream); - TITANDebugConsole.println(" **Checked " + modulesToCheck.size() + " modules",stream); + + for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) { + ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer(); + synchronized (semanticAnalyzer.semanticallyUptodateModules) { + semanticAnalyzer.semanticallyUptodateModules.clear(); + semanticAnalyzer.semanticallyUptodateModules.addAll(semanticAnalyzer.moduleMap.keySet()); + } } } catch (Exception e) { // This catch is extremely important, as it is supposed @@ -749,190 +498,20 @@ public class ProjectSourceSemanticAnalyzer { // wrong inside the analysis. ErrorReporter.logExceptionStackTrace(e); } - - fullAnalysisNeeded = false; - sourceParser.setLastTimeChecked(compilationCounter); monitor.done(); - ProjectStructureDataCollector collector = GlobalProjectStructureTracker.getDataCollector(project); - for (Module module : moduleMap.values()) { - collector.addKnownModule(module.getIdentifier()); - module.extractStructuralInformation(collector); - } - } - - /** - * Calculates the list of modules that can be skipped when analyzing - * this project semantically. - * <p> - * This function might not be able to detect all modules that can be - * skipped at once. It should be run as long as it reports that it could - * remove new modules from the list of modules to be checked. - * - * @param modulesToCheck - * the list of modules to be check. Initially all - * modules, but the function will remove those that can - * be skipped. - * @param modulesToSkip - * the list of modules that can be skipped, to be - * generated by the function. - * @param modulesSkippedGlobally - * the list of modules that were already found to not - * need to be checked in this semantic checking cycle, by - * an other project. - * - * @return true if there were modules found that can be skipped from - * analyzing, false otherwise. - * */ - private boolean calculateModulesToSkip(final List<Module> modulesToCheck, final List<Module> modulesToSkip, - final List<Module> modulesSkippedGlobally) { - if (modulesToCheck.isEmpty()) { - return false; - } - - IPreferencesService preferenceService = Platform.getPreferencesService(); - boolean displayDebugInfo = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, - PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null); - - boolean foundSkippable = false; - // proven to need checking - List<Module> failed = new ArrayList<Module>(); - List<Module> modulesToCheckCopy = new ArrayList<Module>(); - modulesToCheckCopy.addAll(modulesToCheck); - MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - - for (Iterator<Module> iterator = modulesToCheckCopy.iterator(); iterator.hasNext();) { - Module module = iterator.next(); - if (failed.contains(module) || modulesToSkip.contains(module) || modulesSkippedGlobally.contains(module)) { - continue; - } - - if (module == null || module.getLastCompilationTimeStamp() == null || !sourceParser.isSemanticallyChecked(module)) { - if (displayDebugInfo && module != null) { - TITANDebugConsole.println(" ** Module " + module.getName() - + " can not be skipped as it was not yet analyzed.",stream); - } - failed.add(module); - continue; - } - - /** - * The modules that are reachable from the starting one. - */ - List<Module> reachableModules = new ArrayList<Module>(); - reachableModules.add(module); - - boolean valid = true; - for (int i = 0; i < reachableModules.size() && valid; i++) { - Module module2 = reachableModules.get(i); - if (module2 == null) { - valid = false; - TITANDebugConsole.println(" ** Module " + module.getName() - + " can not be skipped as it reaches a module that could not be parsed.", stream); - continue; - } - if (failed.contains(module2)) { - valid = false; - continue; - } - if (module2.getLastCompilationTimeStamp() != null && sourceParser.isSemanticallyChecked(module2)) { - if (module2.hasUnhandledImportChanges()) { - valid = false; - failed.add(module2); - if (displayDebugInfo) { - TITANDebugConsole.println(" ** Module " + module2.getName() - + " can not be skipped as it has unhandled import changes.", stream); - if (module != module2) { - TITANDebugConsole.println(" ** Module " + module.getName() - + " can not be skipped as it depends on " - + module2.getName() - + " which has unhandled import changes.",stream); - } - } - continue; - } - List<Module> importedModules = module2.getImportedModules(); - if (!importedModules.isEmpty()) { - boolean allElements = true; - Module module3; - for (int j = 0; j < importedModules.size() && allElements; j++) { - module3 = importedModules.get(j); - if (module3 == null) { - // erroneous - // import - allElements = false; - if (displayDebugInfo) { - if (module2 instanceof TTCN3Module) { - final List<ImportModule> impModules = ((TTCN3Module) module2) - .getImports(); - if (j < impModules.size()) { - //MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" ** Module " + module.getName() - + " can not be skipped as it imports `" - + impModules.get(j).getName() - + "' that could not be parsed.", stream); - } - } - //MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" ** Module " - + module.getName() - + " can not be skipped as it imports a module that could not be parsed.",stream); - } - } else if (failed.contains(module3)) { - allElements = false; - if (displayDebugInfo) { - //MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" ** Module " + module.getName() - + " can not be skipped as it depends on " - + module3.getName() - + " which needs to be checked.",stream); - } - } else if (modulesToSkip.contains(module3) || modulesSkippedGlobally.contains(module3)) { - // already decided, that it can be skipped - } else if (!sourceParser.isSemanticallyChecked(module3)) { - // imports a module that was not checked, so this must also be re-checked - allElements = false; - if (displayDebugInfo) { - //MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" ** Module " + module.getName() - + " can not be skipped as it depends on " + module3.getName() - + " which was not yet analyzed.", stream); - } - } else { - if (!reachableModules.contains(module3)) { - reachableModules.add(module3); - } - } - } - - if (!allElements) { - valid = false; - } - } - } else { - // The module was not yet checked. - valid = false; - //MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" ** Module " + module.getName() + " can not be skipped as it depends on " - + module2.getName() + " which was not yet checked.",stream); - } - } - - if (valid) { - modulesToSkip.addAll(reachableModules); - modulesToCheck.removeAll(reachableModules); - foundSkippable = true; - } else { - failed.add(module); + for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) { + GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).setLastTimeChecked(compilationCounter); + + ProjectStructureDataCollector collector = GlobalProjectStructureTracker.getDataCollector(tobeSemanticallyAnalyzed.get(i)); + for (Module module : GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer().moduleMap.values()) { + collector.addKnownModule(module.getIdentifier()); + module.extractStructuralInformation(collector); } + + MarkerHandler.removeAllOnTheFlyMarkedMarkers(tobeSemanticallyAnalyzed.get(i)); } - - if (displayDebugInfo) { - //MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream(); - TITANDebugConsole.println(" ** Found " + modulesToCheck.size() + " modules that needs to be checked and " + modulesToSkip.size() - + " modules to skip.",stream); - } - - return foundSkippable; + + return Status.OK_STATUS; } -} +} \ No newline at end of file diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSyntacticAnalyzer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSyntacticAnalyzer.java index e0803c60a4749fcf833f7bba1eb45bba5454a0bb..1c8353cfdac18f08b20fd1c43a9fc9a207b445d2 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSyntacticAnalyzer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ProjectSourceSyntacticAnalyzer.java @@ -343,7 +343,6 @@ public final class ProjectSourceSyntacticAnalyzer { reparser.updateLocation(((TTCN3Module) module).getLocation()); MarkerHandler.markAllOnTheFlyMarkersForRemoval(file, reparser.getDamageStart(), reparser.getDamageEnd()); } catch (ReParseException e) { - reparser.fullAnalysysNeeded = true; syntacticallyOutdated = true; uptodateFiles.remove(file); @@ -373,14 +372,11 @@ public final class ProjectSourceSyntacticAnalyzer { ErrorReporter.logExceptionStackTrace(e); } } else { - reparser.fullAnalysysNeeded = true; reportOutdating(file); } } else if (highlySyntaxErroneousFiles.contains(file)) { - reparser.fullAnalysysNeeded = true; reportOutdating(file); } else { - reparser.fullAnalysysNeeded = true; MarkerHandler.markAllMarkersForRemoval(file); TemporalParseData temp = fileBasedTTCN3Analysis(file); postFileBasedGeneralAnalysis(temp); @@ -927,15 +923,15 @@ public final class ProjectSourceSyntacticAnalyzer { // add annotations on inactive code if (module != null && module instanceof TTCN3Module && document != null && editors != null) { - final TTCN3Module ttcn_module = (TTCN3Module) module; + final TTCN3Module ttcnModule = (TTCN3Module) module; final List<ISemanticTITANEditor> editors2 = editors; - final List<Location> icl_list = ttcn_module.getInactiveCodeLocations(); + final List<Location> icList = ttcnModule.getInactiveCodeLocations(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { for (ISemanticTITANEditor editor : editors2) { if (editor instanceof TTCNPPEditor) { - ((TTCNPPEditor) editor).updateInactiveCodeAnnotations(icl_list); + ((TTCNPPEditor) editor).updateInactiveCodeAnnotations(icList); } } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/ASN1Analyzer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/ASN1Analyzer.java index 74ee8efb91b88d345fa32eca8f2c1adc949d277d..403b2c568abd8537bab2930c1a382d7a44c5a09a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/ASN1Analyzer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/ASN1Analyzer.java @@ -12,25 +12,18 @@ import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.UnbufferedCharStream; import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.parsers.Interval; import org.eclipse.titan.common.parsers.SyntacticErrorStorage; import org.eclipse.titan.common.parsers.TITANMarker; import org.eclipse.titan.designer.AST.ASN1.definitions.ASN1Module; import org.eclipse.titan.designer.parsers.ISourceAnalyzer; -import org.eclipse.titan.designer.parsers.asn1parser.Asn1Lexer; -import org.eclipse.titan.designer.parsers.asn1parser.ASN1Listener; -import org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser; -import org.eclipse.titan.designer.parsers.asn1parser.ModuleLevelTokenStreamTracker; -import org.eclipse.titan.designer.parsers.asn1parser.TokenWithIndexAndSubTokensFactory; /** * ASN1 Analyzer @@ -91,8 +84,8 @@ public class ASN1Analyzer implements ISourceAnalyzer { reader = new StringReader(code); } else if (file != null) { try { - reader = new BufferedReader(new InputStreamReader(file.getContents(), StandardCharsets.UTF_8)); - } catch (CoreException e) { + reader = new BufferedReader(new InputStreamReader(file.getContents(), file.getCharset())); + } catch (Exception e) { ErrorReporter.logExceptionStackTrace("Could not get the contents of `" + file.getName() + "'", e); } } else { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/Asn1Parser.g4 b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/Asn1Parser.g4 index 3d7bdbed2290310a566e8d28ccfacd9f787c70b6..100f3f27b65843f243767e5a34f5c818b8ce63cb 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/Asn1Parser.g4 +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/asn1parser/Asn1Parser.g4 @@ -184,32 +184,32 @@ locals [Token col, ASN1Type type, Reference reference, ObjectClass_Definition ob { $type = $a.type; $assignment = new Type_Assignment($identifier, null, $type); - $assignment.setLocation(new Location(actualFile, $a.start, $a.start)); + $assignment.setLocation(new Location(actualFile, $a.start, $a.stop)); } | b = pr_FromObjs { $reference = $b.fromObj; $col = $b.start; $type = new Referenced_Type($reference); - $type.setLocation(new Location(actualFile, $b.start, $b.start)); + $type.setLocation(new Location(actualFile, $b.start, $b.stop)); $assignment = new Type_Assignment($identifier, null, $type); - $assignment.setLocation(new Location(actualFile, $col, $col)); + $assignment.setLocation(new Location(actualFile, $col, $b.stop)); } | c = pr_UpperFromObj { $reference = $c.fromObj; $col = $c.start; $type = new Referenced_Type($reference); - $type.setLocation(new Location(actualFile, $c.start, $c.start)); + $type.setLocation(new Location(actualFile, $c.start, $c.stop)); $assignment = new Type_Assignment($identifier, null, $type); - $assignment.setLocation(new Location(actualFile, $col, $col)); + $assignment.setLocation(new Location(actualFile, $col, $c.stop)); } | d = pr_ObjectClassDefn { $objectClass_Definition = $d.objectClass_Definition; $col = $d.start; $assignment = new ObjectClass_Assignment($identifier, null, $objectClass_Definition); - $assignment.setLocation(new Location(actualFile, $d.start, $d.start)); + $assignment.setLocation(new Location(actualFile, $d.start, $d.stop)); } ) EOF @@ -323,7 +323,7 @@ locals [ASN1Assignment assignment] ( a = pr_Assignment { $assignment = $a.assignment; if($assignment != null) { - $assignment.setLocation(new Location(actualFile, $a.start, $a.start)); + $assignment.setLocation(new Location(actualFile, $a.start, $a.stop)); $assignments.addAssignment($assignment); } } @@ -350,11 +350,11 @@ locals [ImportModule importModule] pr_Assignment returns [ASN1Assignment assignment] locals [Token endcol, Token col]: ( - a = pr_ValueAssignment { $assignment = $a.assignment; $col = $a.start; $endcol = $a.start; } -| b = pr_ValueSetTypeAssignment { $assignment = $b.assignment; $col = $b.start; $endcol = $b.start; } -| c = pr_UndefAssignment { $assignment = $c.assignment; $col = $c.start; $endcol = $c.start; } -| d = pr_ObjectClassAssignment { $assignment = $d.assignment; $col = $d.start; $endcol = $d.start; } -| e = pr_TypeAssignment { $assignment = $e.assignment; $col = $e.start; $endcol = $e.start; } + a = pr_ValueAssignment { $assignment = $a.assignment; $col = $a.start; $endcol = $a.stop; } +| b = pr_ValueSetTypeAssignment { $assignment = $b.assignment; $col = $b.start; $endcol = $b.stop; } +| c = pr_UndefAssignment { $assignment = $c.assignment; $col = $c.start; $endcol = $c.stop; } +| d = pr_ObjectClassAssignment { $assignment = $d.assignment; $col = $d.start; $endcol = $d.stop; } +| e = pr_TypeAssignment { $assignment = $e.assignment; $col = $e.start; $endcol = $e.stop; } ) { if ($assignment != null) { @@ -407,7 +407,7 @@ locals [Identifier identifier, Ass_pard formalParameters, ASN1Type type, Referen { $reference = $uo.fromObj; $type = new Referenced_Type($reference); - $type.setLocation(new Location(actualFile, $uo.start, $uo.start)); + $type.setLocation(new Location(actualFile, $uo.start, $uo.stop)); $assignment = new Type_Assignment($identifier, $formalParameters, $type); } @@ -417,7 +417,7 @@ locals [Identifier identifier, Ass_pard formalParameters, ASN1Type type, Referen { $reference = $fo.fromObj; $type = new Referenced_Type($reference); - $type.setLocation(new Location(actualFile, $fo.start, $fo.start)); + $type.setLocation(new Location(actualFile, $fo.start, $fo.stop)); $assignment = new Type_Assignment($identifier, $formalParameters, $type); } ) @@ -433,7 +433,7 @@ locals [Token endCol, Identifier identifier, Ass_pard formalParameters, ObjectCl cd = pr_ObjectClassDefn { $objectClass_Definition = $cd.objectClass_Definition; - $endCol = $cd.start; + $endCol = $cd.stop; $assignment = new ObjectClass_Assignment($identifier, $formalParameters, $objectClass_Definition); } ) @@ -523,11 +523,11 @@ locals [Token endcol, Identifier identifier, Reference reference, Reference refe a10 = pr_Type_reg { $type = $a10.type; } ASSIGNMENT ( - a11 = pr_Value_reg { $value = $a11.value; $endcol = $a11.start; } - | a12 = pr_NullValue { $value = $a12.value; $endcol = $a12.start; } + a11 = pr_Value_reg { $value = $a11.value; $endcol = $a11.stop; } + | a12 = pr_NullValue { $value = $a12.value; $endcol = $a12.stop; } | block1 = BLOCK { $value = new Undefined_Block_Value(new Block($block1)); $endcol = $block1;} - | a14 = pr_ReferencedValue_reg{ $value = $a14.value; $endcol = $a14.start; } - | a15 = pr_LowerIdValue { $value = $a15.value; $endcol = $a15.start; } + | a14 = pr_ReferencedValue_reg{ $value = $a14.value; $endcol = $a14.stop; } + | a15 = pr_LowerIdValue { $value = $a15.value; $endcol = $a15.stop; } ) { $assignment = new Value_Assignment($identifier, $formalParameters, $type, $value); @@ -537,7 +537,7 @@ locals [Token endcol, Identifier identifier, Reference reference, Reference refe ASSIGNMENT a21 = pr_Value { $value = $a21.value; } { - $endcol = $a21.start; + $endcol = $a21.stop; $type = new Referenced_Type($reference); $assignment = new Value_Assignment($identifier, $formalParameters, $type, $value); } @@ -545,7 +545,7 @@ locals [Token endcol, Identifier identifier, Reference reference, Reference refe ASSIGNMENT a31 = pr_Value { $value = $a31.value; } { - $endcol = $a31.start; + $endcol = $a31.stop; $type = new Referenced_Type($reference); $assignment = new Value_Assignment($identifier, $formalParameters, $type, $value); } @@ -555,13 +555,13 @@ locals [Token endcol, Identifier identifier, Reference reference, Reference refe ( a41 = pr_Value_reg { $value = $a41.value; }//value_assignment { - $endcol = $a41.start; + $endcol = $a41.stop; $type = new Referenced_Type($reference); $assignment = new Value_Assignment( $identifier, $formalParameters, $type, $value); } | a42 = pr_NullValue { $value = $a42.value; } //value_assignment { - $endcol = $a42.start; + $endcol = $a42.stop; $type = new Referenced_Type($reference); $assignment = new Value_Assignment($identifier, $formalParameters, $type, $value); } @@ -604,10 +604,10 @@ locals [ASN1Type subType, NamedType_Helper namedType_Helper, Constraint constrai { if($set != null) { $type = new SetOf_Type($subType); - $type.setLocation(new Location(actualFile, $set, $c.start != null ? $c.start : $d.start)); + $type.setLocation(new Location(actualFile, $set, $c.stop != null ? $c.stop : $d.stop)); } else if($sequence != null) { $type = new SequenceOf_Type($subType); - $type.setLocation(new Location(actualFile, $sequence, $c.start != null ? $c.start : $d.start)); + $type.setLocation(new Location(actualFile, $sequence, $c.stop != null ? $c.stop : $d.stop)); } if ($constraint != null && $type != null) { $constraints = new Constraints(); @@ -625,7 +625,7 @@ locals [ASN1Type subType, NamedType_Helper namedType_Helper, Constraint constrai )? // pr_BuiltinType_reg, pr_ConstrainedType { if ( $type != null ) { - $type.setLocation(new Location(actualFile, $builtin.start, $builtin.start)); + $type.setLocation(new Location(actualFile, $builtin.start, $builtin.stop)); $type.addConstraints($constraints); } } @@ -634,7 +634,7 @@ locals [ASN1Type subType, NamedType_Helper namedType_Helper, Constraint constrai { $constraints = $f.constraints; if ( $type != null ) { - $type.setLocation(new Location(actualFile, $ref.start, $ref.start)); + $type.setLocation(new Location(actualFile, $ref.start, $ref.stop)); $type.addConstraints($constraints); } } @@ -661,7 +661,7 @@ locals [Token end, Block withBlock] CLASS block1 = BLOCK { $end = $block1; } ( - block2 = pr_WithSyntaxSpec { $withBlock = $block2.block; $end = $block2.start; } + block2 = pr_WithSyntaxSpec { $withBlock = $block2.block; $end = $block2.stop; } )? ) { @@ -731,7 +731,7 @@ locals [FieldSpecification fieldSpecification] startCol = pr_FieldSpec { $fieldSpecification = $startCol.fieldSpecification; } { if ($fieldSpecification != null) { - $fieldSpecification.setLocation(new Location(actualFile, $startCol.start, $startCol.start)); + $fieldSpecification.setLocation(new Location(actualFile, $startCol.start, $startCol.stop)); $fieldSpecifications.addFieldSpecification($fieldSpecification); } } @@ -739,7 +739,7 @@ locals [FieldSpecification fieldSpecification] COMMA endCol = pr_FieldSpec { $fieldSpecification = $endCol.fieldSpecification; } { if($fieldSpecification != null) { - $fieldSpecification.setLocation(new Location(actualFile, $endCol.start, $endCol.start)); + $fieldSpecification.setLocation(new Location(actualFile, $endCol.start, $endCol.stop)); $fieldSpecifications.addFieldSpecification($fieldSpecification); } } @@ -901,8 +901,8 @@ pr_special_Value_subrule returns [Value value] @init { $value = null; }: ( // Originally pr_FixedTypeFieldValue, but moved to a separate branch not to have invalid lookaheads a = pr_BuiltinValue { $value = $a.value; } -| pr_ReferencedValue_reg -| b = pr_BuiltinValue { $value = $b.value; } +| b = pr_ReferencedValue_reg { $value = $b.value; } +| c = pr_BuiltinValue { $value = $c.value; } ); pr_special_Value_endCorrectingSubrule: @@ -1255,10 +1255,10 @@ locals [Type subType, NamedType_Helper namedType_Helper, Constraint constraint, { if ($set != null) { $type = new SetOf_Type($subType); - $type.setLocation(new Location(actualFile, $set, $namedTypecol.start != null ? $namedTypecol.start : $subTypecol.start)); + $type.setLocation(new Location(actualFile, $set, $namedTypecol.stop != null ? $namedTypecol.stop : $subTypecol.stop)); } else if ($sequence != null) { $type = new SequenceOf_Type($subType); - $type.setLocation(new Location(actualFile, $sequence, $namedTypecol.start != null ? $namedTypecol.start : $subTypecol.start)); + $type.setLocation(new Location(actualFile, $sequence, $namedTypecol.stop != null ? $namedTypecol.stop : $subTypecol.stop)); } if ($constraint != null && $type != null) { $constraints = new Constraints(); @@ -1272,12 +1272,12 @@ locals [Type subType, NamedType_Helper namedType_Helper, Constraint constraint, builtin = pr_BuiltinType_reg { $type = $builtin.type; - $type.setLocation(new Location(actualFile, $builtin.start, $builtin.start)); + $type.setLocation(new Location(actualFile, $builtin.start, $builtin.stop)); } | referenced = pr_ReferencedType { $type = $referenced.type; - $type.setLocation(new Location(actualFile, $referenced.start, $referenced.start)); + $type.setLocation(new Location(actualFile, $referenced.start, $referenced.stop)); } )//pr_NakedType_reg ( @@ -1371,7 +1371,7 @@ locals [Reference reference] ) { $value = new Referenced_Value($reference); - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); }; pr_BuiltinType_reg returns [ASN1Type type] @@ -1404,7 +1404,7 @@ locals [Reference reference] ) { $type = new Referenced_Type($reference); - $type.setLocation(new Location(actualFile, $a.start, $a.start)); + $type.setLocation(new Location(actualFile, $a.start, $a.stop)); }; pr_Constraints returns[Constraints constraints] @@ -1654,7 +1654,7 @@ pr_SelectionType returns [Selection_Type type] { Identifier identifier = new Identifier(Identifier_type.ID_ASN, $start.getText(), new Location(actualFile, $start, $start)); $type = new Selection_Type(identifier, $a.type); - $type.setLocation(new Location(actualFile, $start, $a.start)); + $type.setLocation(new Location(actualFile, $start, $a.stop)); }; pr_EnumeratedType returns [ASN1_Enumerated_Type type] @@ -1900,7 +1900,7 @@ pr_ChoiceValue returns [Choice_Value value] identifier = new Identifier(Identifier_type.ID_ASN, $start.getText(), new Location(actualFile, $start, $start)); if ($a.value != null) { $value = new Choice_Value(identifier, $a.value); - $value.setLocation(new Location(actualFile, $start, $a.start)); + $value.setLocation(new Location(actualFile, $start, $a.stop)); } }; @@ -2032,7 +2032,7 @@ pr_UpperFromObj returns [InformationFromObj fromObj] ) { $fromObj = new InformationFromObj($a.reference, $b.fieldName); - $fromObj.setLocation(new Location(actualFile, $a.start, $b.start)); + $fromObj.setLocation(new Location(actualFile, $a.start, $b.stop)); }; pr_DefdUpper returns [Reference reference] @@ -2049,7 +2049,7 @@ pr_DefdUpper returns [Reference reference] ) { if($reference != null){ - $reference.setLocation(new Location(actualFile, $a.start, $block != null ? $block:$a.start)); + $reference.setLocation(new Location(actualFile, $a.start, $block != null ? $block:$a.stop)); } }; @@ -2222,14 +2222,14 @@ pr_Lower_FromObjs returns [InformationFromObj fromObj] ) { $fromObj = new InformationFromObj($a.reference, $b.fieldName); - $fromObj.setLocation(new Location(actualFile, $a.start, $b.start)); + $fromObj.setLocation(new Location(actualFile, $a.start, $b.stop)); }; pr_Upper_FromObjs returns[InformationFromObj fromObj] locals [Token end, Defined_Reference ref, FieldName fieldName] @init { $ref = null; $fieldName = null; $fromObj = null; }: ( - a = pr_SimplDefdUpper {$ref = $a.reference; $end = $a.start;} + a = pr_SimplDefdUpper {$ref = $a.reference; $end = $a.stop;} ( block = BLOCK //if there is block then pr_PardUpper_FromObjs, if not pr_SimplUpper_FromObjs { @@ -2239,8 +2239,8 @@ locals [Token end, Defined_Reference ref, FieldName fieldName] )? DOT ( - b1 = pr_FieldNameLower { $end = $b1.start; $fieldName = $b1.fieldName; } - | b2 = pr_FieldNameUpper { $end = $b2.start; $fieldName = $b2.fieldName; } + b1 = pr_FieldNameLower { $end = $b1.stop; $fieldName = $b1.fieldName; } + | b2 = pr_FieldNameUpper { $end = $b2.stop; $fieldName = $b2.fieldName; } ( DOT ( @@ -2566,7 +2566,7 @@ locals [Token referenceEnd, Identifier identifier, ASN1Type type, boolean is_uni | pr_RefdLower_reg | DOT ( - d41 = pr_FieldNameLower { $fieldName = $d41.fieldName; $referenceEnd = $d41.start; } + d41 = pr_FieldNameLower { $fieldName = $d41.fieldName; $referenceEnd = $d41.stop; } | d42 = pr_FieldNameUpper { $fieldName = $d42.fieldName; } ( DOT @@ -2624,7 +2624,7 @@ locals [Token referenceEnd, Identifier identifier, ASN1Type type, boolean is_uni ) | DOT ( - a2 = pr_FieldNameLower { $fieldName = $a2.fieldName; $referenceEnd = $a2.start; } + a2 = pr_FieldNameLower { $fieldName = $a2.fieldName; $referenceEnd = $a2.stop; } | a21 = pr_FieldNameUpper { $fieldName = $a21.fieldName; } ( DOT ( @@ -2699,7 +2699,7 @@ locals [Values values] { if ($values != null) { $value = new SequenceOf_Value($values); - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); } }; @@ -2747,7 +2747,7 @@ locals [Values values] { if ($values != null) { $value = new SetOf_Value($values); - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); } }; @@ -2769,7 +2769,7 @@ locals [NamedValues namedValues] { if ($namedValues != null) { $value = new Sequence_Value($namedValues); - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); } }; @@ -2802,7 +2802,7 @@ locals [Value value] { Identifier identifier = new Identifier(Identifier_type.ID_ASN, $a.getText(), new Location(actualFile, $a, $a)); $namedValue = new NamedValue(identifier, $value); - $namedValue.setLocation(new Location(actualFile, $a, $b.start == null ? $a : $b.start)); + $namedValue.setLocation(new Location(actualFile, $a, $b.start == null ? $a : $b.stop)); }; pr_special_SetValue returns [Set_Value value] @@ -2823,7 +2823,7 @@ locals [NamedValues namedValues] { if ($namedValues != null) { $value = new Set_Value($namedValues); - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); } }; @@ -2838,7 +2838,7 @@ pr_ObjectIdentifierValue returns[ObjectIdentifier_Value value] @init { $value = new ObjectIdentifier_Value(); }: a = pr_ObjIdComponentList[$value] { - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); }; pr_ObjIdComponentList [ObjectIdentifier_Value value] @@ -2871,7 +2871,7 @@ locals [Value value] $value = $c.value; if ($value != null) { $objidComponent = new ObjectIdentifierComponent($value); - $objidComponent.setLocation(new Location(actualFile, $c.start, $c.start)); + $objidComponent.setLocation(new Location(actualFile, $c.start, $c.stop)); } } ); @@ -2885,7 +2885,7 @@ locals [Value value] { if ($value != null) { $objidComponent = new ObjectIdentifierComponent($value); - $objidComponent.setLocation(new Location(actualFile, $b.start, $b.start)); + $objidComponent.setLocation(new Location(actualFile, $b.start, $b.stop)); } } ); @@ -2898,7 +2898,7 @@ locals [Reference reference] ) { $value = new Referenced_Value($reference); - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); }; pr_NameAndNumberForm returns[ObjectIdentifierComponent objidComponent] @@ -2946,7 +2946,7 @@ pr_RelativeOIDValue returns[RelativeObjectIdentifier_Value value = new RelativeO @init { $value = new RelativeObjectIdentifier_Value(); } : a = pr_RelativeOIDComponentList[$value] { - $value.setLocation(new Location(actualFile, $a.start, $a.start)); + $value.setLocation(new Location(actualFile, $a.start, $a.stop)); }; pr_RelativeOIDComponentList [RelativeObjectIdentifier_Value value] @@ -2972,7 +2972,7 @@ locals [Value value] $value = $b.value; if ($value != null) { $objidComponent = new ObjectIdentifierComponent($value); - $objidComponent.setLocation(new Location(actualFile, $b.start, $b.start));} + $objidComponent.setLocation(new Location(actualFile, $b.start, $b.stop));} } ); @@ -3053,7 +3053,10 @@ locals [NamedType_Helper helper, CompField field] { $helper = $a.helper; $field = new CompField($helper.identifier, $helper.type, false, null); - $componentTypeList.addComponentType(new RegularComponentType($field)); + $field.setLocation(new Location(actualFile, $a.start, $a.stop)); + RegularComponentType componentType = new RegularComponentType($field); + componentType.setLocation(new Location(actualFile, $a.start, $a.stop)); + $componentTypeList.addComponentType(componentType); } ( COMMA @@ -3061,7 +3064,10 @@ locals [NamedType_Helper helper, CompField field] { $helper = $b.helper; $field = new CompField($helper.identifier, $helper.type, false, null); - $componentTypeList.addComponentType(new RegularComponentType($field)); + $field.setLocation(new Location(actualFile, $a.start, $b.stop)); + RegularComponentType componentType2 = new RegularComponentType($field); + componentType2.setLocation(new Location(actualFile, $a.start, $b.stop)); + $componentTypeList.addComponentType(componentType2); } )* ); @@ -3115,7 +3121,10 @@ locals [ComponentTypeList componentTypeList, NamedType_Helper helper] { $helper = $b.helper; CompField compField = new CompField($helper.identifier, $helper.type, false, null); - $extensionAddition = new RegularComponentType(compField); + compField.setLocation(new Location(actualFile, $b.start, $b.stop)); + RegularComponentType componentType = new RegularComponentType(compField); + componentType.setLocation(new Location(actualFile, $b.start, $b.stop)); + $extensionAddition = componentType; } ); @@ -3242,7 +3251,9 @@ locals [CompField compField, ASN1Type type] { $compField = $a.compField; if($compField != null){ + $compField.setLocation(new Location(actualFile, $a.start, $a.stop)); $componentType = new RegularComponentType($compField); + $componentType.setLocation(new Location(actualFile, $a.start, $a.stop)); } } | COMPONENTS @@ -3252,7 +3263,8 @@ locals [CompField compField, ASN1Type type] $type = $b.type; if ($type != null) { $componentType = new ComponentsOfComponentType($type); - $componentType.setLocation(new Location(actualFile, $b.start, $b.start)); + $componentType.setLocation(new Location(actualFile, $b.start, $b.stop)); + $componentType.setLocation(new Location(actualFile, $b.start, $b.stop)); } } ); @@ -3301,7 +3313,7 @@ pr_special_ObjectSetSpec returns [ObjectSet_definition definition] EOF ) { - if ($definition != null) { $definition.setLocation(new Location(actualFile, $a.start, $a.start)); } + if ($definition != null) { $definition.setLocation(new Location(actualFile, $a.start, $a.stop)); } }; pr_ObjectSetSpec returns [ObjectSet_definition definition] @@ -3348,7 +3360,7 @@ locals [IObjectSet_Element element] ) { if ($definition != null) { - $definition.setLocation(new Location(actualFile, $a.start, $a.start == null ? $b.start : $a.start)); + $definition.setLocation(new Location(actualFile, $a.start, $a.stop == null ? $b.stop : $a.stop)); } }; @@ -3361,7 +3373,7 @@ locals [Reference reference] { $reference = $b.reference; Referenced_ObjectSet temp = new Referenced_ObjectSet($reference); - temp.setLocation(new Location(actualFile, $b.start, $b.start)); + temp.setLocation(new Location(actualFile, $b.start, $b.stop)); $element = temp; } ); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3Analyzer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3Analyzer.java index 99af22468252b43cdb24f1d4eba18463be425f9a..8bda4977ea2f2350665722bca4e0c0c827ec2bc5 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3Analyzer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3Analyzer.java @@ -134,7 +134,7 @@ public class TTCN3Analyzer implements ISourceAnalyzer { return; } - parse4( reader, rootInt, aFile ); + parse( reader, rootInt, aFile ); } /** @@ -153,7 +153,7 @@ public class TTCN3Analyzer implements ISourceAnalyzer { return; } - parse4( bufferedReader, fileLength, null ); + parse( bufferedReader, fileLength, null ); } /** @@ -162,10 +162,11 @@ public class TTCN3Analyzer implements ISourceAnalyzer { * @param aFileLength file length * @param aEclipseFile Eclipse dependent resource file */ - private void parse4( final Reader aReader, final int aFileLength, IFile aEclipseFile ) { + private void parse( final Reader aReader, final int aFileLength, IFile aEclipseFile ) { CharStream charStream = new UnbufferedCharStream( aReader ); Ttcn3Lexer lexer = new Ttcn3Lexer( charStream ); + lexer.setCommentTodo( true ); lexer.setTokenFactory( new CommonTokenFactory( true ) ); lexer.initRootInterval( aFileLength ); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3ReparseUpdater.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3ReparseUpdater.java index 7244f377f958a6737386e47d505a175cb90175b1..328d2630045f80ddd5c5447569348cb5967387e4 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3ReparseUpdater.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/TTCN3ReparseUpdater.java @@ -10,7 +10,6 @@ package org.eclipse.titan.designer.parsers.ttcn3parser; import java.io.Reader; import java.io.StringReader; import java.util.ArrayList; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -75,12 +74,6 @@ public final class TTCN3ReparseUpdater { */ private boolean namechanged = false; - /** stores the list of modules that need to be re-analyzed when incremental semantic checking is used.*/ - public HashSet<String> moduleToBeReanalysed = new HashSet<String>(); - - /** Indicates whether a full semantic analyzes is required even if using incremental ones would be allowed.*/ - public boolean fullAnalysysNeeded = false; - public TTCN3ReparseUpdater(final IFile file, final String code, int firstLine, int lineShift, int startOffset, int endOffset, int shift) { this.file = file; this.code = code; @@ -395,7 +388,13 @@ public final class TTCN3ReparseUpdater { insideString = true; nextPos++; while (nextPos < rangeEnd && ('\"' != substring.charAt(nextPos) || '\"' == substring.charAt(nextPos - 1))) { - nextPos++; + if('\"' != substring.charAt(nextPos)) { + nextPos++; + } else if (nextPos + 1 < rangeEnd && '\"' == substring.charAt(nextPos + 1)) { + nextPos += 2; + } else { + break; + } } if (nextPos < rangeEnd) { insideString = false; @@ -425,7 +424,7 @@ public final class TTCN3ReparseUpdater { if (insideSingleComment || insideMultiComment || insideString) { return Integer.MAX_VALUE; } - return ++result; + return result; } /** @@ -553,6 +552,9 @@ public final class TTCN3ReparseUpdater { unsupportedConstructs.addAll(parser.getUnsupportedConstructs()); int result = measureIntervallDamage(); + if(!parser.isErrorListEmpty()){ + ++result; + } return result; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3BaseLexer.g4 b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3BaseLexer.g4 index 445e2716f715455e02b25a7ceb87820452ab28bd..78858a04745280835b6bf78651f64587a53d0473 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3BaseLexer.g4 +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3BaseLexer.g4 @@ -17,6 +17,8 @@ lexer grammar Ttcn3BaseLexer; @header { import java.util.ArrayList; import java.util.HashMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; @@ -104,58 +106,56 @@ import org.eclipse.titan.designer.AST.Location; public Location getLastPPDirectiveLocation() { return lastPPDirectiveLocation; } + + /** + * true, if todo/fixme markers can be placed by the lexer, + * typically it is set if full parsing is done + * false otherwise + */ + private boolean mCommentTodo = false; + + public void setCommentTodo( boolean aCommentTodo ) { + mCommentTodo = aCommentTodo; + } //TODO: we will need it later for the performance /** Used to preload the class, also loading the TTCN-3 lexer. */ public static void preLoad() { } - protected void detectTasks(final String param, final boolean multiLine) { - int todoIndex; - int fixmeIndex; - int newLineIndex; - int lastIndex = 0; - todoIndex = param.indexOf("TODO"); - fixmeIndex = param.indexOf("FIXME"); - int linecount = 0; - - while (todoIndex != -1 || fixmeIndex != -1) { - int start; - if (todoIndex > 0) { - if (fixmeIndex > 0 && fixmeIndex < todoIndex) { - start = fixmeIndex; - } else { - start = todoIndex; - } - } else { - start = fixmeIndex; - } - newLineIndex = param.indexOf('\n', lastIndex); - if (newLineIndex == -1 || newLineIndex > start) { - if (newLineIndex == -1) { - if(multiLine) { - newLineIndex = param.length() - 2; - } else { - newLineIndex = param.length(); - } - } - - String text = param.substring(start, newLineIndex); - if (start == todoIndex) { - createTaskMarker(new TITANMarker(text, actualLine + linecount + _tokenStartLine, -1, -1, - IMarker.SEVERITY_INFO, IMarker.PRIORITY_NORMAL)); - } else { - createTaskMarker(new TITANMarker(text, actualLine + linecount + _tokenStartLine, -1, -1, - IMarker.SEVERITY_INFO, IMarker.PRIORITY_HIGH)); + /** pattern for matching todo/fixme in a comment line */ + final static Pattern PATTERN_TODO_FIXME = Pattern.compile("((TODO|FIXME).*?)\\s*(?=(TODO|FIXME|$))"); + + /** + * Extracts todo and fixme information from comment text + * @param aCommentText the full text of the comment token + * @param aMultiLine type of comment. true: / * ... * /, false: / / ... \n + */ + private void detectTasks( final String aCommentText, final boolean aMultiLine ) { + if ( !mCommentTodo ) { + return; + } + // remove comment boundary characters + String commentText; + if ( aMultiLine ) { + commentText = aCommentText.substring( 2, aCommentText.length() - 2 ); + } else { + commentText = aCommentText.substring( 2 ); + } + + String commentLines[] = commentText.split("\\r?\\n"); + for( int i = 0; i < commentLines.length; i++ ) { + String commentLine = commentLines[ i ]; + Matcher m = PATTERN_TODO_FIXME.matcher(commentLine); + while ( m.find() ) { + String text = m.group( 1 ); + if ( text != null ) { + createTaskMarker( new TITANMarker( text, actualLine + i + _tokenStartLine, -1, -1, + IMarker.SEVERITY_INFO, text.startsWith("TODO") ? IMarker.PRIORITY_NORMAL : IMarker.PRIORITY_HIGH ) ); } } - - linecount++; - lastIndex = newLineIndex + 1; - todoIndex = param.indexOf("TODO", lastIndex); - fixmeIndex = param.indexOf("FIXME", lastIndex); } - } + } } /*------------------------------------------- Keywords -------------------------------------------*/ diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3Parser.g4 b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3Parser.g4 index 3330fc3dacea96ecff508d64259c3061df7f96c3..fe65c80f480a3e4e34201eaade40d831d7223b7f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3Parser.g4 +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3Parser.g4 @@ -913,7 +913,7 @@ pr_NestedFunctionTypeDef returns[Type type = null] ReturnType_Helper helper = null; Type returnType = null; boolean returnsTemplate = false; - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; Configuration_Helper confighelper = new Configuration_Helper(); }: ( col = pr_FunctionKeyword @@ -926,7 +926,7 @@ pr_NestedFunctionTypeDef returns[Type type = null] if( helper != null ) { returnType = helper.type; returnsTemplate = helper.returnsTemplate; - template_restriction = helper.templateRestriction; + templateRestriction = helper.templateRestriction; } } )? @@ -934,7 +934,7 @@ pr_NestedFunctionTypeDef returns[Type type = null] { if(parList == null) { parList = new FormalParameterList(new ArrayList<FormalParameter>()); } parList.setLocation(getLocation( $start1.start, $end1.stop)); - $type = new Function_Type(parList, confighelper.runsonReference, confighelper.runsOnSelf, returnType, returnsTemplate, template_restriction); + $type = new Function_Type(parList, confighelper.runsonReference, confighelper.runsOnSelf, returnType, returnsTemplate, templateRestriction); $type.setLocation(getLocation( $start, getStopToken())); }; @@ -1292,18 +1292,18 @@ pr_ValueOrRange returns[ParsedSubType parsedSubType = null]: pr_RangeDef returns[ParsedSubType parsedSubType = null] @init { - boolean min_exclusive = false; - boolean max_exclusive = false; + boolean minExclusive = false; + boolean maxExclusive = false; }: -( ( pr_ExcludeBound { min_exclusive = true; } )? +( ( pr_ExcludeBound { minExclusive = true; } )? min = pr_LowerBound RANGEOP - ( pr_ExcludeBound { max_exclusive = true; } )? + ( pr_ExcludeBound { maxExclusive = true; } )? max = pr_UpperBound ) { if ( $min.value != null && $max.value != null ) { - $parsedSubType = new Range_ParsedSubType( $min.value, min_exclusive, $max.value, max_exclusive ); + $parsedSubType = new Range_ParsedSubType( $min.value, minExclusive, $max.value, maxExclusive ); } }; @@ -1667,7 +1667,7 @@ pr_FunctionTypeDef returns[Def_Type def_type = null] ReturnType_Helper helper = null; Type returnType = null; boolean returnsTemplate = false; - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; Configuration_Helper confighelper = new Configuration_Helper(); }: ( col = pr_FunctionKeyword @@ -1681,7 +1681,7 @@ pr_FunctionTypeDef returns[Def_Type def_type = null] if(helper != null) { returnType = helper.type; returnsTemplate = helper.returnsTemplate; - template_restriction = helper.templateRestriction; + templateRestriction = helper.templateRestriction; } } )? @@ -1690,7 +1690,7 @@ pr_FunctionTypeDef returns[Def_Type def_type = null] if($i.identifier != null) { if(parList == null) { parList = new FormalParameterList(new ArrayList<FormalParameter>()); } parList.setLocation(getLocation( $start1.start, $end1.stop)); - Type type = new Function_Type(parList, confighelper.runsonReference, confighelper.runsOnSelf, returnType, returnsTemplate, template_restriction); + Type type = new Function_Type(parList, confighelper.runsonReference, confighelper.runsOnSelf, returnType, returnsTemplate, templateRestriction); type.setLocation(getLocation( $col.start, getStopToken())); $def_type = new Def_Type($i.identifier, type); } @@ -1751,21 +1751,21 @@ pr_TestcaseTypeDef returns[Def_Type def_type = null] pr_TemplateDef returns[Def_Template def_template = null] @init { - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; Template_definition_helper helper = new Template_definition_helper(); - Reference derived_reference = null; + Reference derivedReference = null; TemplateBody body = null; }: ( col = pr_TemplateKeyword - ( t = pr_TemplateRestriction { template_restriction = $t.template_restriction; } )? + ( t = pr_TemplateRestriction { templateRestriction = $t.templateRestriction; } )? pr_BaseTemplate[helper] - ( d = pr_DerivedDef { derived_reference = $d.reference; } )? + ( d = pr_DerivedDef { derivedReference = $d.reference; } )? pr_AssignmentChar b = pr_TemplateBody ) { if(helper.identifier != null && helper.type != null && $b.body != null) { - $def_template = new Def_Template(template_restriction, helper.identifier, helper.type, helper.formalParList, derived_reference, $b.body.getTemplate()); + $def_template = new Def_Template(templateRestriction, helper.identifier, helper.type, helper.formalParList, derivedReference, $b.body.getTemplate()); $def_template.setLocation(getLocation( $col.start, $b.stop)); $def_template.setCommentLocation(lexer.getLastCommentLocation()); } @@ -2360,7 +2360,7 @@ pr_FunctionDef returns[Def_Function def_func = null] ReturnType_Helper returnHelper = null; Type returnType = null; boolean returnsTemplate = false; - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; Location commentLocation = lexer.getLastCommentLocation(); if (commentLocation != null) { lexer.clearLastCommentLocation(); @@ -2377,7 +2377,7 @@ pr_FunctionDef returns[Def_Function def_func = null] if(returnHelper != null) { returnType = returnHelper.type; returnsTemplate = returnHelper.returnsTemplate; - template_restriction = returnHelper.templateRestriction; + templateRestriction = returnHelper.templateRestriction; } } )? @@ -2387,7 +2387,7 @@ pr_FunctionDef returns[Def_Function def_func = null] if($i.identifier != null && statementBlock != null) { if(parameters == null) { parameters = new FormalParameterList(new ArrayList<FormalParameter>()); } parameters.setLocation(getLocation( $start1.start, $end.stop)); - $def_func = new Def_Function($i.identifier, parameters, runsonHelper.runsonReference, returnType, returnsTemplate, template_restriction, statementBlock); + $def_func = new Def_Function($i.identifier, parameters, runsonHelper.runsonReference, returnType, returnsTemplate, templateRestriction, statementBlock); $def_func.setLocation(getLocation( $col.start, $s.stop)); $def_func.setCommentLocation(commentLocation); } @@ -2421,16 +2421,16 @@ pr_ReturnType returns[ReturnType_Helper helper] @init { $helper = new ReturnType_Helper(); boolean returnsTemplate = false; - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; }: ( col = RETURN - ( tr = pr_TemplateOptRestricted { returnsTemplate = true; template_restriction = $tr.template_restriction; } )? + ( tr = pr_TemplateOptRestricted { returnsTemplate = true; templateRestriction = $tr.templateRestriction; } )? t = pr_Type ) { $helper.type = $t.type; $helper.returnsTemplate = returnsTemplate; - $helper.templateRestriction = template_restriction; + $helper.templateRestriction = templateRestriction; }; pr_RunsOnSpec [Configuration_Helper helper]: @@ -2849,15 +2849,15 @@ pr_SystemKeyword: pr_TestcaseInstanceOp returns[Value value = null] @init { - Value dereferedValue = null; - boolean isDerefered = false; + Value dereferredValue = null; + boolean isDereferred = false; Reference temporalReference = null; ParsedActualParameters parameters = null; Value timerValue = null; }: ( col = EXECUTE pr_LParen - ( dv = pr_DereferOp { dereferedValue = $dv.value; isDerefered = true; } + ( dv = pr_DereferOp { dereferredValue = $dv.value; isDereferred = true; } | tr = pr_FunctionRef { temporalReference = $tr.reference; } ) parstart = pr_LParen @@ -2874,8 +2874,8 @@ pr_TestcaseInstanceOp returns[Value value = null] } parameters.setLocation(getLocation( $parstart.start, $parend.stop)); - if(isDerefered) { - $value = new ExecuteDereferedExpression(dereferedValue, parameters, timerValue); + if(isDereferred) { + $value = new ExecuteDereferedExpression(dereferredValue, parameters, timerValue); } else if(temporalReference != null) { Location temporalLocation = temporalReference.getLocation(); ISubReference subReference = temporalReference.removeLastSubReference(); @@ -2891,15 +2891,15 @@ pr_TestcaseInstanceOp returns[Value value = null] pr_TestcaseInstanceStatement returns[Statement statement = null] @init { - Value dereferedValue = null; - boolean isDerefered = false; + Value dereferredValue = null; + boolean isDereferred = false; Reference temporalReference = null; ParsedActualParameters parameters = null; Value timerValue = null; }: ( col = EXECUTE pr_LParen - ( dv = pr_DereferOp { dereferedValue = $dv.value; isDerefered = true; } + ( dv = pr_DereferOp { dereferredValue = $dv.value; isDereferred = true; } | tr = pr_FunctionRef { temporalReference = $tr.reference; } ) parstart = pr_LParen @@ -2916,8 +2916,8 @@ pr_TestcaseInstanceStatement returns[Statement statement = null] } parameters.setLocation(getLocation( $parstart.start, $parend.stop)); - if(isDerefered) { - $statement = new Referenced_Testcase_Instance_Statement(dereferedValue, parameters, timerValue); + if(isDereferred) { + $statement = new Referenced_Testcase_Instance_Statement(dereferredValue, parameters, timerValue); $statement.setLocation(getLocation( $col, $endcol.stop)); } else if(temporalReference != null) { Location temporalLocation = temporalReference.getLocation(); @@ -3547,7 +3547,7 @@ pr_ExtFunctionDef returns [Def_Extfunction def_extfunction = null] FormalParameterList parameters = null; Type returnType = null; boolean returnsTemplate = false; - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; }: ( col = pr_ExtKeyword pr_FunctionKeyword @@ -3560,7 +3560,7 @@ pr_ExtFunctionDef returns [Def_Extfunction def_extfunction = null] if(helper != null) { returnType = helper.type; returnsTemplate = helper.returnsTemplate; - template_restriction = helper.templateRestriction; + templateRestriction = helper.templateRestriction; } } )? @@ -3569,7 +3569,7 @@ pr_ExtFunctionDef returns [Def_Extfunction def_extfunction = null] if($i.identifier != null) { if(parameters == null) { parameters = new FormalParameterList(new ArrayList<FormalParameter>()); } parameters.setLocation(getLocation( $start1.start, $enda.stop)); - $def_extfunction = new Def_Extfunction($i.identifier, parameters, returnType, returnsTemplate, template_restriction); + $def_extfunction = new Def_Extfunction($i.identifier, parameters, returnType, returnsTemplate, templateRestriction); $def_extfunction.setLocation(getLocation( $start, getStopToken())); } }; @@ -3827,12 +3827,12 @@ pr_VarInstance returns[List<Definition> definitions] @init { $definitions = new ArrayList<Definition>(); List<Identifier> identifiers = null; - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; }: ( col = pr_VarKeyword - ( tr = pr_TemplateOptRestricted { template_restriction = $tr.template_restriction; } + ( tr = pr_TemplateOptRestricted { templateRestriction = $tr.templateRestriction; } t = pr_Type - pr_TempVarList[ $definitions, $t.type, template_restriction ] + pr_TempVarList[ $definitions, $t.type, templateRestriction ] | t2 = pr_Type pr_VarList[ $definitions, $t2.type ] ) @@ -3850,14 +3850,14 @@ pr_VarInstance returns[List<Definition> definitions] } }; -pr_TempVarList [List<Definition> definitions, Type type, TemplateRestriction.Restriction_type template_restriction]: -( pr_SingleTempVarInstance[definitions, type, template_restriction] +pr_TempVarList [List<Definition> definitions, Type type, TemplateRestriction.Restriction_type templateRestriction]: +( pr_SingleTempVarInstance[definitions, type, templateRestriction] ( pr_Comma - pr_SingleTempVarInstance[definitions, type, template_restriction] + pr_SingleTempVarInstance[definitions, type, templateRestriction] )* ); -pr_SingleTempVarInstance [List<Definition> definitions, Type type, TemplateRestriction.Restriction_type template_restriction] +pr_SingleTempVarInstance [List<Definition> definitions, Type type, TemplateRestriction.Restriction_type templateRestriction] @init { TemplateBody body = null; ArrayDimensions dimensions = null; @@ -3878,7 +3878,7 @@ pr_SingleTempVarInstance [List<Definition> definitions, Type type, TemplateRestr } } - Definition definition = new Def_Var_Template( $template_restriction, $i.identifier, tempType, body != null ? body.getTemplate() : null ); + Definition definition = new Def_Var_Template( $templateRestriction, $i.identifier, tempType, body != null ? body.getTemplate() : null ); definition.setLocation(getLocation( $start, getStopToken())); $definitions.add(definition); } @@ -4156,8 +4156,8 @@ pr_ConnectStatement returns[Connect_Statement statement = null]: ) { if($h.helper != null) { - $statement = new Connect_Statement( $h.helper.componentReference1, $h.helper.portReference1, - $h.helper.componentReference2, $h.helper.portReference2 ); + $statement = new Connect_Statement( $h.helper.componentReference1, new PortReference($h.helper.portReference1), + $h.helper.componentReference2, new PortReference($h.helper.portReference2) ); $statement.setLocation(getLocation( $col.start, $h.stop)); } }; @@ -4209,7 +4209,7 @@ pr_DisconnectStatement returns[Disconnect_Statement statement = null] if(helper != null && helper.componentReference1 != null && helper.portReference1 != null && helper.componentReference2 != null && helper.portReference2 != null) { - $statement = new Disconnect_Statement(helper.componentReference1, helper.portReference1, helper.componentReference2, helper.portReference2); + $statement = new Disconnect_Statement(helper.componentReference1, new PortReference(helper.portReference1), helper.componentReference2, new PortReference(helper.portReference2)); $statement.setLocation(getLocation( $col.start, $h.stop)); } else { reportUnsupportedConstruct( "Disconnect operation on multiple connections is not currently supported", $col.start, $col.stop ); @@ -4267,8 +4267,8 @@ pr_MapStatement returns[Map_Statement statement = null]: ) { if($h.helper != null) { - $statement = new Map_Statement( $h.helper.componentReference1, $h.helper.portReference1, - $h.helper.componentReference2, $h.helper.portReference2 ); + $statement = new Map_Statement( $h.helper.componentReference1, new PortReference($h.helper.portReference1), + $h.helper.componentReference2, new PortReference($h.helper.portReference2) ); $statement.setLocation(getLocation( $col.start, $h.stop)); } }; @@ -4290,7 +4290,7 @@ pr_UnmapStatement returns[Unmap_Statement statement = null] if(helper != null && helper.componentReference1 != null && helper.portReference1 != null && helper.componentReference2 != null && helper.portReference2 != null) { - $statement = new Unmap_Statement(helper.componentReference1, helper.portReference1, helper.componentReference2, helper.portReference2); + $statement = new Unmap_Statement(helper.componentReference1, new PortReference(helper.portReference1), helper.componentReference2, new PortReference(helper.portReference2)); $statement.setLocation(getLocation( $col.start, $h.stop)); } else { reportUnsupportedConstruct( "Unmap operation on multiple mappings is not currently supported", $col.start, $col.stop ); @@ -4304,7 +4304,7 @@ pr_UnmapKeyword: pr_StartTCStatement returns[Statement statement = null] @init { Value component = null; - Value dereferedValue = null; + Value dereferredValue = null; Reference functionref = null; ParsedActualParameters parameters = null; }: @@ -4312,13 +4312,13 @@ pr_StartTCStatement returns[Statement statement = null] pr_Dot START pr_LParen - ( ( dv = pr_DereferOp { dereferedValue = $dv.value; } + ( ( dv = pr_DereferOp { dereferredValue = $dv.value; } a1=pr_LParen ( p = pr_FunctionActualParList { parameters = $p.parsedParameters; } )? a2=pr_RParen { if(parameters == null) { parameters = new ParsedActualParameters(); } parameters.setLocation(getLocation( $a1.start, $a2.stop)); - $statement = new Start_Referenced_Component_Statement( component, dereferedValue, parameters ); + $statement = new Start_Referenced_Component_Statement( component, dereferredValue, parameters ); } ) | f = pr_FunctionInstance @@ -4755,7 +4755,7 @@ pr_ParamSpec returns[Parameter_Redirect redirect = null]: pr_ParamAssignmentList returns[Parameter_Redirect redirect = null]: ( col = pr_LParen - ( assignments = pr_AssignmentList { $redirect = new AssignmentList_Parameter_Redirect($assignments.parameter_assignments); } + ( assignments = pr_AssignmentList { $redirect = new AssignmentList_Parameter_Redirect($assignments.parameterAssignments); } | entries = pr_VariableList { $redirect = new VariableList_Parameter_Redirect($entries.entries); } ) endcol = pr_RParen @@ -4766,14 +4766,14 @@ pr_ParamAssignmentList returns[Parameter_Redirect redirect = null]: } }; -pr_AssignmentList returns[Parameter_Assignments parameter_assignments = null]: +pr_AssignmentList returns[Parameter_Assignments parameterAssignments = null]: ( p = pr_VariableAssignment - { $parameter_assignments = new Parameter_Assignments(); - if( $p.param_assignment != null ) { $parameter_assignments.add( $p.param_assignment ); } + { $parameterAssignments = new Parameter_Assignments(); + if( $p.param_assignment != null ) { $parameterAssignments.add( $p.param_assignment ); } } ( pr_Comma p = pr_VariableAssignment - { if( $p.param_assignment != null ) { $parameter_assignments.add( $p.param_assignment ); } } + { if( $p.param_assignment != null ) { $parameterAssignments.add( $p.param_assignment ); } } )* ); @@ -4996,7 +4996,7 @@ pr_AnyKeyword: pr_TimerStatements returns[Statement statement = null] @init { Value timerValue = null; - Value dereferedValue = null; + Value dereferredValue = null; ParsedActualParameters parameters = null; }: ( r = pr_TimerRef @@ -5006,7 +5006,7 @@ pr_TimerStatements returns[Statement statement = null] | START ( pr_LParen ( tv = pr_TimerValue { timerValue = $tv.value; } - | dv = pr_DereferOp { dereferedValue = $dv.value; } + | dv = pr_DereferOp { dereferredValue = $dv.value; } a1=pr_LParen ( p = pr_FunctionActualParList { parameters = $p.parsedParameters; } )? a2=pr_RParen @@ -5016,10 +5016,10 @@ pr_TimerStatements returns[Statement statement = null] ) pr_RParen )? - { if(dereferedValue != null) { + { if(dereferredValue != null) { Value component = new Referenced_Value( $r.reference ); component.setLocation( getLocation( $r.start, $r.stop ) ); - $statement = new Start_Referenced_Component_Statement( component, dereferedValue, parameters ); + $statement = new Start_Referenced_Component_Statement( component, dereferredValue, parameters ); } else { $statement = new Unknown_Start_Statement( $r.reference, timerValue ); } @@ -5336,15 +5336,15 @@ pr_Macro returns[Macro_Value value = null]: pr_FormalValuePar returns[FormalParameter parameter = null] @init { - Assignment_type assignment_type = Assignment_type.A_PAR_VAL; + Assignment_type assignmentType = Assignment_type.A_PAR_VAL; boolean isLazy = false; TemplateInstance default_value = null; Location commentLocation = lexer.getLastCommentLocation(); }: -( ( IN { assignment_type = Assignment_type.A_PAR_VAL_IN; } +( ( IN { assignmentType = Assignment_type.A_PAR_VAL_IN; } ( TITANSPECIFICLAZY { isLazy = true; } )? - | INOUT { assignment_type = Assignment_type.A_PAR_VAL_INOUT; } - | OUT { assignment_type = Assignment_type.A_PAR_VAL_OUT; } + | INOUT { assignmentType = Assignment_type.A_PAR_VAL_INOUT; } + | OUT { assignmentType = Assignment_type.A_PAR_VAL_OUT; } | TITANSPECIFICLAZY { isLazy = true; } )? t = pr_Type @@ -5362,7 +5362,7 @@ pr_FormalValuePar returns[FormalParameter parameter = null] )? ) { - $parameter = new FormalParameter(TemplateRestriction.Restriction_type.TR_NONE, assignment_type, $t.type, $i.identifier, default_value, isLazy); + $parameter = new FormalParameter(TemplateRestriction.Restriction_type.TR_NONE, assignmentType, $t.type, $i.identifier, default_value, isLazy); $parameter.setCommentLocation(commentLocation); $parameter.setLocation(getLocation( $start, getStopToken())); lexer.clearLastCommentLocation(); @@ -5387,19 +5387,19 @@ pr_FormalTimerPar returns[FormalParameter parameter = null] }; pr_FormalTemplatePar returns[FormalParameter parameter = null] - locals [ Assignment_type assignment_type ] + locals [ Assignment_type assignmentType ] @init { - $assignment_type = Assignment_type.A_PAR_TEMP_IN; - TemplateRestriction.Restriction_type template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + $assignmentType = Assignment_type.A_PAR_TEMP_IN; + TemplateRestriction.Restriction_type templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; boolean isLazy = false; TemplateInstance default_value = null; }: -( ( IN { $assignment_type = Assignment_type.A_PAR_TEMP_IN; } - | OUT { $assignment_type = Assignment_type.A_PAR_TEMP_OUT; } - | INOUT { $assignment_type = Assignment_type.A_PAR_TEMP_INOUT; } +( ( IN { $assignmentType = Assignment_type.A_PAR_TEMP_IN; } + | OUT { $assignmentType = Assignment_type.A_PAR_TEMP_OUT; } + | INOUT { $assignmentType = Assignment_type.A_PAR_TEMP_INOUT; } )? - tr = pr_TemplateOptRestricted { template_restriction = $tr.template_restriction; } - ( { $assignment_type == Assignment_type.A_PAR_TEMP_IN }? TITANSPECIFICLAZY { isLazy = true; } )? + tr = pr_TemplateOptRestricted { templateRestriction = $tr.templateRestriction; } + ( { $assignmentType == Assignment_type.A_PAR_TEMP_IN }? TITANSPECIFICLAZY { isLazy = true; } )? t = pr_Type i = pr_Identifier ( pr_AssignmentChar @@ -5415,27 +5415,27 @@ pr_FormalTemplatePar returns[FormalParameter parameter = null] )? ) { - $parameter = new FormalParameter(template_restriction, $assignment_type, $t.type, $i.identifier, default_value, isLazy); + $parameter = new FormalParameter(templateRestriction, $assignmentType, $t.type, $i.identifier, default_value, isLazy); $parameter.setLocation(getLocation( $start, getStopToken())); }; -pr_TemplateOptRestricted returns[TemplateRestriction.Restriction_type template_restriction] +pr_TemplateOptRestricted returns[TemplateRestriction.Restriction_type templateRestriction] @init { - $template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + $templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; }: ( pr_TemplateKeyword - ( t = pr_TemplateRestriction { $template_restriction = $t.template_restriction; } )? -| OMIT { $template_restriction = TemplateRestriction.Restriction_type.TR_OMIT; } + ( t = pr_TemplateRestriction { $templateRestriction = $t.templateRestriction; } )? +| OMIT { $templateRestriction = TemplateRestriction.Restriction_type.TR_OMIT; } ); -pr_TemplateRestriction returns[TemplateRestriction.Restriction_type template_restriction] +pr_TemplateRestriction returns[TemplateRestriction.Restriction_type templateRestriction] @init { - $template_restriction = TemplateRestriction.Restriction_type.TR_NONE; + $templateRestriction = TemplateRestriction.Restriction_type.TR_NONE; }: ( pr_LParen - ( OMIT { $template_restriction = TemplateRestriction.Restriction_type.TR_OMIT; } - | VALUE { $template_restriction = TemplateRestriction.Restriction_type.TR_VALUE; } - | PRESENT { $template_restriction = TemplateRestriction.Restriction_type.TR_PRESENT; } + ( OMIT { $templateRestriction = TemplateRestriction.Restriction_type.TR_OMIT; } + | VALUE { $templateRestriction = TemplateRestriction.Restriction_type.TR_VALUE; } + | PRESENT { $templateRestriction = TemplateRestriction.Restriction_type.TR_PRESENT; } ) pr_RParen ); @@ -5976,7 +5976,7 @@ pr_BasicStatements returns[Statement statement = null] | s3 = pr_String2TtcnStatement { $statement = $s3.statement; } | s4 = pr_Int2EnumStatement { $statement = $s4.statement; } | s5 = pr_LoopConstruct { $statement = $s5.statement; } -| s6 = pr_ConditionalConstruct { $statement = $s6.if_statement; } +| s6 = pr_ConditionalConstruct { $statement = $s6.ifStatement; } | s7 = pr_SelectCaseConstruct { $statement = $s7.statement; } | ( ( TITANSPECIFICTRY { exc_handling = StatementBlock.ExceptionHandling_type.EH_TRY; } | TITANSPECIFICCATCH @@ -6793,10 +6793,10 @@ pr_DoWhileStatement returns[Statement dowhile_statement = null ]: $dowhile_statement.setLocation(getLocation( $col, $endcol.stop)); }; -pr_ConditionalConstruct returns[If_Statement if_statement = null] +pr_ConditionalConstruct returns[If_Statement ifStatement = null] @init { - If_Clauses if_clauses = new If_Clauses(); - If_Clause if_clause = null; + If_Clauses ifClauses = new If_Clauses(); + If_Clause ifClause = null; StatementBlock statementblock2 = null; }: ( IF @@ -6804,18 +6804,18 @@ pr_ConditionalConstruct returns[If_Statement if_statement = null] v = pr_BooleanExpression pr_RParen sb = pr_StatementBlock - ( ei = pr_ElseIfClause { if($ei.if_clause != null) { if_clauses.addIfClause($ei.if_clause); }} )* + ( ei = pr_ElseIfClause { if($ei.ifClause != null) { ifClauses.addIfClause($ei.ifClause); }} )* ( e = pr_ElseClause { statementblock2 = $e.statementblock; } )? ) { - If_Clause first_if_clause = new If_Clause($v.value, $sb.statementblock); - first_if_clause.setLocation( getLocation( $start, $sb.stop) ); - if_clauses.addFrontIfClause(first_if_clause); - $if_statement = new If_Statement(if_clauses, statementblock2); - $if_statement.setLocation(getLocation( $start, getStopToken())); + If_Clause firstIfClause = new If_Clause($v.value, $sb.statementblock); + firstIfClause.setLocation( getLocation( $start, $sb.stop) ); + ifClauses.addFrontIfClause(firstIfClause); + $ifStatement = new If_Statement(ifClauses, statementblock2); + $ifStatement.setLocation(getLocation( $start, getStopToken())); }; -pr_ElseIfClause returns[If_Clause if_clause = null]: +pr_ElseIfClause returns[If_Clause ifClause = null]: ( col = ELSE IF pr_LParen @@ -6824,8 +6824,8 @@ pr_ElseIfClause returns[If_Clause if_clause = null]: sb = pr_StatementBlock ) { - $if_clause = new If_Clause($v.value, $sb.statementblock); - $if_clause.setLocation( getLocation( $col, $sb.stop) ); + $ifClause = new If_Clause($v.value, $sb.statementblock); + $ifClause.setLocation( getLocation( $col, $sb.stop) ); }; pr_ElseClause returns[StatementBlock statementblock = null]: diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstantValues.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstantValues.java index 4fdffd550b9f18b76a31633d78609e647547e800..fe38a5fd53d66c2ea0291ee54146ff850083cd0f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstantValues.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstantValues.java @@ -39,6 +39,10 @@ public final class PreferenceConstantValues { public static final String COMPILEROPTIONSTAY = "Stay unchanged"; public static final String COMPILEROPTIONOUTDATE = "Become outdated"; public static final String COMPILEROPTIONREMOVE = "Are removed"; + + // options for selecting the broken parts to analyze + public static final String MODULESELECTIONORIGINAL = "Original"; + public static final String BROKENPARTSVIAREFERENCES = "Broken parts via references"; // options for the designer on how compiler and designer markers interact public static final String ONTHEFLYOPTIONSTAY = "Stay"; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstants.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstants.java index 94e5cef995af58d22672eeea32ea2fd131d261d4..7d0058c59dd70422387228f8f3dec9bafd96c93f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstants.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceConstants.java @@ -21,8 +21,9 @@ public final class PreferenceConstants { public static final String REPORTPROGRAMERRORWITHMARKER = ProductConstants.PRODUCT_ID_DESIGNER + ".reportProgramErrorWithMarker"; public static final String TREATONTHEFLYERRORSFATALFORBUILD = ProductConstants.PRODUCT_ID_DESIGNER + ".treatOnTheFlyErrorsasFatalForBuild"; public static final String USEONTHEFLYPARSING = ProductConstants.PRODUCT_ID_DESIGNER + ".useOnTheFlyParsing"; - public static final String ENABLERISKYREFACTORING = ProductConstants.PRODUCT_ID_DESIGNER + ".enableRiskyRefectoring"; public static final String USEINCREMENTALPARSING = ProductConstants.PRODUCT_ID_DESIGNER + ".useIncrementalParsing"; + public static final String MODULESELECTIONALGORITHM = ProductConstants.PRODUCT_ID_DESIGNER + ".semanticCheckingAlgorithm"; + public static final String BROKENMODULESRATIO = ProductConstants.PRODUCT_ID_DESIGNER + ".brokenModulesRatio"; public static final String DELAYSEMANTICCHECKINGTILLSAVE = ProductConstants.PRODUCT_ID_DESIGNER + ".delaySemantiCheckingTillSave"; public static final String MINIMISEMEMORYUSAGE = ProductConstants.PRODUCT_ID_DESIGNER + ".minimiseMemoryUsage"; public static final String RECONCILERTIMEOUT = ProductConstants.PRODUCT_ID_DESIGNER + ".reconcilerTimeout"; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceInitializer.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceInitializer.java index 2b88a82dd6302ceb8a2bc999bec9c9f4e4cadba6..3171a2d4a9039366e20413a72d141815cd5afa6f 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceInitializer.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/PreferenceInitializer.java @@ -40,11 +40,12 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { preferenceStore.setDefault(PreferenceConstants.REPORTPROGRAMERRORWITHMARKER, false); preferenceStore.setDefault(PreferenceConstants.TREATONTHEFLYERRORSFATALFORBUILD, false); preferenceStore.setDefault(PreferenceConstants.USEONTHEFLYPARSING, true); - preferenceStore.setDefault(PreferenceConstants.ENABLERISKYREFACTORING, false); preferenceStore.setDefault(PreferenceConstants.USEINCREMENTALPARSING, false); + preferenceStore.setDefault(PreferenceConstants.MODULESELECTIONALGORITHM, PreferenceConstantValues.BROKENPARTSVIAREFERENCES); preferenceStore.setDefault(PreferenceConstants.DELAYSEMANTICCHECKINGTILLSAVE, true); preferenceStore.setDefault(PreferenceConstants.MINIMISEMEMORYUSAGE, false); preferenceStore.setDefault(PreferenceConstants.RECONCILERTIMEOUT, 1); + preferenceStore.setDefault(PreferenceConstants.BROKENMODULESRATIO, 20); preferenceStore.setDefault(PreferenceConstants.PROCESSINGUNITSTOUSE, PreferenceConstantValues.AVAILABLEPROCESSORS); preferenceStore.setDefault(PreferenceConstants.CONSOLE_ACTION_BEFORE_BUILD, PreferenceConstantValues.BEFORE_BUILD_PRINT_CONSOLE_DELIMITERS); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ErrorsWarningsPreferencePage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ErrorsWarningsPreferencePage.java index 601191add7733fbadb82ee881d367aa50993c039..74b5303fe1ceb9ec970b56926a46e1dc08dcf940 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ErrorsWarningsPreferencePage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ErrorsWarningsPreferencePage.java @@ -23,7 +23,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.designer.Activator; import org.eclipse.titan.designer.GeneralConstants; import org.eclipse.titan.designer.parsers.GlobalParser; @@ -43,11 +42,11 @@ public final class ErrorsWarningsPreferencePage extends FieldEditorPreferencePag private static final String REPORTUNSUPPORTEDCONSTRUCTS = "Language constructs not supported yet:"; private static final String REPORTUNSUPPORTEDCONSTRUCTS_TOOLTIP = "For example pattern subtyping in TTCN-3."; private static final String REPORTMISSINGIMPORTATION = "Missing imported module:"; - private static final String REPORTMISSINGIMPORTATION_TOOLTIP = "When a module refered to in an import statement could not be found."; + private static final String REPORTMISSINGIMPORTATION_TOOLTIP = "When a module referred to in an import statement could not be found."; private static final String REPORTUNUSEDMODULEIMPORTATION = "Report unused module importation:"; private static final String REPORTUNUSEDMODULEIMPORTATION_TOOLTIP = "When nothing is used in the module from the imported module."; private static final String REPORTMISSINGFRIEND = "Report friend declarations with missing modules:"; - private static final String REPORTMISSINGFRIEND_TOOLTIP = "When the module refered to in a friend declaration doulc not be found.."; + private static final String REPORTMISSINGFRIEND_TOOLTIP = "When the module referred to in a friend declaration doulc not be found.."; private static final String REPORTUNUSEDGLOBALDEFINITION = "Report unused module level definition:"; private static final String REPORTUNUSEDGLOBALDEFINITIONTOOLTIP = "When a module level definition is never read/written.\n" + " Also when a type is not used to declare other definitions."; @@ -568,7 +567,7 @@ public final class ErrorsWarningsPreferencePage extends FieldEditorPreferencePag Display.getDefault().syncExec(new Runnable() { @Override public void run() { - MessageDialog.openWarning(new Shell(Display.getDefault()), "Error/Warning settings changed", + MessageDialog.openWarning(null, "Error/Warning settings changed", "Error/Warning settings have changed, the known projects have to be re-analyzed completly.\nThis might take some time."); } }); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ExcludedResourcesPreferencePage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ExcludedResourcesPreferencePage.java index 5a2a0727e6d87480a95e08c53876d9159bd31ef4..46122612e37c78deb5659968690a6ab188df28df 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ExcludedResourcesPreferencePage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/ExcludedResourcesPreferencePage.java @@ -17,7 +17,6 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.Activator; import org.eclipse.titan.designer.decorators.TITANDecorator; @@ -92,7 +91,7 @@ public class ExcludedResourcesPreferencePage extends FieldEditorPreferencePage i Display.getDefault().syncExec(new Runnable() { @Override public void run() { - MessageDialog.openWarning(new Shell(Display.getDefault()), "Resource exclusion settings changed", + MessageDialog.openWarning(null, "Resource exclusion settings changed", "Resource exclusion settings have changed, the known projects have to be re-analyzed completly.\nThis might take some time."); } }); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/OnTheFlyCheckerPreferencePage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/OnTheFlyCheckerPreferencePage.java index f1f699f500f5d105309ca6346a3613b32e401014..a423e09cbe72fe2d61813646f6a66ab1514027f5 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/OnTheFlyCheckerPreferencePage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/preferences/pages/OnTheFlyCheckerPreferencePage.java @@ -15,9 +15,11 @@ import org.eclipse.jface.preference.IntegerFieldEditor; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.Activator; import org.eclipse.titan.designer.parsers.GlobalParser; +import org.eclipse.titan.designer.preferences.PreferenceConstantValues; import org.eclipse.titan.designer.preferences.PreferenceConstants; import org.eclipse.titan.designer.productUtilities.ProductConstants; import org.eclipse.ui.IWorkbench; @@ -30,18 +32,24 @@ public final class OnTheFlyCheckerPreferencePage extends FieldEditorPreferencePa private static final String DESCRIPTION = "Preferences of the on-the-fly checker"; private static final String ENABLE_PARSING = "Enable parsing of TTCN-3, ASN.1 and Runtime Configuration files"; - private static final String ENABLE_RISKY_REFACTORING = "Enable refactoring of projects containing errors and/or .ttcnpp files"; private static final String ENABLE_INCREMENTAL_PARSING = "Enable the incremental parsing of TTCN-3 files"; private static final String MINIMISE_MEMORY_USAGE = "Minimise memory usage"; private static final String DELAY_SEMANTIC_CHECKING = "Delay the on-the-fly semantic check till the file is saved"; private static final String RECONCILER_TIMEOUT = "Timeout in seconds before on-the-fly check starts"; + private static final String BROKEN_MODULES_RATIO = "Limit of broken modules during selection (%)"; + private static final String[][] ALGORITHM_OPTIONS = new String[][] { + { PreferenceConstantValues.MODULESELECTIONORIGINAL, PreferenceConstantValues.MODULESELECTIONORIGINAL }, + { PreferenceConstantValues.BROKENPARTSVIAREFERENCES, PreferenceConstantValues.BROKENPARTSVIAREFERENCES }}; + + private Composite composite; private BooleanFieldEditor useOnTheFlyParsing; - private BooleanFieldEditor enableRiskyRefactoring; private BooleanFieldEditor useIncrementalParsing; + private ComboFieldEditor moduleSelectionAlgorithm; private BooleanFieldEditor minimiseMemoryUsage; private BooleanFieldEditor delaySemanticCheckTillSave; private IntegerFieldEditor reconcilerTimeout; + private IntegerFieldEditor brokenModulesLimit; private boolean minimiseMemoryChanged = false; @@ -56,24 +64,34 @@ public final class OnTheFlyCheckerPreferencePage extends FieldEditorPreferencePa useOnTheFlyParsing = new BooleanFieldEditor(PreferenceConstants.USEONTHEFLYPARSING, ENABLE_PARSING, tempParent); addField(useOnTheFlyParsing); - enableRiskyRefactoring = new BooleanFieldEditor(PreferenceConstants.ENABLERISKYREFACTORING, ENABLE_RISKY_REFACTORING, tempParent); - addField(enableRiskyRefactoring); - useIncrementalParsing = new BooleanFieldEditor(PreferenceConstants.USEINCREMENTALPARSING, ENABLE_INCREMENTAL_PARSING, tempParent); addField(useIncrementalParsing); - + + moduleSelectionAlgorithm = new ComboFieldEditor(PreferenceConstants.MODULESELECTIONALGORITHM, "Selection method", ALGORITHM_OPTIONS, tempParent); + Label text = moduleSelectionAlgorithm.getLabelControl(tempParent); + text.setToolTipText("Broken parts selection algorithm."); + addField(moduleSelectionAlgorithm); + + composite = new Composite(tempParent, SWT.NONE); + + brokenModulesLimit = new IntegerFieldEditor(PreferenceConstants.BROKENMODULESRATIO, BROKEN_MODULES_RATIO, composite); + brokenModulesLimit.setValidRange(1, 100); + brokenModulesLimit.setTextLimit(3); + brokenModulesLimit.getLabelControl(composite).setToolTipText("Under of this ratio, running selection on definition level otherwise module level."); + + String actualAlgorithm = doGetPreferenceStore().getString(PreferenceConstants.MODULESELECTIONALGORITHM); + brokenModulesLimit.setEnabled(useModuleLimit(actualAlgorithm), composite); + addField(brokenModulesLimit); + minimiseMemoryUsage = new BooleanFieldEditor(PreferenceConstants.MINIMISEMEMORYUSAGE, MINIMISE_MEMORY_USAGE, tempParent); - addField(minimiseMemoryUsage); - - Composite composite = new Composite(tempParent, SWT.NONE); + addField(minimiseMemoryUsage); reconcilerTimeout = new IntegerFieldEditor(PreferenceConstants.RECONCILERTIMEOUT, RECONCILER_TIMEOUT, composite); reconcilerTimeout.setValidRange(0, 10); reconcilerTimeout.setTextLimit(2); addField(reconcilerTimeout); - delaySemanticCheckTillSave = new BooleanFieldEditor(PreferenceConstants.DELAYSEMANTICCHECKINGTILLSAVE, DELAY_SEMANTIC_CHECKING, - tempParent); + delaySemanticCheckTillSave = new BooleanFieldEditor(PreferenceConstants.DELAYSEMANTICCHECKINGTILLSAVE, DELAY_SEMANTIC_CHECKING, tempParent); addField(delaySemanticCheckTillSave); } @@ -88,8 +106,24 @@ public final class OnTheFlyCheckerPreferencePage extends FieldEditorPreferencePa "Minimise memory usage is on, this could indicate that in some cases rename refactoring function will not operate properly!"); } } + + if(event.getSource().equals(moduleSelectionAlgorithm)) { + String newValue = event.getNewValue().toString(); + if(!newValue.equals(event.getOldValue())) { + if(!brokenModulesLimit.isValid()){ + brokenModulesLimit.loadDefault(); + ErrorReporter.parallelWarningDisplayInMessageDialog("On-the-fly analyzer", "Incorrect limit of broken modules restored to default value."); + } + brokenModulesLimit.setEnabled(useModuleLimit(newValue), composite); + } + } + super.propertyChange(event); } + + private boolean useModuleLimit(String value){ + return value.equals(PreferenceConstantValues.BROKENPARTSVIAREFERENCES); + } @Override public void init(final IWorkbench workbench) { @@ -108,12 +142,13 @@ public final class OnTheFlyCheckerPreferencePage extends FieldEditorPreferencePa minimiseMemoryUsage.dispose(); delaySemanticCheckTillSave.dispose(); reconcilerTimeout.dispose(); + brokenModulesLimit.dispose(); + composite.dispose(); super.dispose(); } private boolean isImportantChanged() { - return getPreferenceStore().getBoolean(PreferenceConstants.USEINCREMENTALPARSING) != useIncrementalParsing.getBooleanValue() - || getPreferenceStore().getBoolean(PreferenceConstants.MINIMISEMEMORYUSAGE) != minimiseMemoryUsage.getBooleanValue(); + return getPreferenceStore().getBoolean(PreferenceConstants.MINIMISEMEMORYUSAGE) != minimiseMemoryUsage.getBooleanValue(); } @Override @@ -139,5 +174,5 @@ public final class OnTheFlyCheckerPreferencePage extends FieldEditorPreferencePa super.performApply(); - } + } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/BaseNamingConventionPropertyData.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/BaseNamingConventionPropertyData.java index 42ccc7303f2e511f0711358d55555255351fdc4e..5d54f31dabeeec346ef35a9f4b412af35b551486 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/BaseNamingConventionPropertyData.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/BaseNamingConventionPropertyData.java @@ -62,7 +62,7 @@ public final class BaseNamingConventionPropertyData { * the property list to use * @param tags * the TAGS to use - * @param default_values + * @param defaultValues * the default values to use * */ public static void loadProperties(final Node root, final IResource resource, final String qualifier, final String[] properties, @@ -105,12 +105,6 @@ public final class BaseNamingConventionPropertyData { * the document used for creating the tree nodes * @param resource * the resource to work on - * @param properties - * the property list to use - * @param tags - * the TAGS to use - * @param default_values - * the default values to use * @param qualifier * the qualifier to access the properties * @param properties @@ -196,10 +190,6 @@ public final class BaseNamingConventionPropertyData { * @param saveDefaultValues * whether the default values should be forced to be * added to the output. - * @param tags - * the list of TAGS to use. - * @param default_values - * the list of default values to use. * @param xmlNode * the XML node under which the new nodes should get * @param properties diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/TITANFlagsOptionsData.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/TITANFlagsOptionsData.java index ed066666f46df92bec32f7e5eba1a082329eafe4..cc35d87143b8b0e35f30da42c191fc89431e3631 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/TITANFlagsOptionsData.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/data/TITANFlagsOptionsData.java @@ -44,16 +44,19 @@ public final class TITANFlagsOptionsData { public static final String QUIETLY_PROPERTY = "quietly"; public static final String DISABLE_SUBTYPE_CHECKING_PROPERTY = "disableSubtypeChecking"; public static final String ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY = "omitInValueList"; + public static final String WARNINGS_FOR_BAD_VARIANTS_PROPERTY = "warningsForBadVariants"; public static final String[] PROPERTIES = { DISABLE_BER_PROPERTY, DISABLE_RAW_PROPERTY, DISABLE_TEXT_PROPERTY, DISABLE_XER_PROPERTY, DISABLE_JSON_PROPERTY, FORCE_XER_IN_ASN1_PROPERTY, DEFAULT_AS_OMIT_PROPERTY, FORCE_OLD_FUNC_OUT_PAR_PROPERTY, GCC_MESSAGE_FORMAT_PROPERTY, LINE_NUMBERS_ONLY_IN_MESSAGES_PROPERTY, - INCLUDE_SOURCEINFO_PROPERTY, ADD_SOURCELINEINFO_PROPERTY, SUPPRESS_WARNINGS_PROPERTY, QUIETLY_PROPERTY, DISABLE_SUBTYPE_CHECKING_PROPERTY,ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY }; + INCLUDE_SOURCEINFO_PROPERTY, ADD_SOURCELINEINFO_PROPERTY, SUPPRESS_WARNINGS_PROPERTY, ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY, WARNINGS_FOR_BAD_VARIANTS_PROPERTY, + QUIETLY_PROPERTY, DISABLE_SUBTYPE_CHECKING_PROPERTY }; public static final String[] TAGS = PROPERTIES; public static final String[] DEFAULT_VALUES = { "false", "false", "false", "false", "false", "false", "false", "false", "false", "false", - "true", "true", "false", "false", "false", "false" }; + "true", "true", "false", "false", "false", + "false", "false" }; private TITANFlagsOptionsData() { // Do nothing @@ -129,6 +132,10 @@ public final class TITANFlagsOptionsData { temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, TITANFlagsOptionsData.ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY)); builder.append("true".equals(temp) ? "M" : ""); + + temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, + TITANFlagsOptionsData.WARNINGS_FOR_BAD_VARIANTS_PROPERTY)); + builder.append("true".equals(temp) ? "E" : ""); if (builder.length() > 0) { builder.insert(0, '-'); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ConfigurationManagerControl.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ConfigurationManagerControl.java index 42c25d4f23f36b1a4ad6f3624fc95ce1f24655fa..3748951cd9a4ddf294ced6fab41562faf777b69e 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ConfigurationManagerControl.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ConfigurationManagerControl.java @@ -44,7 +44,6 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; @@ -420,7 +419,7 @@ public class ConfigurationManagerControl { manageButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent evt) { - ConfigurationListDialog dialog = new ConfigurationListDialog(new Shell(Display.getDefault())); + ConfigurationListDialog dialog = new ConfigurationListDialog(null); if (dialog.open() == Window.OK) { loadConfigurations(); } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/FolderNamingConventionPropertyPage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/FolderNamingConventionPropertyPage.java index f33a91559025b463ec5d10767c60b8e9a9a550a7..6cc1c9b9b9db287c80b73c2f5ae196cb20159c6a 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/FolderNamingConventionPropertyPage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/FolderNamingConventionPropertyPage.java @@ -20,7 +20,6 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.AST.NamingConventionHelper; import org.eclipse.titan.designer.preferences.PreferenceConstants; @@ -151,7 +150,7 @@ public class FolderNamingConventionPropertyPage extends BaseNamingConventionProp Display.getDefault().syncExec(new Runnable() { @Override public void run() { - MessageDialog.openWarning(new Shell(Display.getDefault()), "Naming convention settings changed", + MessageDialog.openWarning(null, "Naming convention settings changed", "Naming convention settings have changed, the known projects have to be re-analyzed completly.\nThis might take some time."); } }); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectBuildPropertyPage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectBuildPropertyPage.java index 5619b5155a52c6631bd25faccc9960ee98e3adf0..622ac011ab9b15775b47de8cefb6a5255b269d13 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectBuildPropertyPage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectBuildPropertyPage.java @@ -319,13 +319,13 @@ public final class ProjectBuildPropertyPage extends PropertyPage { internalMakefileCreationTab.setMakefileGenerationEnabled(generateInternalMakefileButton.getSelection()); makeAttributesTab.setMakefileGenerationEnabled(true); generateInternalMakefileButton.setEnabled(true); - updateSymlinkLessbuild(true); + updateSymlinkLessbuild(generateInternalMakefileButton.getSelection()); } else { makefileCreationTab.setMakefileGenerationEnabled(false); internalMakefileCreationTab.setMakefileGenerationEnabled(false); makeAttributesTab.setMakefileGenerationEnabled(false); generateInternalMakefileButton.setEnabled(false); - updateSymlinkLessbuild(false); + updateSymlinkLessbuild(generateInternalMakefileButton.getSelection()); } } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectConfigurationsPropertyPage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectConfigurationsPropertyPage.java index e2ac0c7af6d0b6849c0d534df8116f944f65c185..9032e3f44d0c8fc3af99ef9b75b7af8cfcf09a1e 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectConfigurationsPropertyPage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectConfigurationsPropertyPage.java @@ -52,7 +52,6 @@ import org.eclipse.titan.designer.properties.data.ProjectDocumentHandlingUtility import org.eclipse.titan.designer.properties.data.ProjectFileHandler; import org.eclipse.titan.designer.properties.data.ProjectConfigurationsPropertyData.ConfigurationRequirement; import org.eclipse.titan.designer.wizards.projectFormat.TITANAutomaticProjectExporter; -import org.eclipse.titan.designer.wizards.projectFormat.TITANProjectExporter; import org.eclipse.ui.dialogs.PropertyPage; import org.w3c.dom.Document; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectNamingConventionPropertyPage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectNamingConventionPropertyPage.java index a179962245fef9fab739be1652bd9d93d93d45bf..87366f52a2c13fd998465634e948f941b586c037 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectNamingConventionPropertyPage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ProjectNamingConventionPropertyPage.java @@ -19,7 +19,6 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.AST.NamingConventionHelper; import org.eclipse.titan.designer.preferences.PreferenceConstants; @@ -147,7 +146,7 @@ public class ProjectNamingConventionPropertyPage extends BaseNamingConventionPro Display.getDefault().syncExec(new Runnable() { @Override public void run() { - MessageDialog.openWarning(new Shell(Display.getDefault()), "Naming convention settings changed", + MessageDialog.openWarning(null, "Naming convention settings changed", "Naming convention settings have changed, the known projects have to be re-analyzed completly.\nThis might take some time."); } }); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/TITANFlagsOptionsPage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/TITANFlagsOptionsPage.java index 7570f31911903a86eb0b3b0c80e3846af35dce34..72e6bbcb9ef9b7a44739faf7da28f5d9e0097b97 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/TITANFlagsOptionsPage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/TITANFlagsOptionsPage.java @@ -43,6 +43,7 @@ public final class TITANFlagsOptionsPage implements IOptionsPage { private Button suppressWarnings; private Button quietly; private Button omitInValueList; + private Button warningsForBadVariants; //private Composite namingRuleComposite; //private ComboFieldEditor namingRules; @@ -69,6 +70,7 @@ public final class TITANFlagsOptionsPage implements IOptionsPage { suppressWarnings.dispose(); quietly.dispose(); omitInValueList.dispose(); + warningsForBadVariants.dispose(); } } @@ -129,7 +131,10 @@ public final class TITANFlagsOptionsPage implements IOptionsPage { omitInValueList = new Button(mainComposite, SWT.CHECK); omitInValueList.setText("Allow 'omit' in template value lists (legacy behavior) (-M)"); - + + warningsForBadVariants = new Button(mainComposite, SWT.CHECK); + warningsForBadVariants.setText("Display warnings instead of errors for invalid variants (-E)"); + return mainComposite; } @@ -155,6 +160,7 @@ public final class TITANFlagsOptionsPage implements IOptionsPage { suppressWarnings.setEnabled(enabled); quietly.setEnabled(enabled); omitInValueList.setEnabled(enabled); + warningsForBadVariants.setEnabled(enabled); } @Override @@ -217,6 +223,7 @@ public final class TITANFlagsOptionsPage implements IOptionsPage { suppressWarnings.setSelection(false); quietly.setSelection(false); omitInValueList.setSelection(false); + warningsForBadVariants.setSelection(false); } @Override @@ -303,6 +310,10 @@ public final class TITANFlagsOptionsPage implements IOptionsPage { temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, TITANFlagsOptionsData.ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY)); omitInValueList.setSelection("true".equals(temp) ? true : false); + + temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, + TITANFlagsOptionsData.WARNINGS_FOR_BAD_VARIANTS_PROPERTY)); + warningsForBadVariants.setSelection("true".equals(temp) ? true : false); } catch (CoreException e) { performDefaults(); @@ -330,6 +341,7 @@ public final class TITANFlagsOptionsPage implements IOptionsPage { setProperty(project, TITANFlagsOptionsData.SUPPRESS_WARNINGS_PROPERTY, suppressWarnings.getSelection() ? "true" : "false"); setProperty(project, TITANFlagsOptionsData.QUIETLY_PROPERTY, quietly.getSelection() ? "true" : "false"); setProperty(project, TITANFlagsOptionsData.ALLOW_OMIT_IN_VALUELIST_TEMPLATE_PROPERTY , omitInValueList.getSelection() ? "true" : "false"); + setProperty(project, TITANFlagsOptionsData.WARNINGS_FOR_BAD_VARIANTS_PROPERTY, warningsForBadVariants.getSelection() ? "true" : "false"); } catch (CoreException e) { ErrorReporter.logExceptionStackTrace(e); return false; diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/refactoring/RenameRefactoring.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/refactoring/RenameRefactoring.java index cd35630570c7c26707fc82add56251f310763c8b..cd4b9e0fa68006122d8a267bb2b6e9fdd564c7da 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/refactoring/RenameRefactoring.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/refactoring/RenameRefactoring.java @@ -23,7 +23,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.IPreferencesService; import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ltk.core.refactoring.Change; @@ -32,8 +31,6 @@ import org.eclipse.ltk.core.refactoring.Refactoring; import org.eclipse.ltk.core.refactoring.RefactoringStatus; import org.eclipse.ltk.core.refactoring.TextFileChange; import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.text.edits.MultiTextEdit; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.titan.common.logging.ErrorReporter; @@ -42,10 +39,12 @@ import org.eclipse.titan.designer.AST.Assignment; import org.eclipse.titan.designer.AST.FieldSubReference; import org.eclipse.titan.designer.AST.ISubReference; import org.eclipse.titan.designer.AST.Identifier; +import org.eclipse.titan.designer.AST.Identifier.Identifier_type; import org.eclipse.titan.designer.AST.Module; import org.eclipse.titan.designer.AST.NamedBridgeScope; import org.eclipse.titan.designer.AST.Reference; import org.eclipse.titan.designer.AST.ReferenceFinder; +import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.Scope; import org.eclipse.titan.designer.AST.SubScopeVisitor; import org.eclipse.titan.designer.AST.ASN1.definitions.ASN1Module; @@ -53,8 +52,6 @@ import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Choice_Type; import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Enumerated_Type; import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Sequence_Type; import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Set_Type; -import org.eclipse.titan.designer.AST.Identifier.Identifier_type; -import org.eclipse.titan.designer.AST.ReferenceFinder.Hit; import org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Enumerated_Type; import org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Set_Seq_Choice_BaseType; import org.eclipse.titan.designer.commonFilters.ResourceExclusionHelper; @@ -71,6 +68,7 @@ import org.eclipse.titan.designer.productUtilities.ProductConstants; import org.eclipse.ui.IEditorPart; /** + * FIXME component variables are not handled correctly * @author Adam Delic * */ public class RenameRefactoring extends Refactoring { @@ -78,18 +76,17 @@ public class RenameRefactoring extends Refactoring { public static final String NORECOGNISABLEMODULENAME = "The name of the module in the file `{0}'' could not be identified"; public static final String EXCLUDEDFROMBUILD = "The name of the module in the file `{0}'' could not be identified, the file is excluded from build"; public static final String NOTFOUNDMODULE = "The module `{0}'' could not be found"; - public static final String PROJECTCONTAINSERRORS = "The project contains errors, please fix the errors before refactoring"; - public static final String PROJECTCONTAINSTTCNPPFILES = "The project contains .ttcnpp files"; + public static final String PROJECTCONTAINSERRORS = "The project `{0}'' contains errors, which might corrupt the result of the refactoring"; + public static final String PROJECTCONTAINSTTCNPPFILES = "The project `{0}'' contains .ttcnpp files, which might corrupt the result of the refactoring"; public static final String FIELDALREADYEXISTS = "Field with name `{0}'' already exists in type `{1}''"; public static final String DEFINITIONALREADYEXISTS = "Name conflict:" + " definition with name `{0}'' already exists in the scope of the selected definition or in one of its parent scopes"; public static final String DEFINITIONALREADYEXISTS2 = "Name conflict:" + " definition with name `{0}'' already exists in module `{1}'' at line {2}"; - private static final String MINIMISEWARNING = "Minimise memory usage is on, it can cause unexpected behaviour in the refactoring process!\n" - + "This function is not supported with the memory minimise option, " - + "we do not take any responsibility for it.\n" - + "Would you like to continue anyway?"; + private static final String MINIMISEWARNING = "Minimise memory usage is enabled, which can cause unexpected behaviour in the refactoring process!\n" + + "Refactoring is not supported with the memory minimise option turned on, " + + "we do not take any responsibility for it."; final IFile file; final Module module; @@ -131,33 +128,35 @@ public class RenameRefactoring extends Refactoring { // TITANDebugConsole.getConsole().newMessageStream().println(v.getScopeTreeAsHTMLPage()); RefactoringStatus result = new RefactoringStatus(); - final boolean enableRiskyRefactoring = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, - PreferenceConstants.ENABLERISKYREFACTORING, false, null); - if (!enableRiskyRefactoring) { - try { - pm.beginTask("Checking preconditions...", 2); - // check that there are no ttcnpp files in the - // project - if (hasTtcnppFiles(file.getProject())) { - result.addError(PROJECTCONTAINSTTCNPPFILES); - } - pm.worked(1); - // check that there are no error markers in the - // project - IMarker[] markers = file.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE); - for (IMarker marker : markers) { - if (IMarker.SEVERITY_ERROR == marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR)) { - result.addError(PROJECTCONTAINSERRORS); - break; - } + try { + pm.beginTask("Checking preconditions...", 3); + // check that there are no ttcnpp files in the + // project + if (hasTtcnppFiles(file.getProject())) {//FIXME actually all referencing and referenced projects need to be checked too ! + result.addError(MessageFormat.format(PROJECTCONTAINSTTCNPPFILES, file.getProject())); + } + pm.worked(1); + // check that there are no error markers in the + // project + IMarker[] markers = file.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE); + for (IMarker marker : markers) { + if (IMarker.SEVERITY_ERROR == marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR)) { + result.addError(MessageFormat.format(PROJECTCONTAINSERRORS, file.getProject())); + break; } - pm.worked(1); - } catch (CoreException e) { - ErrorReporter.logExceptionStackTrace(e); - result.addFatalError(e.getMessage()); - } finally { - pm.done(); } + pm.worked(1); + + final IPreferencesService prefs = Platform.getPreferencesService(); + if (prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.MINIMISEMEMORYUSAGE, false, null)) { + result.addError(MINIMISEWARNING); + } + pm.worked(1); + } catch (CoreException e) { + ErrorReporter.logExceptionStackTrace(e); + result.addFatalError(e.getMessage()); + } finally { + pm.done(); } return result; } @@ -172,12 +171,13 @@ public class RenameRefactoring extends Refactoring { idsMap = rf.findAllReferences(module, projectSourceParser, pm, reportDebugInformation); // add the referred identifier to the map of found identifiers Identifier refdIdentifier = rf.getReferredIdentifier(); - if (idsMap.containsKey(module)) { - idsMap.get(module).add(new Hit(refdIdentifier)); + Module refdModule = rf.assignment.getMyScope().getModuleScope(); + if (idsMap.containsKey(refdModule)) { + idsMap.get(refdModule).add(new Hit(refdIdentifier)); } else { ArrayList<Hit> identifierList = new ArrayList<Hit>(); identifierList.add(new Hit(refdIdentifier)); - idsMap.put(module, identifierList); + idsMap.put(refdModule, identifierList); } // check if there are name collisions in any of the affected @@ -333,21 +333,6 @@ public class RenameRefactoring extends Refactoring { return; } - final boolean[] memoryUsageAnswer = new boolean[] { false }; - - if (Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.MINIMISEMEMORYUSAGE, false, - null)) { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - memoryUsageAnswer[0] = MessageDialog.openQuestion(new Shell(Display.getDefault()), "Warning", MINIMISEWARNING); - } - }); - if (!memoryUsageAnswer[0]) { - return; - } - } - final IPreferencesService prefs = Platform.getPreferencesService(); final boolean reportDebugInformation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null); @@ -413,6 +398,7 @@ public class RenameRefactoring extends Refactoring { } catch (InterruptedException irex) { // operation was canceled } finally { + //TODO no longer needed after analyzer is updated projectSourceParser.reportOutdating(file); projectSourceParser.analyzeAll(); } @@ -431,6 +417,7 @@ public class RenameRefactoring extends Refactoring { protected static ReferenceFinder findOccurrencesLocationBased(final Module module, final int offset) { final IdentifierFinderVisitor visitor = new IdentifierFinderVisitor(offset); module.accept(visitor); + //FIXME the thing to be refactored might be a field ... not a definition final Declaration def = visitor.getReferencedDeclaration(); if (def == null || !def.shouldMarkOccurrences()) { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/GUIProjectImporter.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/GUIProjectImporter.java index 3633ac49751701f7f12bc3a35ee877397e001c04..71f6579ca8f93a72f88d1810cbb466c489ce456e 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/GUIProjectImporter.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/GUIProjectImporter.java @@ -785,7 +785,7 @@ public final class GUIProjectImporter { File file = new File(path); if (!file.exists()) { - reportError("Could not load the group file `" + path + "' refered by `" + basePath + "' as `" + reportError("Could not load the group file `" + path + "' referred by `" + basePath + "' as `" + pathAttribute.getTextContent() + "'", headless); return; } diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/NewTITANProjectWizard.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/NewTITANProjectWizard.java index 3561c16bc42c3449891e6718dde59d4b1d9d4d07..8b642f21ebb76dca27d3348ac5e983a3066ec904 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/NewTITANProjectWizard.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/NewTITANProjectWizard.java @@ -28,16 +28,12 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.core.runtime.URIUtil; import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; -import org.eclipse.titan.common.path.TITANPathUtilities; import org.eclipse.titan.designer.Activator; import org.eclipse.titan.designer.GeneralConstants; import org.eclipse.titan.designer.core.TITANNature; @@ -320,8 +316,7 @@ public final class NewTITANProjectWizard extends BasicNewResourceWizard implemen Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - Shell shell = new Shell(Display.getDefault()); - PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(shell, newProject, + PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(null, newProject, GeneralConstants.PROJECT_PROPERTY_PAGE, null, null); if (dialog != null) { dialog.open(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportMainPage.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportMainPage.java index aef677e406dac0111ad7eb23fd7d1ef60be6f81f..4937549801c996f47c18a39e2139e3166a67d786 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportMainPage.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportMainPage.java @@ -23,10 +23,8 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.path.PathConverter; @@ -128,7 +126,7 @@ public class TITANProjectImportMainPage extends WizardPage { protected void handleProjectFileModified() { projectFile = projectFileText.getText(); try { - new ProgressMonitorDialog(new Shell(Display.getDefault())).run(true, false, new IRunnableWithProgress() { + new ProgressMonitorDialog(null).run(true, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportWizard.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportWizard.java index 8aa862d710fabb2310afe1acac0f3df5e0a8251f..0eb002ae20b4823fbe044e946096133145bc5055 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportWizard.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectImportWizard.java @@ -24,7 +24,6 @@ import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.Activator; import org.eclipse.titan.designer.GeneralConstants; @@ -216,8 +215,7 @@ public class TITANProjectImportWizard extends BasicNewResourceWizard implements Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - Shell shell = new Shell(Display.getDefault()); - PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(shell, newProject, + PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(null, newProject, GeneralConstants.PROJECT_PROPERTY_PAGE, null, null); if (dialog != null) { dialog.open(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/NewTITANProjectImportWizard.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/NewTITANProjectImportWizard.java index 77514cfa038a8a58a6080e47486284d27b8f995f..ff1a1dbfc4bd22bc48f8846fc0688ecd32a26bd1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/NewTITANProjectImportWizard.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/NewTITANProjectImportWizard.java @@ -17,8 +17,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.ui.IImportWizard; import org.eclipse.ui.IWorkbench; @@ -58,7 +56,7 @@ public class NewTITANProjectImportWizard extends BasicNewResourceWizard implemen public boolean performFinish() { final List<IProject> projectsCreated = new ArrayList<IProject>(); try { - new ProgressMonitorDialog(new Shell(Display.getDefault())).run(true, false, new IRunnableWithProgress() { + new ProgressMonitorDialog(null).run(true, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/TpdImporter.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/TpdImporter.java index b97f013c913881d9070e4b8defa139ef25ace908..d0932d8fe07fe487d27a8b3a5cb5174cf5da30f1 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/TpdImporter.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/projectFormat/TpdImporter.java @@ -300,8 +300,7 @@ public class TpdImporter { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - Shell shell = new Shell(Display.getDefault()); - PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(shell, project, + PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(null, project, GeneralConstants.PROJECT_PROPERTY_PAGE, null, null); if (dialog != null) { dialog.open(); @@ -583,7 +582,7 @@ public class TpdImporter { + " the location information is missing or corrupted"); } } catch (CoreException e) { - ErrorReporter.logExceptionStackTrace("While creating folder `" + folder.getName() + "'", e); + //be silent, it can happen normally } } else { ErrorReporter.logWarning("Folder to be imported `" + folder.getName() + "' already exists in project `" + project.getName() @@ -787,9 +786,7 @@ public class TpdImporter { // Remove possible target configuration nodes in existence removeConfigurationNodes(targetDocument.getDocumentElement()); - - Node configurationsNode = ProjectFileHandler.getNodebyName(mainNodes, ProjectFormatConstants.CONFIGURATIONS_NODE); - NodeList configurationsNodeList = configurationsNode.getChildNodes(); + Node targetActiveConfiguration = targetDocument.createElement(ProjectFormatConstants.ACTIVE_CONFIGURATION_NODE); targetActiveConfiguration.appendChild(targetDocument.createTextNode(activeConfiguration)); @@ -798,6 +795,17 @@ public class TpdImporter { Node targetConfigurationsRoot = targetDocument.createElement(ProjectFormatConstants.CONFIGURATIONS_NODE); targetDocument.getDocumentElement().appendChild(targetConfigurationsRoot); + Node configurationsNode = ProjectFileHandler.getNodebyName(mainNodes, ProjectFormatConstants.CONFIGURATIONS_NODE); + if (configurationsNode == null) { + ProjectDocumentHandlingUtility.saveDocument(project); + ProjectBuildPropertyData.setProjectAlreadyExported(project, false); + ProjectFileHandler handler = new ProjectFileHandler(project); + handler.loadProjectSettingsFromDocument(targetDocument); + + return true; + } + + NodeList configurationsNodeList = configurationsNode.getChildNodes(); for (int i = 0, size = configurationsNodeList.getLength(); i < size; i++) { Node configurationNode = configurationsNodeList.item(i); if (configurationNode.getNodeType() != Node.ELEMENT_NODE) { @@ -1078,7 +1086,8 @@ public class TpdImporter { String unresolvedProjectLocationURI = locationNode.getTextContent(); URI absoluteURI = TITANPathUtilities.convertToAbsoluteURI(unresolvedProjectLocationURI, URIUtil.toURI(projectFileFolderPath)); - + + if (absoluteURI!=null && !"file".equals(absoluteURI.getScheme())) { final StringBuilder builder = new StringBuilder( "Loading of project information is only supported for local files right now. " + absoluteURI.toString() @@ -1175,7 +1184,7 @@ public class TpdImporter { createProject(description, newProjectHandle, monitor); } }; - new ProgressMonitorDialog(new Shell(Display.getDefault())).run(true, true, op); + new ProgressMonitorDialog(null).run(true, true, op); } catch (InterruptedException e) { return; } catch (final InvocationTargetException e) { diff --git a/org.eclipse.titan.executor/META-INF/MANIFEST.MF b/org.eclipse.titan.executor/META-INF/MANIFEST.MF index 767f645e7eee8b95f9200e07e752c1f6d36eefb2..0c47f8f168bb33a3630e0588174f71e19b13c2f3 100755 --- a/org.eclipse.titan.executor/META-INF/MANIFEST.MF +++ b/org.eclipse.titan.executor/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Created-By: 23.6-b04 (Oracle Corporation) Bundle-ManifestVersion: 2 Bundle-Name: TITAN_Executor Plug-in Bundle-SymbolicName: org.eclipse.titan.executor;singleton:=true -Bundle-Version: 5.4.2.CRL_113_200_5_R4C_20160105-1100 +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 Bundle-Activator: org.eclipse.titan.executor.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.variables, org.eclipse.debug.ui, org.eclipse.core.expressions, - org.eclipse.titan.common;bundle-version="5.4.1" + org.eclipse.titan.common;bundle-version="5.4.3" Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true Bundle-Vendor: Eclipse Titan Project diff --git a/org.eclipse.titan.executor/plugin.xml b/org.eclipse.titan.executor/plugin.xml index dc4439ac32b48d8bc702953cb09fa8abd43c2b6a..e72b397495b4b06eba3e373b1f0ce0a7dde87cc1 100644 --- a/org.eclipse.titan.executor/plugin.xml +++ b/org.eclipse.titan.executor/plugin.xml @@ -1,333 +1,303 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html --> -<?eclipse version="3.2"?> +<?eclipse version="4.4"?> <plugin> - <extension point="org.eclipse.core.expressions.propertyTesters"> - <propertyTester - class="org.eclipse.titan.executor.property.testers.CompilationModeProperty" - id="org.eclipse.titan.executor.property.testers.CompilationModeProperty" - namespace="org.eclipse.titan.executor.propertyTesters" - properties="SingleModeBuild, ParallelModeBuild" - type="org.eclipse.core.resources.IResource"> - </propertyTester> - </extension> - <extension - point="org.eclipse.debug.core.launchConfigurationTypes"> - <launchConfigurationType - name="TITAN Parallel launcher" - delegate="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" - modes="run" - id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate"> - </launchConfigurationType> - <launchConfigurationType - name="TITAN Single Mode launcher" - delegate="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" - modes="run" - id="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate"> - </launchConfigurationType> - <launchConfigurationType - name="TITAN JNI launcher" - delegate="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" - modes="run" - id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate"> - </launchConfigurationType> - </extension> - <extension - point="org.eclipse.debug.ui.launchShortcuts"> - <shortcut - class="org.eclipse.titan.executor.executors.single.LaunchShortcut" - id="org.eclipse.titan.executor.executors.single.LaunchShortcut" - label="TITAN Single Mode launcher" - icon="icons/launch_single.gif" - description="Launch an execution in single mode" - modes="run"> - <description - description="Runs a local TITAN application" - mode="run"> - </description> - <contextualLaunch> - <enablement> - <with variable="selection"> - <count value="1"/> - <iterate> - <instanceof value="org.eclipse.core.resources.IProject"/> - <test - value="org.eclipse.titan.designer.core.TITANNature" - property="org.eclipse.core.resources.projectNature"/> - <test property="org.eclipse.titan.executor.propertyTesters.SingleModeBuild" forcePluginActivation="true"/> - </iterate> - </with> - </enablement> - </contextualLaunch> - <configurationType id="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" /> - </shortcut> - <shortcut - class="org.eclipse.titan.executor.executors.single.LaunchShortcutConfig" - description="Launch an execution in single mode" - icon="icons/launch_single.gif" - id="org.eclipse.titan.executor.executors.single.LaunchShortcutConfig" - label="TITAN Single Mode launcher" - modes="run"> - <description - description="Runs a local TITAN application" - mode="run"> - </description> - <contextualLaunch> - <enablement> - <with variable="selection"> - <count value="1"> - </count> - <iterate operator="and"> - <instanceof value="org.eclipse.core.resources.IFile"> - </instanceof> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"/> - <test property="org.eclipse.core.resources.extension" value="cfg"/> - <test property="org.eclipse.titan.executor.propertyTesters.SingleModeBuild" forcePluginActivation="true"/> - </iterate> - </with> - </enablement> - </contextualLaunch> - <configurationType - id="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate"> - </configurationType> - </shortcut> - <shortcut - class="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcut" - id="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcut" - label="TITAN Parallel launcher" - icon="icons/launch_cli.gif" - description="Launch an execution in mctr_cli mode" - modes="run"> - <description - description="Runs a local TITAN application" - mode="run"> - </description> - <contextualLaunch> - <enablement> - <with variable="selection"> - <count value="1"/> - <iterate> - <instanceof value="org.eclipse.core.resources.IProject"/> - <test - value="org.eclipse.titan.designer.core.TITANNature" - property="org.eclipse.core.resources.projectNature"/> - <test property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" forcePluginActivation="true"/> - </iterate> - </with> - </enablement> - </contextualLaunch> - <configurationType id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" /> - </shortcut> - <shortcut - class="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcutConfig" - description="Launch an execution in mctr_cli mode" - icon="icons/launch_cli.gif" - id="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcutConfig" - label="TITAN Parallel launcher" - modes="run"> - <description - description="Runs a local TITAN application" - mode="run"> - </description> - <contextualLaunch> - <enablement> - <with variable="selection"> - <count value="1"> - </count> - <iterate operator="and"> - <instanceof value="org.eclipse.core.resources.IFile"> - </instanceof> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"/> - <test property="org.eclipse.core.resources.extension" value="cfg"/> - <test property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" forcePluginActivation="true"/> - </iterate> - </with> - </enablement> - </contextualLaunch> - <configurationType - id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate"> - </configurationType> - </shortcut> - <shortcut - class="org.eclipse.titan.executor.executors.jni.LaunchShortcut" - id="org.eclipse.titan.executor.executors.jni.LaunchShortcut" - label="TITAN JNI launcher" - icon="icons/launch_jni.gif" - description="Launch an execution in jni mode" - modes="run"> - <description - description="Runs a local TITAN application" - mode="run"> - </description> - <contextualLaunch> - <enablement> - <with variable="selection"> - <count value="1"/> - <iterate> - <instanceof value="org.eclipse.core.resources.IProject"/> - <test - value="org.eclipse.titan.designer.core.TITANNature" - property="org.eclipse.core.resources.projectNature"/> - <test property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" forcePluginActivation="true"/> - </iterate> - </with> - </enablement> - </contextualLaunch> - <configurationType id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" /> - </shortcut> - <shortcut - class="org.eclipse.titan.executor.executors.jni.LaunchShortcutConfig" - description="Launch an execution in jni mode" - icon="icons/launch_jni.gif" - id="org.eclipse.titan.executor.executors.jni.LaunchShortcutConfig" - label="TITAN JNI launcher" - modes="run"> - <description - description="Runs a local TITAN application" - mode="run"> - </description> - <contextualLaunch> - <enablement> - <with variable="selection"> - <count value="1"> - </count> - <iterate operator="and"> - <instanceof value="org.eclipse.core.resources.IFile"> - </instanceof> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"/> - <test property="org.eclipse.core.resources.extension" value="cfg"/> - <test property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" forcePluginActivation="true"/> - </iterate> - </with> - </enablement> - </contextualLaunch> - <configurationType - id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate"> - </configurationType> - </shortcut> - </extension> - <extension - point="org.eclipse.debug.ui.launchConfigurationTypeImages"> - <launchConfigurationTypeImage - icon="icons/launch_cli.gif" - configTypeID="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" - id="org.eclipse.titan.executor.executors.mctr.cli.uniquetypeImage"> - </launchConfigurationTypeImage> - <launchConfigurationTypeImage - icon="icons/launch_single.gif" - configTypeID="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" - id="org.eclipse.titan.executor.executors.single.uniquetypeImage"> - </launchConfigurationTypeImage> - <launchConfigurationTypeImage - icon="icons/launch_jni.gif" - configTypeID="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" - id="org.eclipse.titan.executor.executors.jni.uniquetypeImage"> - </launchConfigurationTypeImage> - </extension> - <extension - point="org.eclipse.debug.ui.launchConfigurationTabGroups"> - <launchConfigurationTabGroup - type="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" - class="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationTabGroup" - id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationTabGroup"> - <launchMode - mode="run" - perspective="org.eclipse.titan.executor.perspectives.ExecutingPerspective"> - </launchMode> - </launchConfigurationTabGroup> - <launchConfigurationTabGroup - type="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" - class="org.eclipse.titan.executor.executors.single.LaunchConfigurationTabGroup" - id="org.eclipse.titan.executor.executors.single.LaunchConfigurationTabGroup"> - <launchMode - mode="run" - perspective="org.eclipse.titan.executor.perspectives.ExecutingPerspective"> - </launchMode> - </launchConfigurationTabGroup> - <launchConfigurationTabGroup - type="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" - class="org.eclipse.titan.executor.executors.jni.LaunchConfigurationTabGroup" - id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationTabGroup"> - <launchMode - mode="run" - perspective="org.eclipse.titan.executor.perspectives.ExecutingPerspective"> - </launchMode> - </launchConfigurationTabGroup> - </extension> - <extension - point="org.eclipse.ui.views"> - <category - id="TITAN Monitor Category" - name="TITAN Monitors"> - </category> - <view - id="org.eclipse.titan.executor.views.executorMonitor.ExecutorMonitorView" - name="TITAN Execution Controller" - category="TITAN Monitor Category" - class="org.eclipse.titan.executor.views.executormonitor.ExecutorMonitorView" - icon="icons/titan.gif"> - </view> - <view - id="org.eclipse.titan.executor.views.testExecution.TestExecutionView" - name="TITAN test results" - category="TITAN Monitor Category" - class="org.eclipse.titan.executor.views.testexecution.TestExecutionView" - icon="icons/titan.gif"> - </view> - <view - id="org.eclipse.titan.executor.views.notification.NotificationView" - name="TITAN notifications" - category="TITAN Monitor Category" - class="org.eclipse.titan.executor.views.notification.NotificationView" - icon="icons/titan.gif"> - </view> - </extension> - <extension - point="org.eclipse.ui.perspectives"> - <perspective - class="org.eclipse.titan.executor.perspectives.ExecutingPerspective" - icon="icons/titan.gif" - id="org.eclipse.titan.executor.perspectives.ExecutingPerspective" - name="TITAN Executing"/> - </extension> - <extension point="org.eclipse.help.toc"> - <toc file="toc.xml" primary="false"/> - </extension> - <extension point="org.eclipse.core.runtime.preferences"> - <initializer class="org.eclipse.titan.executor.preferences.PreferenceInitializer"/> - </extension> - <extension point="org.eclipse.ui.preferencePages"> - <page - id="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" - class="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" - name="TITAN Executor"/> - </extension> - <extension - point="org.eclipse.ui.propertyPages"> - <page - class="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" - id="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" - name="TITAN Executor"> - <filter - name="projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </filter> - <enabledWhen> - <instanceof value="org.eclipse.core.resources.IProject" /> - </enabledWhen> - </page> - </extension> + <extension point="org.eclipse.core.expressions.propertyTesters"> + <propertyTester + class="org.eclipse.titan.executor.property.testers.CompilationModeProperty" + id="org.eclipse.titan.executor.property.testers.CompilationModeProperty" + namespace="org.eclipse.titan.executor.propertyTesters" properties="SingleModeBuild, ParallelModeBuild" + type="org.eclipse.core.resources.IResource"> + </propertyTester> + </extension> + <extension point="org.eclipse.debug.core.launchConfigurationTypes"> + <launchConfigurationType name="TITAN Parallel launcher" + delegate="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" + modes="run" + id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate"> + </launchConfigurationType> + <launchConfigurationType name="TITAN Single Mode launcher" + delegate="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" + modes="run" + id="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate"> + </launchConfigurationType> + <launchConfigurationType name="TITAN JNI launcher" + delegate="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" + modes="run" + id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate"> + </launchConfigurationType> + </extension> + <extension point="org.eclipse.debug.ui.launchShortcuts"> + <shortcut + class="org.eclipse.titan.executor.executors.single.LaunchShortcut" + id="org.eclipse.titan.executor.executors.single.LaunchShortcut" + label="TITAN Single Mode launcher" icon="icons/launch_single.gif" + description="Launch an execution in single mode" modes="run"> + <description description="Runs a local TITAN application" + mode="run"> + </description> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1" /> + <iterate> + <instanceof value="org.eclipse.core.resources.IProject" /> + <test value="org.eclipse.titan.designer.core.TITANNature" + property="org.eclipse.core.resources.projectNature" /> + <test + property="org.eclipse.titan.executor.propertyTesters.SingleModeBuild" + forcePluginActivation="true" /> + </iterate> + </with> + </enablement> + </contextualLaunch> + <configurationType + id="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" /> + </shortcut> + <shortcut + class="org.eclipse.titan.executor.executors.single.LaunchShortcutConfig" + description="Launch an execution in single mode" icon="icons/launch_single.gif" + id="org.eclipse.titan.executor.executors.single.LaunchShortcutConfig" + label="TITAN Single Mode launcher" modes="run"> + <description description="Runs a local TITAN application" + mode="run"> + </description> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1"> + </count> + <iterate operator="and"> + <instanceof value="org.eclipse.core.resources.IFile"> + </instanceof> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature" /> + <test property="org.eclipse.core.resources.extension" + value="cfg" /> + <test + property="org.eclipse.titan.executor.propertyTesters.SingleModeBuild" + forcePluginActivation="true" /> + </iterate> + </with> + </enablement> + </contextualLaunch> + <configurationType + id="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate"> + </configurationType> + </shortcut> + <shortcut + class="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcut" + id="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcut" + label="TITAN Parallel launcher" icon="icons/launch_cli.gif" + description="Launch an execution in mctr_cli mode" modes="run"> + <description description="Runs a local TITAN application" + mode="run"> + </description> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1" /> + <iterate> + <instanceof value="org.eclipse.core.resources.IProject" /> + <test value="org.eclipse.titan.designer.core.TITANNature" + property="org.eclipse.core.resources.projectNature" /> + <test + property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" + forcePluginActivation="true" /> + </iterate> + </with> + </enablement> + </contextualLaunch> + <configurationType + id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" /> + </shortcut> + <shortcut + class="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcutConfig" + description="Launch an execution in mctr_cli mode" icon="icons/launch_cli.gif" + id="org.eclipse.titan.executor.executors.mctr.cli.LaunchShortcutConfig" + label="TITAN Parallel launcher" modes="run"> + <description description="Runs a local TITAN application" + mode="run"> + </description> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1"> + </count> + <iterate operator="and"> + <instanceof value="org.eclipse.core.resources.IFile"> + </instanceof> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature" /> + <test property="org.eclipse.core.resources.extension" + value="cfg" /> + <test + property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" + forcePluginActivation="true" /> + </iterate> + </with> + </enablement> + </contextualLaunch> + <configurationType + id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate"> + </configurationType> + </shortcut> + <shortcut class="org.eclipse.titan.executor.executors.jni.LaunchShortcut" + id="org.eclipse.titan.executor.executors.jni.LaunchShortcut" + label="TITAN JNI launcher" icon="icons/launch_jni.gif" + description="Launch an execution in jni mode" modes="run"> + <description description="Runs a local TITAN application" + mode="run"> + </description> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1" /> + <iterate> + <instanceof value="org.eclipse.core.resources.IProject" /> + <test value="org.eclipse.titan.designer.core.TITANNature" + property="org.eclipse.core.resources.projectNature" /> + <test + property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" + forcePluginActivation="true" /> + </iterate> + </with> + </enablement> + </contextualLaunch> + <configurationType + id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" /> + </shortcut> + <shortcut + class="org.eclipse.titan.executor.executors.jni.LaunchShortcutConfig" + description="Launch an execution in jni mode" icon="icons/launch_jni.gif" + id="org.eclipse.titan.executor.executors.jni.LaunchShortcutConfig" + label="TITAN JNI launcher" modes="run"> + <description description="Runs a local TITAN application" + mode="run"> + </description> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1"> + </count> + <iterate operator="and"> + <instanceof value="org.eclipse.core.resources.IFile"> + </instanceof> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature" /> + <test property="org.eclipse.core.resources.extension" + value="cfg" /> + <test + property="org.eclipse.titan.executor.propertyTesters.ParallelModeBuild" + forcePluginActivation="true" /> + </iterate> + </with> + </enablement> + </contextualLaunch> + <configurationType + id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate"> + </configurationType> + </shortcut> + </extension> + <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"> + <launchConfigurationTypeImage icon="icons/launch_cli.gif" + configTypeID="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" + id="org.eclipse.titan.executor.executors.mctr.cli.uniquetypeImage"> + </launchConfigurationTypeImage> + <launchConfigurationTypeImage icon="icons/launch_single.gif" + configTypeID="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" + id="org.eclipse.titan.executor.executors.single.uniquetypeImage"> + </launchConfigurationTypeImage> + <launchConfigurationTypeImage icon="icons/launch_jni.gif" + configTypeID="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" + id="org.eclipse.titan.executor.executors.jni.uniquetypeImage"> + </launchConfigurationTypeImage> + </extension> + <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"> + <launchConfigurationTabGroup + type="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate" + class="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationTabGroup" + id="org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationTabGroup"> + <launchMode mode="run" + perspective="org.eclipse.titan.executor.perspectives.ExecutingPerspective"> + </launchMode> + </launchConfigurationTabGroup> + <launchConfigurationTabGroup + type="org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate" + class="org.eclipse.titan.executor.executors.single.LaunchConfigurationTabGroup" + id="org.eclipse.titan.executor.executors.single.LaunchConfigurationTabGroup"> + <launchMode mode="run" + perspective="org.eclipse.titan.executor.perspectives.ExecutingPerspective"> + </launchMode> + </launchConfigurationTabGroup> + <launchConfigurationTabGroup + type="org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate" + class="org.eclipse.titan.executor.executors.jni.LaunchConfigurationTabGroup" + id="org.eclipse.titan.executor.executors.jni.LaunchConfigurationTabGroup"> + <launchMode mode="run" + perspective="org.eclipse.titan.executor.perspectives.ExecutingPerspective"> + </launchMode> + </launchConfigurationTabGroup> + </extension> + <extension point="org.eclipse.ui.views"> + <category id="TITAN Monitor Category" name="TITAN Monitors"> + </category> + <view + id="org.eclipse.titan.executor.views.executorMonitor.ExecutorMonitorView" + name="TITAN Execution Controller" category="TITAN Monitor Category" + class="org.eclipse.titan.executor.views.executormonitor.ExecutorMonitorView" + icon="icons/titan.gif"> + </view> + <view + id="org.eclipse.titan.executor.views.testExecution.TestExecutionView" + name="TITAN test results" category="TITAN Monitor Category" + class="org.eclipse.titan.executor.views.testexecution.TestExecutionView" + icon="icons/titan.gif"> + </view> + <view + id="org.eclipse.titan.executor.views.notification.NotificationView" + name="TITAN notifications" category="TITAN Monitor Category" + class="org.eclipse.titan.executor.views.notification.NotificationView" + icon="icons/titan.gif"> + </view> + </extension> + <extension point="org.eclipse.ui.perspectives"> + <perspective + class="org.eclipse.titan.executor.perspectives.ExecutingPerspective" + icon="icons/titan.gif" + id="org.eclipse.titan.executor.perspectives.ExecutingPerspective" + name="TITAN Executing" /> + </extension> + <extension point="org.eclipse.help.toc"> + <toc file="toc.xml" primary="false" /> + </extension> + <extension point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.titan.executor.preferences.PreferenceInitializer" /> + </extension> + <extension point="org.eclipse.ui.preferencePages"> + <page + id="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" + class="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" + name="TITAN Executor" /> + </extension> + <extension point="org.eclipse.ui.propertyPages"> + <page + class="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" + id="org.eclipse.titan.executor.preferences.ExecutorPreferencePage" + name="TITAN Executor"> + <filter name="projectNature" value="org.eclipse.titan.designer.core.TITANNature"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject" /> + </enabledWhen> + </page> + </extension> </plugin> diff --git a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcut.java b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcut.java index 208a472d6b3295edb53e82edba7c86d3a85a94a7..dcec34b84d4646d71bc70d19e8aa178ac3f015f1 100644 --- a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcut.java +++ b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcut.java @@ -7,6 +7,11 @@ ******************************************************************************/ package org.eclipse.titan.executor.executors; +import static org.eclipse.titan.executor.GeneralConstants.EXECUTECONFIGFILEONLAUNCH; + +import java.util.ArrayList; +import java.util.List; + import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; @@ -20,18 +25,11 @@ import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.executor.tabpages.hostcontrollers.HostControllersTab; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import java.util.ArrayList; -import java.util.List; - -import static org.eclipse.titan.executor.GeneralConstants.EXECUTECONFIGFILEONLAUNCH; - //FIXME comment /** * @author Kristof Szabados @@ -90,7 +88,7 @@ public abstract class LaunchShortcut implements ILaunchShortcut { return null; } else if (candidateConfigurations.size() > 1) { ILabelProvider labelProvider = DebugUITools.newDebugModelPresentation(); - ElementListSelectionDialog dialog = new ElementListSelectionDialog(new Shell(Display.getDefault()), labelProvider); + ElementListSelectionDialog dialog = new ElementListSelectionDialog(null, labelProvider); dialog.setTitle(getDialogTitle()); dialog.setMessage("Select existing configuration."); dialog.setElements(candidateConfigurations.toArray(new ILaunchConfiguration[candidateConfigurations.size()])); diff --git a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcutConfig.java b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcutConfig.java index be26238d23c901792e9a8723a36008a4c7e0fad8..527a97e1233bf3cf170aaaecabacd8e98e8e94f7 100644 --- a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcutConfig.java +++ b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/LaunchShortcutConfig.java @@ -7,6 +7,11 @@ ******************************************************************************/ package org.eclipse.titan.executor.executors; +import static org.eclipse.titan.executor.GeneralConstants.EXECUTECONFIGFILEONLAUNCH; + +import java.util.ArrayList; +import java.util.List; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; @@ -21,18 +26,11 @@ import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.executor.tabpages.hostcontrollers.HostControllersTab; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import java.util.ArrayList; -import java.util.List; - -import static org.eclipse.titan.executor.GeneralConstants.EXECUTECONFIGFILEONLAUNCH; - /** * @author Kristof Szabados * */ @@ -92,7 +90,7 @@ public abstract class LaunchShortcutConfig implements ILaunchShortcut { return null; } else if (candidateConfigurations.size() > 1) { final ILabelProvider labelProvider = DebugUITools.newDebugModelPresentation(); - final ElementListSelectionDialog dialog = new ElementListSelectionDialog(new Shell(Display.getDefault()), labelProvider); + final ElementListSelectionDialog dialog = new ElementListSelectionDialog(null, labelProvider); dialog.setTitle(getDialogTitle()); dialog.setMessage("Select existing configuration."); dialog.setElements(candidateConfigurations.toArray(new ILaunchConfiguration[candidateConfigurations.size()])); diff --git a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/JniExecutor.java b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/JniExecutor.java index 009e90a005208d16743ce6761c6a57034daae207..155f45bfd0b90a9b308047c9ba7f7d659b5a0002 100644 --- a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/JniExecutor.java +++ b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/JniExecutor.java @@ -27,10 +27,8 @@ import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.window.Window; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.parsers.cfg.CfgLexer; import org.eclipse.titan.common.parsers.cfg.ConfigFileHandler; @@ -668,7 +666,7 @@ public final class JniExecutor extends BaseExecutor implements IJNICallback { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - ExecuteDialog dialog = new ExecuteDialog(new Shell(Display.getDefault())); + ExecuteDialog dialog = new ExecuteDialog(null); dialog.setControlparts(availableControlParts); dialog.setTestcases(availableTestcases); dialog.setTestsets(availableTestSetNames); diff --git a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/LaunchConfigurationDelegate.java b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/LaunchConfigurationDelegate.java index 00c6554ea8d3e5278de56de2e934e3a6eba89a75..288655d24f65a94b2166f32175e9015974945e14 100644 --- a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/LaunchConfigurationDelegate.java +++ b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/jni/LaunchConfigurationDelegate.java @@ -24,8 +24,8 @@ import org.eclipse.titan.executor.jni.JNIMiddleWare; public final class LaunchConfigurationDelegate extends TitanLaunchConfigurationDelegate { /** { ttcn3_major, ttcn3_minor, ttcn3_patchlevel, ttcn3_buildnumber } */ - private final ProductIdentity versionLow = ProductIdentity.getProductIdentity(ProductIdentity.TITAN_PRODUCT_NUMBER, 5, 4, 2, 0); - private final ProductIdentity versionHigh = ProductIdentity.getProductIdentity(ProductIdentity.TITAN_PRODUCT_NUMBER, 5, 4, 2, 0); + private final ProductIdentity versionLow = ProductIdentity.getProductIdentity(ProductIdentity.TITAN_PRODUCT_NUMBER, 5, 4, 3, 0); + private final ProductIdentity versionHigh = ProductIdentity.getProductIdentity(ProductIdentity.TITAN_PRODUCT_NUMBER, 5, 4, 3, 0); @Override public void launch(final ILaunchConfiguration arg0, final String arg1, final ILaunch arg2, final IProgressMonitor arg3) throws CoreException { diff --git a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/mctr/cli/CliExecutor.java b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/mctr/cli/CliExecutor.java index 60c5984595da448a260462a664d59af2e87e05ce..c5c071b127f8d5ef93770bbe0e11a1547ccb0507 100644 --- a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/mctr/cli/CliExecutor.java +++ b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/mctr/cli/CliExecutor.java @@ -7,6 +7,22 @@ ******************************************************************************/ package org.eclipse.titan.executor.executors.mctr.cli; +import static org.eclipse.titan.executor.GeneralConstants.MCSTATEREFRESHTIMEOUT; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Date; +import java.util.Formatter; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -24,7 +40,6 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.window.Window; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.parsers.cfg.ConfigFileHandler; import org.eclipse.titan.common.path.PathConverter; @@ -48,22 +63,6 @@ import org.eclipse.titan.executor.views.testexecution.ExecutedTestcase; import org.eclipse.titan.executor.views.testexecution.TestExecutionView; import org.eclipse.ui.console.MessageConsoleStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.Date; -import java.util.Formatter; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.eclipse.titan.executor.GeneralConstants.MCSTATEREFRESHTIMEOUT; - /** * This executor handles the execution of tests compiled in a parallel mode, connecting to the MainController via command line. * @@ -288,7 +287,7 @@ public final class CliExecutor extends BaseExecutor { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), + MessageDialog.openError(null, "Execution failed", "The working directory `" + workingdirectoryPath + "' does not exist."); } @@ -482,7 +481,7 @@ public final class CliExecutor extends BaseExecutor { public void run() { boolean invalidSelection = false; do { - ExecuteDialog dialog = new ExecuteDialog(new Shell(Display.getDefault())); + ExecuteDialog dialog = new ExecuteDialog(null); dialog.setControlparts(availableControlParts); dialog.setTestcases(availableTestcases); dialog.setTestsets(availableTestSetNames); diff --git a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/single/SingleExecutor.java b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/single/SingleExecutor.java index 4a90a7b8488a6e81e4d49b7ea6af2398e45fc77f..8e60b92f33322dc36a1d0c99bb5206d7e0f053f9 100644 --- a/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/single/SingleExecutor.java +++ b/org.eclipse.titan.executor/src/org/eclipse/titan/executor/executors/single/SingleExecutor.java @@ -38,7 +38,6 @@ import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.window.Window; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.parsers.cfg.CfgLexer; import org.eclipse.titan.common.parsers.cfg.ConfigFileHandler; @@ -139,7 +138,7 @@ public final class SingleExecutor extends BaseExecutor { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - ExecuteDialog dialog = new ExecuteDialog(new Shell(Display.getDefault())); + ExecuteDialog dialog = new ExecuteDialog(null); dialog.setControlparts(availableControlParts); dialog.setTestsets(availableTestSetNames); dialog.setTestcases(availableTestcases); @@ -292,7 +291,7 @@ public final class SingleExecutor extends BaseExecutor { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), "Execution failed", "The executable `" + executableFile + "' does not exist."); + MessageDialog.openError(null, "Execution failed", "The executable `" + executableFile + "' does not exist."); } }); } @@ -323,7 +322,7 @@ public final class SingleExecutor extends BaseExecutor { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), + MessageDialog.openError(null, "Execution failed", "The working directory `" + workingdirectoryPath + "' does not exist."); } }); diff --git a/org.eclipse.titan.help/META-INF/MANIFEST.MF b/org.eclipse.titan.help/META-INF/MANIFEST.MF index c7d6157a6b7cfae8de6ea47717339ef8bc925f41..98a30420c606cac1c3479e5e401c4d79eaa11d00 100755 --- a/org.eclipse.titan.help/META-INF/MANIFEST.MF +++ b/org.eclipse.titan.help/META-INF/MANIFEST.MF @@ -4,6 +4,6 @@ Created-By: 23.6-b04 (Oracle Corporation) Bundle-ManifestVersion: 2 Bundle-Name: TITAN_Help Plug-in Bundle-SymbolicName: org.eclipse.titan.help;singleton:=true -Bundle-Version: 5.4.2.CRL_113_200_5_R4C_20160105-1100 +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 Bundle-Vendor: Eclipse Titan Project diff --git a/org.eclipse.titan.log.viewer/META-INF/MANIFEST.MF b/org.eclipse.titan.log.viewer/META-INF/MANIFEST.MF index 9ab2f59d2539bd23b56204d50d314747d1462aa1..4f32b85921c31f0ed3e1a6ac5530f59de74fe318 100755 --- a/org.eclipse.titan.log.viewer/META-INF/MANIFEST.MF +++ b/org.eclipse.titan.log.viewer/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Created-By: 23.6-b04 (Oracle Corporation) Bundle-ManifestVersion: 2 Bundle-Name: TITAN Log Viewer Bundle-SymbolicName: org.eclipse.titan.log.viewer;singleton:=true -Bundle-Version: 5.4.2.CRL_113_200_5_R4C_20160105-1100 +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 Bundle-Activator: org.eclipse.titan.log.viewer.Activator Bundle-Vendor: Eclipse Titan Project Require-Bundle: org.eclipse.core.resources, @@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.core.resources, org.eclipse.jface.text, org.eclipse.ui.editors, org.eclipse.ui.workbench.texteditor, - org.eclipse.titan.common;bundle-version="5.4.2" + org.eclipse.titan.common;bundle-version="5.4.3" Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true Bundle-ClassPath: . diff --git a/org.eclipse.titan.log.viewer/org.eclipse.titan.log.viewer.iml b/org.eclipse.titan.log.viewer/org.eclipse.titan.log.viewer.iml index 80c7fa211af34e2e223092f8d9f4d79e63e6a50c..8b7409949880fc9ade6235f6796781ee01cd0c98 100644 --- a/org.eclipse.titan.log.viewer/org.eclipse.titan.log.viewer.iml +++ b/org.eclipse.titan.log.viewer/org.eclipse.titan.log.viewer.iml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 diff --git a/org.eclipse.titan.log.viewer/plugin.xml b/org.eclipse.titan.log.viewer/plugin.xml index 0ecd9e22cb47823418d95854b1f62507992cc2d6..daf5e1ad95e6726115217c0233abcaf91890d205 100644 --- a/org.eclipse.titan.log.viewer/plugin.xml +++ b/org.eclipse.titan.log.viewer/plugin.xml @@ -1,540 +1,520 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Copyright (c) 2000-2015 Ericsson Telecom AB - - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/legal/epl-v10.html - --> -<?eclipse version="3.2"?> -<plugin> - <extension - id="org.eclipse.titan.log.viewer.TitanLogProject" - name="Titan Log Viewer Project Nature" - point="org.eclipse.core.resources.natures"> - <runtime> - <run class="org.eclipse.titan.log.viewer.natures.TitanLogProject"/> - </runtime> - </extension> - <extension - point="org.eclipse.core.runtime.preferences"> - <initializer class="org.eclipse.titan.log.viewer.preferences.PreferenceInitializer"/> - </extension> - <extension - point="org.eclipse.ui.perspectives"> - <perspective - class="org.eclipse.titan.log.viewer.factories.PerspectiveFactory" - icon="icons/titan.gif" - id="org.eclipse.titan.log.viewer.factories.PerspectiveFactory" - name="TITAN Log Viewer"/> - </extension> - <extension - point="org.eclipse.help.toc"> - <toc - file="toc.xml" - primary="true"/> - </extension> - <extension - point="org.eclipse.ui.decorators"> - <decorator - adaptable="true" - class="org.eclipse.titan.log.viewer.views.navigator.FileSizeDecorator" - id="org.eclipse.titan.log.viewer.views.navigator.FileSizeDecorator" - label="TITAN Log Viewer file size decorator" - lightweight="true" - state="true"> - <enablement> - <objectClass name="org.eclipse.core.resources.IFile"/> - </enablement> - </decorator> - </extension> - <extension - point="org.eclipse.ui.preferencePages"> - <page - class="org.eclipse.titan.log.viewer.preferences.pages.GeneralSettingsPrefPage" - id="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - name="TITAN Log Viewer"> - </page> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.ComponentsVisualOrderPrefPage" - id="org.eclipse.titan.log.viewer.preferences.pages.VisualComponentsOrderPrefPage" - name="Components Visual Order"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredComponentsPrefPage" - id="org.eclipse.titan.log.viewer.preferences.pages.FilteredComponentsPrefPage" - name="Filtered Components"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSignalsPrefPage" - id="org.eclipse.titan.log.viewer.preferences.pages.FilteredSignalsPrefPage" - name="Filtered Signals"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredFunctionsPrefPage" - id="org.eclipse.titan.log.viewer.preferences.pages.FilteredFunctionsPrefPage" - name="Filtered Functions"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSilentEventPrefPage" - id="org.eclipse.titan.log.viewer.preferences.pages.FilteredSilentEventsPage" - name="Filtered Silent Events"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.HighlightKeywordsPage" - id="org.eclipse.titan.log.viewer.preferences.pages.HighlightKeywordsPage" - name="Color Keywords"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" - id="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" - name="Setverdict"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" - id="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" - name="Filtered Ports"/> - <page - category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" - class="org.eclipse.titan.log.viewer.preferences.pages.DecipheringPreferencePage" - id="org.eclipse.titan.log.viewer.preferences.pages.DecipheringPreferencePage" - name="Message Deciphering"/> - </extension> - <extension - point="org.eclipse.ui.propertyPages"> - <page - class="org.eclipse.titan.log.viewer.preferences.pages.GeneralSettingsPrefPage" - id="org.eclipse.titan.log.viewer.properties.GeneralPage" - name="TITAN Log Viewer"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.ComponentsVisualOrderPrefPage" - id="org.eclipse.titan.log.viewer.properties.CompVisOrderPage" - name="Components Visual Order"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredComponentsPrefPage" - id="org.eclipse.titan.log.viewer.properties.FilteredCompPage" - name="Filtered Components"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSignalsPrefPage" - id="org.eclipse.titan.log.viewer.properties.FilteredSignalsPage" - name="Filtered Signals"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredFunctionsPrefPage" - id="org.eclipse.titan.log.viewer.properties.FilteredFunctionsPage" - name="Filtered Functions"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSilentEventPrefPage" - id="org.eclipse.titan.log.viewer.properties.FilteredSilentEventsPage" - name="Filtered Silent Events"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.HighlightKeywordsPage" - id="org.eclipse.titan.log.viewer.properties.HighlightKeywordsPage" - name="Color Keywords"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" - id="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" - name="Setverdict"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.titan.log.viewer.properties.GeneralPage" - class="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" - id="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" - name="Filtered Ports"> - <filter - name="projectNature" - value="org.eclipse.titan.log.viewer.TitanLogProject"> - </filter> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - </extension> - <extension - point="org.eclipse.ui.views"> - <category - id="org.eclipse.titan.log.viewer.views.category" - name="TITAN Log Viewer"/> - <view - allowMultiple="true" - category="org.eclipse.titan.log.viewer.views.category" - class="org.eclipse.titan.log.viewer.views.MSCView" - icon="icons/msc.gif" - id="org.eclipse.titan.log.viewer.views.MSCView" - name="MSC"/> - <view - allowMultiple="false" - category="org.eclipse.titan.log.viewer.views.category" - class="org.eclipse.titan.log.viewer.views.DetailsView" - icon="icons/details.gif" - id="org.eclipse.titan.log.viewer.views.DetailsView" - name="Value"/> - <view - allowMultiple="true" - category="org.eclipse.titan.log.viewer.views.category" - class="org.eclipse.titan.log.viewer.views.text.table.TextTableView" - icon="icons/table_view.gif" - id="org.eclipse.titan.log.viewer.views.text.table.TextTableView" - name="Text Table"/> - <view - allowMultiple="true" - category="org.eclipse.titan.log.viewer.views.category" - class="org.eclipse.titan.log.viewer.views.StatisticalView" - icon="icons/statistics.gif" - id="org.eclipse.titan.log.viewer.views.StatisticalView" - name="Statistical"/> - </extension> - <extension - point="org.eclipse.search.searchPages"> - <page - showScopeSection="true" - canSearchEnclosingProjects="true" - label="TITAN Log files" - class="org.eclipse.titan.log.viewer.views.LogSearchPage" - icon="icons/search.gif" - extensions="log:100" - sizeHint="650,200" - id="org.eclipse.titan.log.viewer.search.LogSearchPage"> - </page> - </extension> - <extension - id="LogSearchPage" - point="org.eclipse.search.searchResultViewPages"> - <viewPage - id="org.eclipse.titan.log.viewer.search.LogSearchViewPage" - searchResultClass="org.eclipse.titan.log.viewer.search.LogSearchResult" - class="org.eclipse.titan.log.viewer.views.LogSearchResultPage"> - </viewPage> - </extension> -<extension - point="org.eclipse.ui.actionSets"> - <actionSet - label="TITAN Log files" - visible="false" - id="org.eclipse.titan.log.viewer.search.SearchActionSet"> - - <!-- see http://bugs.eclipse.org/bugs/show_bug.cgi?id=15684 --> - <!-- Note: The menu (re-) definition has to be here due to bug: --> - <!-- =================================================================== --> - <!-- Search Menu --> - <!-- =================================================================== --> - <menu - label="Search" - path="navigate" - id="org.eclipse.search.menu"> - <groupMarker name="internalDialogGroup"/> <!-- not to be used by clients --> - <groupMarker name="dialogGroup"/> <!-- to be used by clients --> - <separator name="fileSearchContextMenuActionsGroup"/> <!-- to be used by clients --> - <separator name="contextMenuActionsGroup"/> <!-- to be used by clients --> - <separator name="occurencesActionsGroup"/> <!-- to be used by clients --> - <separator name="extraSearchGroup"/> <!-- to be used by clients --> - </menu> - <!-- =================================================================== --> - - <action - label="TITAN Log files" - icon="icons/search.gif" - class="org.eclipse.titan.log.viewer.actions.OpenLogSearchPageAction" - menubarPath="org.eclipse.search.menu/dialogGroup" - id="org.eclipse.titan.log.viewer.actions.OpenLogSearchPage"> - </action> - </actionSet> -</extension> - -<extension - point="org.eclipse.ui.perspectiveExtensions"> - <perspectiveExtension targetID="org.eclipse.titan.log.viewer.factories.PerspectiveFactory"> - <actionSet id="org.eclipse.titan.log.viewer.search.SearchActionSet"/> - </perspectiveExtension> -</extension> - - -<extension point="org.eclipse.ui.bindings"><key commandId="org.eclipse.titan.log.viewer.enter" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="CR"/> -</extension> - <extension point="org.eclipse.ui.commands"><command id="org.eclipse.titan.log.viewer.enter" name="Enter"/> -</extension> - <extension - point="org.eclipse.ui.popupMenus"> - <objectContribution - objectClass="org.eclipse.core.resources.IFile" - adaptable = "true" - nameFilter="*.log" - id="org.eclipse.titan.log.viewer.objectContribution1"> - <menu - id = "TITAN_log_viewer_popup_Menu" - label = "TITAN Log Viewer"> - <separator name = "group1"/> - <separator name = "group2"/> - </menu> - <action - id="org.eclipse.titan.log.viewer.actions.ExtractTestCasesMenuAction" - icon="icons/testcases.gif" - label="Extract Test Cases" - class="org.eclipse.titan.log.viewer.actions.ExtractTestCasesMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu/group1" - enablesFor="1"> - </action> - <action - id="org.eclipse.titan.log.viewer.actions.ExtractComponentsMenuAction" - icon="icons/fetch_components.gif" - label="Extract Components" - class="org.eclipse.titan.log.viewer.actions.ExtractComponentsMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu/group1" - enablesFor="1"> - </action> - <action - id="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" - icon="icons/table_view.gif" - label="Open Text Table View" - class="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu/group1" - enablesFor="1"> - </action> - <action - id="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" - icon="icons/statistics.gif" - label="Open Statistical View" - class="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu/group1" - enablesFor="+"> - </action> - <action - id="org.eclipse.titan.log.viewer.actions.CloseAllConnectedViewMenuAction" - icon="icons/delete.gif" - label="Close all connected views" - class="org.eclipse.titan.log.viewer.actions.CloseAllConnectedViewMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu/group2" - enablesFor="1"> - </action> - </objectContribution> - </extension> - <extension - point="org.eclipse.ui.navigator.navigatorContent"> - <navigatorContent - id="org.eclipse.titan.log.viewer.logfileContent" - name="TITAN Log file" - activeByDefault="true" - contentProvider="org.eclipse.titan.log.viewer.views.navigator.LogFileContentProvider" - labelProvider="org.eclipse.titan.log.viewer.views.navigator.LogFileLabelProvider" - priority="high"> - <enablement> - <and> - <instanceof value="org.eclipse.core.resources.IFile" /> --> - <test property="org.eclipse.core.resources.extension" value="log" /> - </and> - </enablement> - </navigatorContent> - </extension> - - <extension - point="org.eclipse.ui.navigator.navigatorContent"> - <navigatorContent - id="org.eclipse.titan.log.viewer.TestCaseContent" - name="TITAN Test Case" - activeByDefault="true" - contentProvider="org.eclipse.titan.log.viewer.views.navigator.LogFileContentProvider" - labelProvider="org.eclipse.titan.log.viewer.views.navigator.TestCasesViewerLabelProvider" - priority="highest"> - <enablement> - <instanceof value="org.eclipse.titan.log.viewer.parsers.data.TestCase" /> - </enablement> - </navigatorContent> - </extension> - -<extension - point="org.eclipse.ui.navigator.navigatorContent"> - <actionProvider - class="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider" - id="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider.open" - priority="highest"> - <enablement> - <and> - <instanceof - value="org.eclipse.titan.log.viewer.parsers.data.TestCase"> - </instanceof> - </and> - </enablement> - </actionProvider> -</extension> -<extension - point="org.eclipse.ui.navigator.viewer"> - <viewerActionBinding - viewerId="org.eclipse.ui.navigator.ProjectExplorer"> - <includes> - <actionExtension - pattern="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider.open"> - </actionExtension> - </includes> - </viewerActionBinding> -</extension> - -<extension - point="org.eclipse.ui.navigator.navigatorContent"> - <actionProvider - class="org.eclipse.titan.log.viewer.actions.LogFileActionProvider" - id="org.eclipse.titan.log.viewer.actions.LogFileActionProvider.open" - overrides="org.eclipse.ui.navigator.resources.OpenActions" - priority="highest"> - <enablement> - <and> - <instanceof - value="org.eclipse.core.resources.IFile"> - </instanceof> - <test - property="org.eclipse.core.resources.extension" - value="log"> - </test> - </and> - </enablement> - </actionProvider> -</extension> -<extension - point="org.eclipse.ui.navigator.viewer"> - <viewerActionBinding - viewerId="org.eclipse.ui.navigator.ProjectExplorer"> - <includes> - <actionExtension - pattern="org.eclipse.titan.log.viewer.actions.LogFileActionProvider.open" /> - </includes> - </viewerActionBinding> -</extension> - - <extension - point="org.eclipse.ui.navigator.viewer"> - <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> - <includes> - <contentExtension pattern="org.eclipse.titan.log.viewer.logfileContent"/> - <actionExtension pattern="org.eclipse.titan.log.viewer.actions.LogFileActionProvider" /> - <contentExtension pattern="org.eclipse.titan.log.viewer.TestCaseContent"/> - <actionExtension pattern="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider" /> - <actionExtension pattern="org.eclipse.ui.navigator.resources.*" /> - </includes> - </viewerContentBinding> - </extension> - - <extension - point="org.eclipse.ui.popupMenus"> - <objectContribution - objectClass="org.eclipse.titan.log.viewer.parsers.data.TestCase" - adaptable = "true" - id="org.eclipse.titan.log.viewer.objectContributionForTestCase"> - <menu - id = "TITAN_log_viewer_popup_Menu_TestCase" - label = "TITAN Log Viewer"> - </menu> - <action - id="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" - icon="icons/table_view.gif" - label="Open Text Table View" - class="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu" - enablesFor="1"> - </action> - <action - id="org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction" - icon="icons/msc.gif" - label="Open MSC View" - class="org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu" - enablesFor="1"> - </action> - <action - id="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" - icon="icons/statistics.gif" - label="Open Statistical View" - class="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" - menubarPath = "TITAN_log_viewer_popup_Menu" - enablesFor="+"> - </action> - </objectContribution> - </extension> -</plugin> +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2000-2016 Ericsson Telecom AB + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html + --> +<?eclipse version="4.4"?> +<plugin> + <extension id="org.eclipse.titan.log.viewer.TitanLogProject" + name="Titan Log Viewer Project Nature" point="org.eclipse.core.resources.natures"> + <runtime> + <run class="org.eclipse.titan.log.viewer.natures.TitanLogProject" /> + </runtime> + </extension> + <extension point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.titan.log.viewer.preferences.PreferenceInitializer" /> + </extension> + <extension point="org.eclipse.ui.perspectives"> + <perspective + class="org.eclipse.titan.log.viewer.factories.PerspectiveFactory" + icon="icons/titan.gif" id="org.eclipse.titan.log.viewer.factories.PerspectiveFactory" + name="TITAN Log Viewer" /> + </extension> + <extension point="org.eclipse.help.toc"> + <toc file="toc.xml" primary="true" /> + </extension> + <extension point="org.eclipse.ui.decorators"> + <decorator adaptable="true" + class="org.eclipse.titan.log.viewer.views.navigator.FileSizeDecorator" + id="org.eclipse.titan.log.viewer.views.navigator.FileSizeDecorator" + label="TITAN Log Viewer file size decorator" lightweight="true" + state="true"> + <enablement> + <objectClass name="org.eclipse.core.resources.IFile" /> + </enablement> + </decorator> + </extension> + <extension point="org.eclipse.ui.preferencePages"> + <page + class="org.eclipse.titan.log.viewer.preferences.pages.GeneralSettingsPrefPage" + id="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + name="TITAN Log Viewer"> + </page> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.ComponentsVisualOrderPrefPage" + id="org.eclipse.titan.log.viewer.preferences.pages.VisualComponentsOrderPrefPage" + name="Components Visual Order" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredComponentsPrefPage" + id="org.eclipse.titan.log.viewer.preferences.pages.FilteredComponentsPrefPage" + name="Filtered Components" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSignalsPrefPage" + id="org.eclipse.titan.log.viewer.preferences.pages.FilteredSignalsPrefPage" + name="Filtered Signals" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredFunctionsPrefPage" + id="org.eclipse.titan.log.viewer.preferences.pages.FilteredFunctionsPrefPage" + name="Filtered Functions" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSilentEventPrefPage" + id="org.eclipse.titan.log.viewer.preferences.pages.FilteredSilentEventsPage" + name="Filtered Silent Events" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.HighlightKeywordsPage" + id="org.eclipse.titan.log.viewer.preferences.pages.HighlightKeywordsPage" + name="Color Keywords" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" + id="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" + name="Setverdict" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" + id="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" + name="Filtered Ports" /> + <page + category="org.eclipse.titan.log.viewer.preferences.TitanLogViewerPreferencePage" + class="org.eclipse.titan.log.viewer.preferences.pages.DecipheringPreferencePage" + id="org.eclipse.titan.log.viewer.preferences.pages.DecipheringPreferencePage" + name="Message Deciphering" /> + </extension> + <extension point="org.eclipse.ui.propertyPages"> + <page + class="org.eclipse.titan.log.viewer.preferences.pages.GeneralSettingsPrefPage" + id="org.eclipse.titan.log.viewer.properties.GeneralPage" name="TITAN Log Viewer"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.ComponentsVisualOrderPrefPage" + id="org.eclipse.titan.log.viewer.properties.CompVisOrderPage" + name="Components Visual Order"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredComponentsPrefPage" + id="org.eclipse.titan.log.viewer.properties.FilteredCompPage" + name="Filtered Components"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSignalsPrefPage" + id="org.eclipse.titan.log.viewer.properties.FilteredSignalsPage" + name="Filtered Signals"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredFunctionsPrefPage" + id="org.eclipse.titan.log.viewer.properties.FilteredFunctionsPage" + name="Filtered Functions"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredSilentEventPrefPage" + id="org.eclipse.titan.log.viewer.properties.FilteredSilentEventsPage" + name="Filtered Silent Events"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.HighlightKeywordsPage" + id="org.eclipse.titan.log.viewer.properties.HighlightKeywordsPage" + name="Color Keywords"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" + id="org.eclipse.titan.log.viewer.preferences.pages.SetverdictPreferencePage" + name="Setverdict"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + <page category="org.eclipse.titan.log.viewer.properties.GeneralPage" + class="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" + id="org.eclipse.titan.log.viewer.preferences.pages.FilteredPortsPreferencePage" + name="Filtered Ports"> + <filter name="projectNature" value="org.eclipse.titan.log.viewer.TitanLogProject"> + </filter> + <enabledWhen> + <instanceof value="org.eclipse.core.resources.IProject"> + </instanceof> + </enabledWhen> + </page> + </extension> + <extension point="org.eclipse.ui.views"> + <category id="org.eclipse.titan.log.viewer.views.category" + name="TITAN Log Viewer" /> + <view allowMultiple="true" + category="org.eclipse.titan.log.viewer.views.category" class="org.eclipse.titan.log.viewer.views.MSCView" + icon="icons/msc.gif" id="org.eclipse.titan.log.viewer.views.MSCView" + name="MSC" /> + <view allowMultiple="false" + category="org.eclipse.titan.log.viewer.views.category" class="org.eclipse.titan.log.viewer.views.DetailsView" + icon="icons/details.gif" id="org.eclipse.titan.log.viewer.views.DetailsView" + name="Value" /> + <view allowMultiple="true" + category="org.eclipse.titan.log.viewer.views.category" + class="org.eclipse.titan.log.viewer.views.text.table.TextTableView" + icon="icons/table_view.gif" id="org.eclipse.titan.log.viewer.views.text.table.TextTableView" + name="Text Table" /> + <view allowMultiple="true" + category="org.eclipse.titan.log.viewer.views.category" class="org.eclipse.titan.log.viewer.views.StatisticalView" + icon="icons/statistics.gif" id="org.eclipse.titan.log.viewer.views.StatisticalView" + name="Statistical" /> + </extension> + <extension point="org.eclipse.search.searchPages"> + <page showScopeSection="true" canSearchEnclosingProjects="true" + label="TITAN Log files" class="org.eclipse.titan.log.viewer.views.LogSearchPage" + icon="icons/search.gif" extensions="log:100" sizeHint="650,200" + id="org.eclipse.titan.log.viewer.search.LogSearchPage"> + </page> + </extension> + <extension id="LogSearchPage" point="org.eclipse.search.searchResultViewPages"> + <viewPage id="org.eclipse.titan.log.viewer.search.LogSearchViewPage" + searchResultClass="org.eclipse.titan.log.viewer.search.LogSearchResult" + class="org.eclipse.titan.log.viewer.views.LogSearchResultPage"> + </viewPage> + </extension> + <extension point="org.eclipse.ui.actionSets"> + <actionSet label="TITAN Log files" visible="false" + id="org.eclipse.titan.log.viewer.search.SearchActionSet"> + + <!-- see http://bugs.eclipse.org/bugs/show_bug.cgi?id=15684 --> + <!-- Note: The menu (re-) definition has to be here due to bug: --> + <!-- =================================================================== --> + <!-- Search Menu --> + <!-- =================================================================== --> + <menu label="Search" path="navigate" id="org.eclipse.search.menu"> + <groupMarker name="internalDialogGroup" /> <!-- not to be used by clients --> + <groupMarker name="dialogGroup" /> <!-- to be used by clients --> + <separator name="fileSearchContextMenuActionsGroup" /> <!-- to be used by clients --> + <separator name="contextMenuActionsGroup" /> <!-- to be used by clients --> + <separator name="occurencesActionsGroup" /> <!-- to be used by clients --> + <separator name="extraSearchGroup" /> <!-- to be used by clients --> + </menu> + <!-- =================================================================== --> + + <action label="TITAN Log files" icon="icons/search.gif" + class="org.eclipse.titan.log.viewer.actions.OpenLogSearchPageAction" + menubarPath="org.eclipse.search.menu/dialogGroup" + id="org.eclipse.titan.log.viewer.actions.OpenLogSearchPage"> + </action> + </actionSet> + </extension> + + <extension point="org.eclipse.ui.perspectiveExtensions"> + <perspectiveExtension + targetID="org.eclipse.titan.log.viewer.factories.PerspectiveFactory"> + <actionSet id="org.eclipse.titan.log.viewer.search.SearchActionSet" /> + </perspectiveExtension> + </extension> + + + <extension point="org.eclipse.ui.bindings"> + <key commandId="org.eclipse.titan.log.viewer.enter" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" + sequence="CR" /> + </extension> + <extension point="org.eclipse.ui.commands"> + <command id="org.eclipse.titan.log.viewer.enter" name="Enter" /> + </extension> + + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" + id="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" + name="Open Statistical View" /> + <command + defaultHandler="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" + id="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" + name="Open Text Table View" /> + <command + defaultHandler="org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction" + id="org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction" + name="Open MSC View" /> + <command + defaultHandler="org.eclipse.titan.log.viewer.actions.ExtractComponentsMenuAction" + id="org.eclipse.titan.log.viewer.actions.ExtractComponentsMenuAction" + name="Extract Components" /> + <command + defaultHandler="org.eclipse.titan.log.viewer.actions.ExtractTestCasesMenuAction" + id="org.eclipse.titan.log.viewer.actions.ExtractTestCasesMenuAction" + name="Extract Test Cases" /> + <command + defaultHandler="org.eclipse.titan.log.viewer.actions.CloseAllConnectedViewMenuAction" + id="org.eclipse.titan.log.viewer.actions.CloseAllConnectedViewMenuAction" + name="Close all connected views" /> + </extension> + <extension point="org.eclipse.ui.menus"> + <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions"> + <menu label="Titan Log Viewer"> + <command + commandId="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" + icon="icons/statistics.gif" + id="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" + label="Open Statistical View" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt type="org.eclipse.core.resources.IFile"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.log.viewer.TitanLogProject" /> + <test property="org.eclipse.core.resources.extension" + value="log" /> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command + commandId="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" + icon="icons/table_view.gif" + id="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" + label="Open Text Table View" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt type="org.eclipse.core.resources.IFile"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.log.viewer.TitanLogProject" /> + <test property="org.eclipse.core.resources.extension" + value="log" /> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command + commandId="org.eclipse.titan.log.viewer.actions.ExtractComponentsMenuAction" + icon="icons/fetch_components.gif" + id="org.eclipse.titan.log.viewer.actions.ExtractComponentsMenuAction" + label="Extract Components" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt type="org.eclipse.core.resources.IFile"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.log.viewer.TitanLogProject" /> + <test property="org.eclipse.core.resources.extension" + value="log" /> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command + commandId="org.eclipse.titan.log.viewer.actions.ExtractTestCasesMenuAction" + icon="icons/testcases.gif" + id="org.eclipse.titan.log.viewer.actions.ExtractTestCasesMenuAction" + label="Extract Test Cases" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt type="org.eclipse.core.resources.IFile"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.log.viewer.TitanLogProject" /> + <test property="org.eclipse.core.resources.extension" + value="log" /> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <separator name="org.eclipse.titan.log.viewer.separator1" + visible="true"> + </separator> + <command + commandId="org.eclipse.titan.log.viewer.actions.CloseAllConnectedViewMenuAction" + icon="icons/delete.gif" + id="org.eclipse.titan.log.viewer.actions.CloseAllConnectedViewMenuAction" + label="Close all connected views" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt type="org.eclipse.core.resources.IFile"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.log.viewer.TitanLogProject" /> + <test property="org.eclipse.core.resources.extension" + value="log" /> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + </menu> + </menuContribution> + </extension> + <extension point="org.eclipse.ui.navigator.navigatorContent"> + <navigatorContent id="org.eclipse.titan.log.viewer.logfileContent" + name="TITAN Log file" activeByDefault="true" + contentProvider="org.eclipse.titan.log.viewer.views.navigator.LogFileContentProvider" + labelProvider="org.eclipse.titan.log.viewer.views.navigator.LogFileLabelProvider" + priority="high"> + <enablement> + <and> + <instanceof value="org.eclipse.core.resources.IFile" /> + --> + <test property="org.eclipse.core.resources.extension" + value="log" /> + </and> + </enablement> + </navigatorContent> + </extension> + + <extension point="org.eclipse.ui.navigator.navigatorContent"> + <navigatorContent id="org.eclipse.titan.log.viewer.TestCaseContent" + name="TITAN Test Case" activeByDefault="true" + contentProvider="org.eclipse.titan.log.viewer.views.navigator.LogFileContentProvider" + labelProvider="org.eclipse.titan.log.viewer.views.navigator.TestCasesViewerLabelProvider" + priority="highest"> + <enablement> + <instanceof value="org.eclipse.titan.log.viewer.parsers.data.TestCase" /> + </enablement> + </navigatorContent> + </extension> + + <extension point="org.eclipse.ui.navigator.navigatorContent"> + <actionProvider + class="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider" + id="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider.open" + priority="highest"> + <enablement> + <and> + <instanceof + value="org.eclipse.titan.log.viewer.parsers.data.TestCase"> + </instanceof> + </and> + </enablement> + </actionProvider> + </extension> + <extension point="org.eclipse.ui.navigator.viewer"> + <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> + <includes> + <actionExtension + pattern="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider.open"> + </actionExtension> + </includes> + </viewerActionBinding> + </extension> + + <extension point="org.eclipse.ui.navigator.viewer"> + <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> + <includes> + <actionExtension + pattern="org.eclipse.titan.log.viewer.actions.LogFileActionProvider.open" /> + </includes> + </viewerActionBinding> + </extension> + + <extension point="org.eclipse.ui.navigator.viewer"> + <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> + <includes> + <contentExtension pattern="org.eclipse.titan.log.viewer.logfileContent" /> + <actionExtension + pattern="org.eclipse.titan.log.viewer.actions.LogFileActionProvider" /> + <contentExtension pattern="org.eclipse.titan.log.viewer.TestCaseContent" /> + <actionExtension + pattern="org.eclipse.titan.log.viewer.actions.TestCaseActionProvider" /> + <actionExtension pattern="org.eclipse.ui.navigator.resources.*" /> + </includes> + </viewerContentBinding> + </extension> + <extension point="org.eclipse.ui.menus"> + <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions"> + <command + commandId="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" + icon="icons/statistics.gif" + id="org.eclipse.titan.log.viewer.actions.OpenStatisticalViewMenuAction" + label="Open Statistical View" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt + type="org.eclipse.titan.log.viewer.parsers.data.TestCase"> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command + commandId="org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction" + icon="icons/msc.gif" + id="org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction" + label="Open MSC View" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt + type="org.eclipse.titan.log.viewer.parsers.data.TestCase"> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command + commandId="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" + icon="icons/table_view.gif" + id="org.eclipse.titan.log.viewer.actions.OpenTextTableProjectsViewMenuAction" + label="Open Text Table View" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt + type="org.eclipse.titan.log.viewer.parsers.data.TestCase"> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + </menuContribution> + </extension> +</plugin> diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/CloseAllConnectedViewMenuAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/CloseAllConnectedViewMenuAction.java index 814b96b7be74f011c40c472f5bed9c0366467feb..3c32042f99520d80ae676c76711f0b08521dd57b 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/CloseAllConnectedViewMenuAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/CloseAllConnectedViewMenuAction.java @@ -7,8 +7,10 @@ ******************************************************************************/ package org.eclipse.titan.log.viewer.actions; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; -import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; @@ -18,6 +20,7 @@ import org.eclipse.ui.IActionDelegate; import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; /** * Menu action for closing the opened views of the selected log file @@ -25,9 +28,8 @@ import org.eclipse.ui.PlatformUI; */ // TODO this action should handle selected test cases as well // TODO this action should handle multiple selection -public class CloseAllConnectedViewMenuAction extends Action implements IActionDelegate { +public class CloseAllConnectedViewMenuAction extends AbstractHandler implements IActionDelegate { - private static final String NAME = "Close all connected views"; //$NON-NLS-1$ private IStructuredSelection selection; private IFile logFile; @@ -35,11 +37,28 @@ public class CloseAllConnectedViewMenuAction extends Action implements IActionDe * Constructor */ public CloseAllConnectedViewMenuAction() { - super(NAME); } @Override public void run(final IAction action) { + run(selection); + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + ISelection tempSelection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); + if (!(tempSelection instanceof IStructuredSelection)) { + return null; + } + + selection = (IStructuredSelection) tempSelection; + + run(selection); + + return null; + } + + public void run(final IStructuredSelection selection) { if (this.selection == null) { return; } diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractComponentsMenuAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractComponentsMenuAction.java index fac01abba8f750064ab7dd60431b62edd352746d..865c1d66a6f8a79288fe3aebc362fd7db6d3b1bc 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractComponentsMenuAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractComponentsMenuAction.java @@ -11,16 +11,16 @@ import java.io.File; import java.lang.reflect.InvocationTargetException; import java.util.List; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.log.viewer.exceptions.TechnicalException; import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; @@ -35,37 +35,51 @@ import org.eclipse.titan.log.viewer.utils.ResourcePropertyHandler; import org.eclipse.titan.log.viewer.utils.SelectionUtils; import org.eclipse.ui.IActionDelegate; import org.eclipse.ui.dialogs.PreferencesUtil; +import org.eclipse.ui.handlers.HandlerUtil; /** * This action extracts components from a TITAN log file, and adds * the components to the Components Visual Order list */ -public class ExtractComponentsMenuAction extends Action implements IActionDelegate { +//TODO remove unnecessary functions after conversion +public class ExtractComponentsMenuAction extends AbstractHandler implements IActionDelegate { - private static final String NAME = Messages.getString("FetchComponentsAction.0"); //$NON-NLS-1$ - private IStructuredSelection selection; + private ISelection selection; public ExtractComponentsMenuAction() { - super(NAME); + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); + + run(selection); + + return null; } @Override public void run(final IAction action) { + run(selection); + } + + + public void run(final ISelection selection) { List<String> components = null; - if (this.selection == null) { + if (selection == null) { return; } - if (!SelectionUtils.isSelectionALogFile(this.selection)) { + if (!SelectionUtils.isSelectionALogFile(selection)) { return; } - IFile logFile = SelectionUtils.selectionToIFile(this.selection); + IFile logFile = SelectionUtils.selectionToIFile(selection); if (logFile == null) { return; } try { ExtractComponentsAction extractCompAction = new ExtractComponentsAction(logFile); - new ProgressMonitorDialog(new Shell(Display.getDefault())).run(false, false, extractCompAction); + new ProgressMonitorDialog(null).run(false, false, extractCompAction); components = extractCompAction.getComponents(); } catch (InvocationTargetException e) { ErrorReporter.logExceptionStackTrace(e); @@ -109,7 +123,7 @@ public class ExtractComponentsMenuAction extends Action implements IActionDelega if (preferences.getOpenPropAfterCompExt()) { // Open dialog PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( - new Shell(Display.getDefault()), logFile.getProject(), PreferenceConstants.PAGE_ID_COMP_VIS_ORDER_PAGE, null, null); + null, logFile.getProject(), PreferenceConstants.PAGE_ID_COMP_VIS_ORDER_PAGE, null, null); Object currentPage = dialog.getSelectedPage(); if (currentPage instanceof ComponentsVisualOrderPrefPage) { ComponentsVisualOrderPrefPage componentsVisualOrderPrefPage = (ComponentsVisualOrderPrefPage) currentPage; diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractTestCasesMenuAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractTestCasesMenuAction.java index 58068ee2f4e70fb106196b40a37dfa19400e2ad7..6cbd93c59271b4efe42d3b510e25d588f8465889 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractTestCasesMenuAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/ExtractTestCasesMenuAction.java @@ -9,6 +9,9 @@ package org.eclipse.titan.log.viewer.actions; import java.lang.reflect.InvocationTargetException; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.WorkspaceJob; import org.eclipse.core.runtime.CoreException; @@ -16,7 +19,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; @@ -29,30 +31,28 @@ import org.eclipse.titan.log.viewer.utils.Constants; import org.eclipse.titan.log.viewer.utils.Messages; import org.eclipse.titan.log.viewer.utils.SelectionUtils; import org.eclipse.ui.IActionDelegate; +import org.eclipse.ui.handlers.HandlerUtil; /** * Extracts test cases from a TITAN log file and shows the test cases * in the test cases viewer in the navigator view */ -//FIXME this is not even an ACTION !!!! -public class ExtractTestCasesMenuAction extends Action implements IActionDelegate { +//TODO remove unnecessary functions after conversion +public class ExtractTestCasesMenuAction extends AbstractHandler implements IActionDelegate { - private static final String NAME = Messages.getString("ExtractTestCasesMenuAction.0"); //$NON-NLS-1$ - private IStructuredSelection selection; + private ISelection selection; public ExtractTestCasesMenuAction() { - super(NAME); } - @Override - public void run() { - if (this.selection == null) { + public void run(final ISelection selection) { + if (selection == null) { return; } - if (!SelectionUtils.isSelectionALogFile(this.selection)) { + if (!SelectionUtils.isSelectionALogFile(selection)) { return; } - final IFile logFile = SelectionUtils.selectionToIFile(this.selection); + final IFile logFile = SelectionUtils.selectionToIFile(selection); try { Object temp = logFile.getSessionProperty(Constants.EXTRACTION_RUNNING); if (temp != null && (Boolean) temp) { @@ -109,7 +109,16 @@ public class ExtractTestCasesMenuAction extends Action implements IActionDelegat @Override public void run(final IAction action) { - run(); + run(selection); + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); + + run(selection); + + return null; } @Override diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/LogFileActionProvider.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/LogFileActionProvider.java index 8f655175f6d0db5522e8cc823b2fb735b6d84072..2d1499581f9433e184c2db4740ab4482371d37ce 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/LogFileActionProvider.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/LogFileActionProvider.java @@ -20,6 +20,7 @@ import org.eclipse.ui.navigator.ICommonActionExtensionSite; import org.eclipse.ui.navigator.ICommonMenuConstants; import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite; +//FIXME check if this class is needed at all public class LogFileActionProvider extends CommonActionProvider { private OpenTextTableProjectsViewMenuAction openLogFileAction; private ICommonViewerWorkbenchSite viewSite = null; @@ -37,7 +38,7 @@ public class LogFileActionProvider extends CommonActionProvider { IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); if (selection.size() == 1 && selection.getFirstElement() instanceof IFile) { openLogFileAction.selectionChanged(null, selection); - actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openLogFileAction); +// actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openLogFileAction); } } @@ -51,7 +52,7 @@ public class LogFileActionProvider extends CommonActionProvider { openLogFileAction.selectionChanged(null, selection); if (openLogFileAction.isEnabled()) { - menu.insertAfter(ICommonMenuConstants.GROUP_OPEN, openLogFileAction); +// menu.insertAfter(ICommonMenuConstants.GROUP_OPEN, openLogFileAction); } addOpenWithMenu(menu); diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenMSCViewAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenMSCViewAction.java new file mode 100644 index 0000000000000000000000000000000000000000..8ba01fc8de6809adb227eff7cdbaf4d93dee1a8e --- /dev/null +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenMSCViewAction.java @@ -0,0 +1,67 @@ +package org.eclipse.titan.log.viewer.actions; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.titan.log.viewer.models.LogFileMetaData; +import org.eclipse.titan.log.viewer.parsers.data.TestCase; +import org.eclipse.titan.log.viewer.utils.Messages; +import org.eclipse.ui.IActionDelegate; + +public class OpenMSCViewAction extends Action implements IActionDelegate, ISelectionChangedListener { + private static final String NAME = Messages.getString("OpenMSCViewMenuAction.0"); //$NON-NLS-1$ + + private IStructuredSelection selection; + private LogFileMetaData logFileMetaData; + private int recordToSelect = -1; + + /** + * Constructor + */ + public OpenMSCViewAction() { + super(NAME); + } + + @Override + public void run(final IAction action) { + run(selection); + } + + public void run(final IStructuredSelection selection) { + OpenMSCViewMenuAction menuAction = new OpenMSCViewMenuAction(); + menuAction.setFirstRow(recordToSelect); + menuAction.run(selection); + + } + + @Override + public void selectionChanged(final IAction action, final ISelection selection) { + if (!(selection instanceof IStructuredSelection)) { + setEnabled(false); + return; + } + + this.selection = (IStructuredSelection) selection; + if (this.selection.size() != 1 || !(this.selection.getFirstElement() instanceof TestCase)) { + setEnabled(false); + return; + } + setEnabled(true); + } + + @Override + public void selectionChanged(final SelectionChangedEvent event) { + selectionChanged(null, event.getSelection()); + } + + /** + * The given record will be selected in the opening MSC view. + * @param recordNumber the recordNumber of the record + */ + public void setFirstRow(final int recordNumber) { + this.recordToSelect = recordNumber; + } +} diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenMSCViewMenuAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenMSCViewMenuAction.java index b31f49a15ef67ed90cfbd425de42d95c64c08e9d..6795128c482516254b434dacd13a34a41bd21c85 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenMSCViewMenuAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenMSCViewMenuAction.java @@ -12,13 +12,15 @@ import java.io.IOException; import java.text.ParseException; import java.util.Date; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.WorkspaceJob; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; @@ -48,10 +50,10 @@ import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +public class OpenMSCViewMenuAction extends AbstractHandler implements IActionDelegate, ISelectionChangedListener { -public class OpenMSCViewMenuAction extends Action implements IActionDelegate, ISelectionChangedListener { - - private static final String NAME = Messages.getString("OpenMSCViewMenuAction.0"); //$NON-NLS-1$ private IStructuredSelection selection; private LogFileMetaData logFileMetaData; private int recordToSelect = -1; @@ -60,15 +62,32 @@ public class OpenMSCViewMenuAction extends Action implements IActionDelegate, IS * Constructor */ public OpenMSCViewMenuAction() { - super(NAME); } @Override - public void run() { + public void run(final IAction action) { + run(selection); + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + ISelection tempSelection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); + if (!(tempSelection instanceof IStructuredSelection)) { + return null; + } + + selection = (IStructuredSelection) tempSelection; + + run(selection); + + return null; + } + + public void run(final IStructuredSelection selection) { if (!isEnabled()) { return; } - Object element = this.selection.getFirstElement(); + Object element = selection.getFirstElement(); if (!(element instanceof TestCase)) { return; } @@ -242,11 +261,6 @@ public class OpenMSCViewMenuAction extends Action implements IActionDelegate, IS part.setModel(model, getFirstRowToSelect(preferences, model)); } - @Override - public void run(final IAction action) { - run(); - } - @Override public void selectionChanged(final IAction action, final ISelection selection) { if (!(selection instanceof IStructuredSelection)) { diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenSourceViewMenuAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenSourceViewMenuAction.java index 8af5a1fce7eca0fa6dd8b2a77087d3316ff3439c..3adb309894b270921cdde54c413cd8a33fe6c492 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenSourceViewMenuAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenSourceViewMenuAction.java @@ -17,7 +17,6 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.log.viewer.exceptions.TechnicalException; import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; @@ -30,10 +29,10 @@ import org.eclipse.titan.log.viewer.readers.ValueReader; import org.eclipse.titan.log.viewer.utils.ActionUtils; import org.eclipse.titan.log.viewer.utils.LogFileCacheHandler; import org.eclipse.titan.log.viewer.utils.Messages; -import org.eclipse.titan.log.viewer.views.text.table.TextTableView; import org.eclipse.titan.log.viewer.views.msc.model.EventObject; import org.eclipse.titan.log.viewer.views.msc.model.EventSelection; import org.eclipse.titan.log.viewer.views.msc.ui.actions.OpenSourceAction; +import org.eclipse.titan.log.viewer.views.text.table.TextTableView; import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PlatformUI; @@ -156,7 +155,7 @@ public class OpenSourceViewMenuAction extends SelectionProviderAction { @Override public void run() { MessageDialog.openError( - new Shell(Display.getDefault()), + null, "Error opening source", "This log file is not generated with source location information inserted. And it really does not seem to contain source location information"); //$NON-NLS-1$ } }); @@ -164,7 +163,7 @@ public class OpenSourceViewMenuAction extends SelectionProviderAction { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), "Error opening source", "This log record does not seem to contain source location information"); //$NON-NLS-1$ + MessageDialog.openError(null, "Error opening source", "This log record does not seem to contain source location information"); //$NON-NLS-1$ } }); } diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenStatisticalViewMenuAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenStatisticalViewMenuAction.java index e145031e518a42e9524ef8ec208157604ba9f1cb..63129010ff9e0db051ab28cbc639acab03578265 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenStatisticalViewMenuAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenStatisticalViewMenuAction.java @@ -18,9 +18,11 @@ import java.util.Observable; import java.util.Observer; import java.util.Set; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; @@ -28,7 +30,6 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.log.viewer.exceptions.TechnicalException; import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; @@ -50,14 +51,15 @@ import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; /** * Menu action for opening the statistical view from the Projects tab in the Navigator view * */ -public class OpenStatisticalViewMenuAction extends Action implements IActionDelegate, Observer { +//TODO remove unnecessary functions after conversion +public class OpenStatisticalViewMenuAction extends AbstractHandler implements IActionDelegate, Observer { - private static final String NAME = Messages.getString("OpenStatisticalViewMenuAction.6"); //$NON-NLS-1$ private IStructuredSelection selection; private IProgressMonitor monitor; private int lastWorked; @@ -67,17 +69,29 @@ public class OpenStatisticalViewMenuAction extends Action implements IActionDele private TestCaseExtractor testCaseExtractor; public OpenStatisticalViewMenuAction() { - super(NAME); testCaseExtractor = new TestCaseExtractor(); } @Override public void run(final IAction action) { - run(); + run(selection); } @Override - public void run() { + public Object execute(ExecutionEvent event) throws ExecutionException { + ISelection tempSelection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); + if (!(tempSelection instanceof IStructuredSelection)) { + return null; + } + + selection = (IStructuredSelection) tempSelection; + + run(selection); + + return null; + } + + public void run(final IStructuredSelection selection) { this.logFileMetaData = null; this.logFileIsSupported = true; if (this.selection == null) { @@ -187,7 +201,7 @@ public class OpenStatisticalViewMenuAction extends Action implements IActionDele private void processLogFile() { try { - new ProgressMonitorDialog(new Shell(Display.getDefault())).run(false, false, new IRunnableWithProgress() { + new ProgressMonitorDialog(null).run(false, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { OpenStatisticalViewMenuAction.this.monitor = monitor; @@ -224,7 +238,7 @@ public class OpenStatisticalViewMenuAction extends Action implements IActionDele Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openInformation(new Shell(Display.getDefault()), + MessageDialog.openInformation(null, Messages.getString("OpenStatisticalViewMenuAction.2"), Messages.getString("OpenStatisticalViewMenuAction.1")); } diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenTextTableProjectsViewMenuAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenTextTableProjectsViewMenuAction.java index a40fc1bc392c158c3f1086ae361e35fea8eff9cb..1152591d1bffdb86245729efa5becb6dcc7a4f02 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenTextTableProjectsViewMenuAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/OpenTextTableProjectsViewMenuAction.java @@ -11,29 +11,30 @@ import java.io.File; import java.util.Observable; import java.util.Observer; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IActionDelegate; - import org.eclipse.titan.log.viewer.extractors.TestCaseEvent; import org.eclipse.titan.log.viewer.parsers.data.TestCase; import org.eclipse.titan.log.viewer.utils.LogFileCacheHandler; -import org.eclipse.titan.log.viewer.utils.Messages; import org.eclipse.titan.log.viewer.utils.SelectionUtils; import org.eclipse.titan.log.viewer.views.text.table.TextTableViewHelper; +import org.eclipse.ui.IActionDelegate; +import org.eclipse.ui.handlers.HandlerUtil; /** * Menu action for opening the text table view from the Projects tab in the Navigator view * */ -public class OpenTextTableProjectsViewMenuAction extends Action implements IActionDelegate, Observer { +//TODO remove unnecessary functions after conversion +public class OpenTextTableProjectsViewMenuAction extends AbstractHandler implements IActionDelegate, Observer { - private static final String NAME = Messages.getString("OpenTextTableMenuAction.0"); //$NON-NLS-1$ private IStructuredSelection selection; private IProgressMonitor monitor; private int lastWorked; @@ -43,12 +44,29 @@ public class OpenTextTableProjectsViewMenuAction extends Action implements IActi * Constructor */ public OpenTextTableProjectsViewMenuAction() { - super(NAME); } @Override - public void run() { - if (this.selection == null) { + public void run(final IAction action) { + run(selection); + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + ISelection tempSelection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); + if (!(tempSelection instanceof IStructuredSelection)) { + return null; + } + + selection = (IStructuredSelection) tempSelection; + + run(selection); + + return null; + } + + public void run(final IStructuredSelection selection) { + if (selection == null) { return; } @@ -74,11 +92,6 @@ public class OpenTextTableProjectsViewMenuAction extends Action implements IActi } TextTableViewHelper.open(projectName, projectRelativePath, logRecordToSelect); } - - @Override - public void run(final IAction action) { - run(); - } @Override public void selectionChanged(final IAction action, final ISelection selection) { diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/TestCaseActionProvider.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/TestCaseActionProvider.java index e862daa6b1a0647485f27b3bfdb8caf8bda4d47d..eca3dd4821992594ece98eb715ea54060de704c9 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/TestCaseActionProvider.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/actions/TestCaseActionProvider.java @@ -16,11 +16,11 @@ import org.eclipse.ui.navigator.ICommonActionExtensionSite; public class TestCaseActionProvider extends CommonActionProvider { - private OpenMSCViewMenuAction openTestCaseAction; + private OpenMSCViewAction openTestCaseAction; @Override public void init(final ICommonActionExtensionSite site) { - openTestCaseAction = new OpenMSCViewMenuAction(); + openTestCaseAction = new OpenMSCViewAction(); } @Override diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/exceptions/TitanLogExceptionHandler.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/exceptions/TitanLogExceptionHandler.java index 6d234f2e1729129d46ce8fc7d06637e13a538a39..9e53911be855b840df0de7fe263f2dda49b41cec 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/exceptions/TitanLogExceptionHandler.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/exceptions/TitanLogExceptionHandler.java @@ -9,7 +9,6 @@ package org.eclipse.titan.log.viewer.exceptions; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.log.viewer.utils.Constants; import org.eclipse.titan.log.viewer.utils.Messages; @@ -39,7 +38,7 @@ public final class TitanLogExceptionHandler { display.asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), Messages.getString("TitanLogExceptionHandler.0"), userException.getMessage()); + MessageDialog.openError(null, Messages.getString("TitanLogExceptionHandler.0"), userException.getMessage()); } }); } else if (exception instanceof TechnicalException) { @@ -47,7 +46,7 @@ public final class TitanLogExceptionHandler { display.asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), Messages.getString("TitanLogExceptionHandler.1"), technicalException.getMessage()); + MessageDialog.openError(null, Messages.getString("TitanLogExceptionHandler.1"), technicalException.getMessage()); ErrorReporter.logExceptionStackTrace(technicalException); } }); @@ -56,7 +55,7 @@ public final class TitanLogExceptionHandler { display.asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), Messages.getString("TitanLogExceptionHandler.2"), otherException.getMessage()); + MessageDialog.openError(null, Messages.getString("TitanLogExceptionHandler.2"), otherException.getMessage()); ErrorReporter.logExceptionStackTrace(otherException); } }); diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/preferences/pages/DecipheringPreferencePage.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/preferences/pages/DecipheringPreferencePage.java index d9f6314bae50e119d411b76616bb281b5069a0d6..93ddbf13d4b655fc7ec85569cd35931e0d197c8a 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/preferences/pages/DecipheringPreferencePage.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/preferences/pages/DecipheringPreferencePage.java @@ -202,7 +202,7 @@ public class DecipheringPreferencePage extends LogViewerPreferenceRootPage { @Override public void run() { MessageDialog.openError( - new Shell(Display.getDefault()), + null, "Invalid file", "The file can not be found"); } @@ -218,7 +218,7 @@ public class DecipheringPreferencePage extends LogViewerPreferenceRootPage { @Override public void run() { MessageDialog.openError( - new Shell(Display.getDefault()), + null, "Error while importing the rulesets", e.getMessage()); } diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/ImportExportUtils.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/ImportExportUtils.java index cd9428d59a5eeacfdf90718b951182aa39357b3e..3332460973578d088255adb00010155927b1b5d6 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/ImportExportUtils.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/ImportExportUtils.java @@ -9,15 +9,6 @@ package org.eclipse.titan.log.viewer.utils; import static org.eclipse.titan.common.utils.StringUtils.isNullOrEmpty; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -30,12 +21,30 @@ import java.util.Map; import java.util.SortedMap; import java.util.TreeMap; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + import org.eclipse.core.runtime.Path; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; +import org.eclipse.titan.common.logging.ErrorReporter; +import org.eclipse.titan.common.utils.IOUtils; +import org.eclipse.titan.common.utils.Joiner; +import org.eclipse.titan.log.viewer.exceptions.TechnicalException; +import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; +import org.eclipse.titan.log.viewer.preferences.PreferenceConstants; +import org.eclipse.titan.log.viewer.preferences.PreferencesHandler; +import org.eclipse.titan.log.viewer.preferences.data.KeywordColor; import org.eclipse.ui.PlatformUI; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; @@ -46,15 +55,6 @@ import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import org.eclipse.titan.common.logging.ErrorReporter; -import org.eclipse.titan.common.utils.IOUtils; -import org.eclipse.titan.common.utils.Joiner; -import org.eclipse.titan.log.viewer.exceptions.TechnicalException; -import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; -import org.eclipse.titan.log.viewer.preferences.PreferenceConstants; -import org.eclipse.titan.log.viewer.preferences.PreferencesHandler; -import org.eclipse.titan.log.viewer.preferences.data.KeywordColor; - /** * Helper class for import and export of preferences via xml files */ @@ -331,7 +331,7 @@ public final class ImportExportUtils { display.asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), + MessageDialog.openError(null, Messages.getString("ImportExportUtils.2"), Messages.getString("ImportExportUtils.4")); } }); @@ -374,7 +374,7 @@ public final class ImportExportUtils { display.asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openError(new Shell(Display.getDefault()), + MessageDialog.openError(null, Messages.getString("ImportExportUtils.2"), Messages.getString("ImportExportUtils.3")); } }); diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/LogFileCacheHandler.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/LogFileCacheHandler.java index 5b3d33ea501e4b8236d7cd5bd4034459a8308f63..d66281fc87acaea8ff1c89f31c51a046df5fbba5 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/LogFileCacheHandler.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/utils/LogFileCacheHandler.java @@ -39,9 +39,9 @@ import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.utils.FileUtils; +import org.eclipse.titan.common.utils.IOUtils; import org.eclipse.titan.log.viewer.exceptions.TechnicalException; import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; import org.eclipse.titan.log.viewer.exceptions.UserException; @@ -55,8 +55,6 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.navigator.CommonNavigator; -import org.eclipse.titan.common.utils.IOUtils; - /** * This class is responsible for creating and updating the log file cache * @@ -619,7 +617,7 @@ public final class LogFileCacheHandler { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openInformation(new Shell(Display.getDefault()), + MessageDialog.openInformation(null, Messages.getString("OpenTextTableProjectsViewMenuAction.8"), Messages.getString("OpenTextTableProjectsViewMenuAction.9")); } diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/MSCView.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/MSCView.java index abfd9b73cc7b36e2a7611333de88d3badfe48343..137d133d641eefe8837171d327f5302ed6185a34 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/MSCView.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/MSCView.java @@ -540,6 +540,10 @@ public class MSCView extends ViewPart implements ILogViewerView { IAction switchToTextTable = new Action() { @Override public void run() { + if (logFileMetaData == null) { + return; + } + TextTableViewHelper.open(logFileMetaData.getProjectName(), logFileMetaData.getProjectRelativePath(), getSelectedRecordNumber()); } }; diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/StatisticalView.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/StatisticalView.java index f12eae286436d4edc61570ba2d3108f4f61e78b1..d99affb484d0a4715e2bd2b040c8ea59b3c3a78c 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/StatisticalView.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/StatisticalView.java @@ -44,29 +44,10 @@ import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IViewReference; -import org.eclipse.ui.IViewSite; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.forms.events.ExpansionAdapter; -import org.eclipse.ui.forms.events.ExpansionEvent; -import org.eclipse.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.FormToolkit; -import org.eclipse.ui.forms.widgets.ScrolledForm; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.ui.forms.widgets.TableWrapData; -import org.eclipse.ui.forms.widgets.TableWrapLayout; -import org.eclipse.ui.part.ViewPart; - import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.utils.IOUtils; import org.eclipse.titan.log.viewer.Activator; -import org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction; +import org.eclipse.titan.log.viewer.actions.OpenMSCViewAction; import org.eclipse.titan.log.viewer.actions.OpenTextTableStatisticalViewMenuAction; import org.eclipse.titan.log.viewer.exceptions.TechnicalException; import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; @@ -82,6 +63,24 @@ import org.eclipse.titan.log.viewer.utils.Messages; import org.eclipse.titan.log.viewer.views.details.StatisticalData; import org.eclipse.titan.log.viewer.views.navigator.ProjectsViewerMenuListener; import org.eclipse.titan.log.viewer.views.navigator.ProjectsViewerMenuManager; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IViewReference; +import org.eclipse.ui.IViewSite; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.forms.events.ExpansionAdapter; +import org.eclipse.ui.forms.events.ExpansionEvent; +import org.eclipse.ui.forms.widgets.ExpandableComposite; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; +import org.eclipse.ui.forms.widgets.Section; +import org.eclipse.ui.forms.widgets.TableWrapData; +import org.eclipse.ui.forms.widgets.TableWrapLayout; +import org.eclipse.ui.part.ViewPart; /** * This class represents the statistical view @@ -97,7 +96,7 @@ public class StatisticalView extends ViewPart implements ISelectionProvider, ILo private CachedLogReader reader = null; private static final int DEFAULT_COLUMN_WIDTH = 55; private static final int DEFAULT_AMOUNT_COLUMN_WIDTH = 75; - private OpenMSCViewMenuAction openMSCViewMenuAction; + private OpenMSCViewAction openMSCViewAction; private OpenTextTableStatisticalViewMenuAction openTextTableStatisticalViewMenuAction; private List<ISelectionChangedListener> registeredListeners; private TestCase testcaseSelection = null; @@ -440,10 +439,10 @@ public class StatisticalView extends ViewPart implements ISelectionProvider, ILo private void createStatisticalViewContextMenuActions() { - this.openMSCViewMenuAction = new OpenMSCViewMenuAction(); - this.openMSCViewMenuAction.setEnabled(false); - this.openMSCViewMenuAction.setImageDescriptor(Activator.getDefault().getCachedImageDescriptor(Constants.ICONS_MSC_VIEW)); - this.addSelectionChangedListener(openMSCViewMenuAction); + this.openMSCViewAction = new OpenMSCViewAction(); + this.openMSCViewAction.setEnabled(false); + this.openMSCViewAction.setImageDescriptor(Activator.getDefault().getCachedImageDescriptor(Constants.ICONS_MSC_VIEW)); + this.addSelectionChangedListener(openMSCViewAction); this.openTextTableStatisticalViewMenuAction = new OpenTextTableStatisticalViewMenuAction(this); this.openTextTableStatisticalViewMenuAction.setEnabled(false); @@ -470,7 +469,7 @@ public class StatisticalView extends ViewPart implements ISelectionProvider, ILo // MB_ADDITIONS must be added to the menuMgr or platform will // throw a part initialize exception, this will fix this menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - menuManager.add(this.openMSCViewMenuAction); + menuManager.add(this.openMSCViewAction); menuManager.add(this.openTextTableStatisticalViewMenuAction); } diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/SwitchToMscAction.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/SwitchToMscAction.java index 54ab23a4a863cb96f86c017e59bb0d23a9968380..e90ad4312ee3a9ce5ead8784e4929d26e9161e25 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/SwitchToMscAction.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/SwitchToMscAction.java @@ -20,17 +20,16 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; - import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.log.viewer.Activator; -import org.eclipse.titan.log.viewer.actions.OpenMSCViewMenuAction; +import org.eclipse.titan.log.viewer.actions.OpenMSCViewAction; import org.eclipse.titan.log.viewer.extractors.TestCaseExtractor; import org.eclipse.titan.log.viewer.models.LogFileMetaData; import org.eclipse.titan.log.viewer.parsers.data.TestCase; import org.eclipse.titan.log.viewer.utils.Constants; import org.eclipse.titan.log.viewer.utils.LogFileCacheHandler; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; class SwitchToMscAction extends Action { private TextTableView textTableView; @@ -91,7 +90,7 @@ class SwitchToMscAction extends Action { return; } - final OpenMSCViewMenuAction openMSCAction = new OpenMSCViewMenuAction(); + final OpenMSCViewAction openMSCAction = new OpenMSCViewAction(); openMSCAction.selectionChanged(null, new StructuredSelection(testCases.get(testCaseNumber))); openMSCAction.setFirstRow(recordNumber); openMSCAction.run(); diff --git a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/TextTableViewHelper.java b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/TextTableViewHelper.java index a55fbd64742391dc94b46a05d1a4dfe630c60b5d..bda22d447a618e4d9b4a5eacd9ba7d985d2fb02b 100644 --- a/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/TextTableViewHelper.java +++ b/org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/text/table/TextTableViewHelper.java @@ -19,13 +19,6 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IViewReference; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; - import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.log.viewer.exceptions.TechnicalException; import org.eclipse.titan.log.viewer.exceptions.TitanLogExceptionHandler; @@ -37,6 +30,11 @@ import org.eclipse.titan.log.viewer.utils.Constants; import org.eclipse.titan.log.viewer.utils.LogFileCacheHandler; import org.eclipse.titan.log.viewer.utils.Messages; import org.eclipse.titan.log.viewer.views.MSCView; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IViewReference; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; public class TextTableViewHelper { /** @@ -82,7 +80,7 @@ public class TextTableViewHelper { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog.openInformation(new Shell(Display.getDefault()), "View can not be opened.", "Test case extraction is already running on " + logFile.getName()); + MessageDialog.openInformation(null, "View can not be opened.", "Test case extraction is already running on " + logFile.getName()); } }); return null; diff --git a/org.eclipse.titan.regressiontests/META-INF/MANIFEST.MF b/org.eclipse.titan.regressiontests/META-INF/MANIFEST.MF index 32cf471b2ba48e1902b10d36a43894b7e42fa10a..19913a91f575068effc7833b77d1979001d69f5a 100644 --- a/org.eclipse.titan.regressiontests/META-INF/MANIFEST.MF +++ b/org.eclipse.titan.regressiontests/META-INF/MANIFEST.MF @@ -2,8 +2,8 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Test_fragment Fragment Bundle-SymbolicName: org.eclipse.titan.regressiontests;singleton:=true -Bundle-Version: 5.4.1.CRL_113_200_5_R4B_20151202-1100 -Fragment-Host: org.eclipse.titan.designer;bundle-version="5.4.1.CRL_113_200_5_R4B_20151202-1100" +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 +Fragment-Host: org.eclipse.titan.designer;bundle-version="5.4.3.CRL_113_200_5_R4D_20160301-1100" Require-Bundle: org.eclipse.ui, org.eclipse.core.resources, org.junit diff --git a/org.eclipse.titan.regressiontests/build.xml b/org.eclipse.titan.regressiontests/build.xml index f92f77c530017867411e2348143c3bb83232ca22..ce1db9a49302ab6ed8bf472b321ae53cce65bd9c 100644 --- a/org.eclipse.titan.regressiontests/build.xml +++ b/org.eclipse.titan.regressiontests/build.xml @@ -10,7 +10,7 @@ <project basedir="." default="build" name="org.eclipse.titan.regressiontests"> <property environment="env"/> <!-- The qualifier of the features --> - <property name="version" value="5.4.0.CRL_113_200_5_R4A"/> + <property name="version" value="5.4.3.CRL_113_200_5_R4D"/> <tstamp/> <property name="timestamp" value="${DSTAMP}-${TSTAMP}"/> <property name="version.qualifier" value="${version}_${timestamp}"/> @@ -19,8 +19,8 @@ <property name="ECLIPSE_HOME" value="/home/titanrt/eclipse_installed/eclipse-SDK-4.2-linux-gtk-x86_64"/> <property name="debuglevel" value="source,lines,vars"/> - <property name="target" value="1.6"/> - <property name="source" value="1.6"/> + <property name="target" value="1.8"/> + <property name="source" value="1.8"/> <path id="PDE.classpath"> <fileset dir="${ECLIPSE_HOME}/plugins"> <include name="*.jar"/> diff --git a/org.eclipse.titan.regressiontests/fragment.xml b/org.eclipse.titan.regressiontests/fragment.xml index 8950c411e802ffd25526968248520903fa25628e..e074582b221cb51df074adcb73bf59bd58e26fc5 100644 --- a/org.eclipse.titan.regressiontests/fragment.xml +++ b/org.eclipse.titan.regressiontests/fragment.xml @@ -1,48 +1,45 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html --> -<?eclipse version="3.2"?> +<?eclipse version="4.4"?> <fragment> - <extension - point="org.eclipse.ui.popupMenus"> - <objectContribution - id="org.eclipse.titan.regressiontests.tools.ChecklistGenerator" - objectClass="org.eclipse.core.resources.IFile"> - <menu - id="TITAN_popup_Menu" - label="TITAN" - path="additions"> - <separator - name="group2"> - </separator> - </menu> - <action - class="org.eclipse.titan.regressiontests.tools.ChecklistGenerator" - enablesFor="+" - id="org.eclipse.titan.regressiontests.tools.ChecklistGenerator" - label="Generate checklist from file" - menubarPath="TITAN_popup_Menu/group2"> - </action> - </objectContribution> - </extension> - <extension - id="org.eclipse.titan.regressiontests.HeadlessRunner" - name="Headless runner" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titan.regressiontests.HeadlessRunner"> - </run> - </application> - </extension> + <extension point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.titan.regressiontests.tools.ChecklistGenerator" + id="org.eclipse.titan.regressiontests.tools.ChecklistGenerator" + name="Generate checklist from file" /> + </extension> + <extension point="org.eclipse.ui.menus"> + <menuContribution + locationURI="popup:org.eclipse.titan.designer.TitanMenu?endof=additions"> + <command + commandId="org.eclipse.titan.regressiontests.tools.ChecklistGenerator" + id="org.eclipse.titan.regressiontests.tools.ChecklistGenerator" + label="Generate checklist from file" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="and" ifEmpty="false"> + <adapt type="org.eclipse.core.resources.IFile"> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + </menuContribution> + </extension> + <extension id="org.eclipse.titan.regressiontests.HeadlessRunner" + name="Headless runner" point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titan.regressiontests.HeadlessRunner"> + </run> + </application> + </extension> </fragment> diff --git a/org.eclipse.titan.regressiontests/src/org/eclipse/titan/regressiontests/designer/statictests/Basic_tests/AST_tests.java b/org.eclipse.titan.regressiontests/src/org/eclipse/titan/regressiontests/designer/statictests/Basic_tests/AST_tests.java index 3e686d00413a490e3d10e7183c95d824cedaf0c2..ae580baf34f69293434b7b6f343b6aabf88a3d00 100644 --- a/org.eclipse.titan.regressiontests/src/org/eclipse/titan/regressiontests/designer/statictests/Basic_tests/AST_tests.java +++ b/org.eclipse.titan.regressiontests/src/org/eclipse/titan/regressiontests/designer/statictests/Basic_tests/AST_tests.java @@ -1316,7 +1316,7 @@ public class AST_tests { markersToCheck.add(new MarkerToCheck("The second operand of operation `create()' should be a charstring value", lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("There is no visible definition with name `nonExi' in module `expression_tests'", ++lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("Operation `create' should refer to a component type instead of constant `@expression_tests.cg_boolean'", ++lineNum, IMarker.SEVERITY_ERROR)); - markersToCheck.add(new MarkerToCheck("Invalid field reference `nonExi': type `@expression_tests.componentName_CT' does not have fields.", ++lineNum, IMarker.SEVERITY_ERROR)); + markersToCheck.add(new MarkerToCheck("Referencing fields of a component is not allowed", ++lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("Type mismatch: reference to a component type was expected in operation `create' instead of `@expression_tests.myrecof1'", ++lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("Incompatible component type: operation `create' should refer to `@expression_tests.componentName_CT2' instaed of `@expression_tests.componentName_CT'", ++lineNum, IMarker.SEVERITY_ERROR)); lineNum += 5; @@ -6806,7 +6806,7 @@ public class AST_tests { lineNum += 1; for (i = 0; i < 4; i++) { markersToCheck.add(new MarkerToCheck("Component value was expected", lineNum++, IMarker.SEVERITY_ERROR)); } lineNum += 2; - markersToCheck.add(new MarkerToCheck("Invalid field reference `nonExi': type `@value_tests.mycomponent' does not have fields.", lineNum, IMarker.SEVERITY_ERROR)); + markersToCheck.add(new MarkerToCheck("Referencing fields of a component is not allowed", lineNum, IMarker.SEVERITY_ERROR)); lineNum += 1; for (i = 0; i < 3; i++) { markersToCheck.add(new MarkerToCheck("Type `@value_tests.mycomponent' can not be indexed", lineNum++, IMarker.SEVERITY_ERROR)); } markersToCheck.add(new MarkerToCheck("Invalid field reference `nonExi': type `@value_tests.mycomponent' does not have fields.", lineNum, IMarker.SEVERITY_ERROR)); @@ -7142,7 +7142,6 @@ public class AST_tests { markersToCheck.add(new MarkerToCheck("Value list notation cannot be used for set type `@value_tests.mysetType'", ++lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("Too many elements in value list notation for type `@value_tests.myrecordType': 3 was expected instead of 5", ++lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("Duplicate index value `1' for components 2 and 3", ++lineNum, IMarker.SEVERITY_ERROR)); - markersToCheck.add(new MarkerToCheck("Too few elements in the array value: 6 was expected instead of 3", lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("There is no visible definition with name `nonExi' in module `value_tests'", ++lineNum, IMarker.SEVERITY_ERROR)); markersToCheck.add(new MarkerToCheck("Too many elements in the array value: 0 was expected instead of 1", lineNum, IMarker.SEVERITY_ERROR)); lineNum += 2; diff --git a/org.eclipse.titanium.regressiontests/fragment.xml b/org.eclipse.titanium.regressiontests/fragment.xml index 1eb5e6478082ce9848f72a5b84642c56a9c78630..faf65055c5e3347c0287a8b4bb29706b144d8410 100644 --- a/org.eclipse.titanium.regressiontests/fragment.xml +++ b/org.eclipse.titanium.regressiontests/fragment.xml @@ -1,36 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html --> -<?eclipse version="3.4"?> +<?eclipse version="4.4"?> <fragment> - <!--<extension - point="org.eclipse.ui.popupMenus"> - <objectContribution - id="org.eclipse.titanium.regressiontests.tools.ChecklistGenerator" - objectClass="org.eclipse.core.resources.IFile"> - <menu - id="org.eclipse.titanium.menu.ProjectMenu" - label="Titanium testing" - path="additions"> - <separator - name="group2"> - </separator> - </menu> - <action - class="org.eclipse.titanium.regressiontests.tools.ChecklistGenerator" - enablesFor="+" - id="org.eclipse.titanium.regressiontests.tools.ChecklistGenerator" - label="Generate checklist from file" - menubarPath="org.eclipse.titanium.menu.ProjectMenu/group2"> - </action> - </objectContribution> - </extension>--> <extension point="org.eclipse.ui.menus"> <menuContribution diff --git a/org.eclipse.titanium/META-INF/MANIFEST.MF b/org.eclipse.titanium/META-INF/MANIFEST.MF index 18d02f7e743dbae42b7293eb4889d2bf9d792514..c6e70d946c3a69d41bdeba81e0a0440b121ac016 100644 --- a/org.eclipse.titanium/META-INF/MANIFEST.MF +++ b/org.eclipse.titanium/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Titanium Bundle-SymbolicName: org.eclipse.titanium;singleton:=true -Bundle-Version: 5.4.2.CRL_113_200_5_R4C_20160105-1100 +Bundle-Version: 5.4.3.CRL_113_200_5_R4D_20160301-1100 Bundle-Activator: org.eclipse.titanium.Activator Bundle-Vendor: Eclipse Titan Project Require-Bundle: org.eclipse.ui, @@ -14,8 +14,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.ltk.core.refactoring, org.eclipse.ui.forms, - org.eclipse.titan.common;bundle-version="5.4.2", - org.eclipse.titan.designer;bundle-version="5.4.2", + org.eclipse.titan.common;bundle-version="5.4.3", + org.eclipse.titan.designer;bundle-version="5.4.3", org.eclipse.core.filesystem;bundle-version="1.3.200", org.eclipse.core.resources, org.apache.poi;bundle-version="3.9.0" diff --git a/org.eclipse.titanium/plugin.xml b/org.eclipse.titanium/plugin.xml index 1319cf1caf10de9d6f2d7c9e057de5e4ca550ba7..604b8c097f0d9408b3425748b68e45f94fe1feb3 100644 --- a/org.eclipse.titanium/plugin.xml +++ b/org.eclipse.titanium/plugin.xml @@ -1,642 +1,449 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html --> -<?eclipse version="3.4"?> +<?eclipse version="4.4"?> <plugin> <!-- Popup menu in the browser view --> - <!-- extensions of the graph part--> - <extension - point="org.eclipse.ui.editors"> - <editor - class="org.eclipse.titanium.graph.gui.windows.ModuleGraphEditor" - contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor" - default="false" - icon="resources/icons/titan.gif" - id="org.eclipse.titanium.graph.editors.ModuleGraphEditor" - name="module dependency graph"> + <!-- extensions of the graph part --> + <extension point="org.eclipse.ui.editors"> + <editor class="org.eclipse.titanium.graph.gui.windows.ModuleGraphEditor" + contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor" + default="false" icon="resources/icons/titan.gif" + id="org.eclipse.titanium.graph.editors.ModuleGraphEditor" name="module dependency graph"> </editor> <editor - class="org.eclipse.titanium.graph.gui.windows.ComponentGraphEditor" - contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor" - default="false" - icon="resources/icons/titan.gif" - id="org.eclipse.titanium.graph.editors.ComponentGraphEditor" - name="component dependency graph"> + class="org.eclipse.titanium.graph.gui.windows.ComponentGraphEditor" + contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor" + default="false" icon="resources/icons/titan.gif" + id="org.eclipse.titanium.graph.editors.ComponentGraphEditor" name="component dependency graph"> </editor> </extension> - <extension - point="org.eclipse.ui.views"> - <category - id="org.eclipse.titanium" - name="Titanium"> + <extension point="org.eclipse.ui.views"> + <category id="org.eclipse.titanium" name="Titanium"> </category> - <view - allowMultiple="false" - category="org.eclipse.titanium" - class="org.eclipse.titanium.graph.gui.windows.SatelliteView" - icon="resources/icons/titan.gif" - id="org.eclipse.titanium.graph.gui.windows.SatelliteView" - name="Satellite View" - restorable="true"> + <view allowMultiple="false" category="org.eclipse.titanium" + class="org.eclipse.titanium.graph.gui.windows.SatelliteView" icon="resources/icons/titan.gif" + id="org.eclipse.titanium.graph.gui.windows.SatelliteView" name="Satellite View" + restorable="true"> </view> </extension> - - <!-- Metrics, code smell markers and organize import --> - <extension - id="org.eclipse.titanium.applications.ClearAllProjects" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titanium.applications.ClearAllProjects"> - </run> - </application> + + <!-- Metrics, code smell markers and organize import --> + <extension id="org.eclipse.titanium.applications.ClearAllProjects" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titanium.applications.ClearAllProjects"> + </run> + </application> </extension> - <extension - id="org.eclipse.titanium.applications.ImportProjectsFromPrj" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titanium.applications.ImportProjectsFromPrj"> - </run> - </application> + <extension id="org.eclipse.titanium.applications.ImportProjectsFromPrj" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titanium.applications.ImportProjectsFromPrj"> + </run> + </application> </extension> - <extension - id="org.eclipse.titanium.applications.ImportProjectsFromTpd" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titanium.applications.ImportProjectsFromTpd"> - </run> - </application> + <extension id="org.eclipse.titanium.applications.ImportProjectsFromTpd" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titanium.applications.ImportProjectsFromTpd"> + </run> + </application> </extension> - <extension - id="org.eclipse.titanium.applications.ExportAllCodeSmells" + <extension id="org.eclipse.titanium.applications.ExportAllCodeSmells" point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" + <application cardinality="singleton-global" thread="main" visible="true"> - <run - class="org.eclipse.titanium.applications.ExportAllCodeSmells"> + <run class="org.eclipse.titanium.applications.ExportAllCodeSmells"> </run> - </application> + </application> </extension> <extension id="org.eclipse.titanium.applications.ExportAllCodeSmellsToCSV" point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" + <application cardinality="singleton-global" thread="main" visible="true"> - <run - class="org.eclipse.titanium.applications.ExportAllCodeSmellsToCSV"> - </run> - </application> + <run class="org.eclipse.titanium.applications.ExportAllCodeSmellsToCSV"> + </run> + </application> </extension> <extension id="org.eclipse.titanium.applications.MergeExportedMarkerTables" point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" + <application cardinality="singleton-global" thread="main" visible="true"> - <run - class="org.eclipse.titanium.applications.MergeExportedMarkerTables"> + <run class="org.eclipse.titanium.applications.MergeExportedMarkerTables"> </run> </application> </extension> - <extension - id="org.eclipse.titanium.applications.ExportDataForSonar" + <extension id="org.eclipse.titanium.applications.ExportDataForSonar" point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" + <application cardinality="singleton-global" thread="main" visible="true"> - <run - class="org.eclipse.titanium.applications.ExportDataForSonar"> + <run class="org.eclipse.titanium.applications.ExportDataForSonar"> </run> </application> </extension> - + <!-- Preference pages --> - <extension - point="org.eclipse.core.runtime.preferences"> - <initializer class="org.eclipse.titanium.preferences.PreferenceInitializer"/> + <extension point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.titanium.preferences.PreferenceInitializer" /> </extension> <extension point="org.eclipse.ui.preferencePages"> <page id="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage" class="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage" - name="Titanium Preferences"/> + name="Titanium Preferences" /> <page id="org.eclipse.titanium.preferences.pages.OrganizeImportPreferencePage" class="org.eclipse.titanium.preferences.pages.OrganizeImportPreferencePage" name="Imports" - category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage"/> - <page - id="org.eclipse.titanium.preferences.pages.MetricsPreferencePage" + category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage" /> + <page id="org.eclipse.titanium.preferences.pages.MetricsPreferencePage" class="org.eclipse.titanium.preferences.pages.MetricsPreferencePage" name="Metrics" - category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage"/> - <page - id="org.eclipse.titanium.preferences.pages.MarkersPreferencePage" + category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage" /> + <page id="org.eclipse.titanium.preferences.pages.MarkersPreferencePage" class="org.eclipse.titanium.preferences.pages.MarkersPreferencePage" name="Code smells" - category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage"/> + category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage" /> <page id="org.eclipse.titanium.preferences.pages.RiskFactorPreferencePage" class="org.eclipse.titanium.preferences.pages.RiskFactorPreferencePage" name="Project risk factor" - category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage"/> + category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage" /> <page id="org.eclipse.titanium.preferences.pages.MetricsLimitPreferencePage" class="org.eclipse.titanium.preferences.pages.MetricsLimitPreferencePage" name="Limits" - category="org.eclipse.titanium.preferences.pages.MetricsPreferencePage"/> + category="org.eclipse.titanium.preferences.pages.MetricsPreferencePage" /> <page id="org.eclipse.titanium.preferences.pages.MetricsViewPreferencePage" class="org.eclipse.titanium.preferences.pages.MetricsViewPreferencePage" name="Metrics view" - category="org.eclipse.titanium.preferences.pages.MetricsPreferencePage"/> + category="org.eclipse.titanium.preferences.pages.MetricsPreferencePage" /> <page id="org.eclipse.titanium.preferences.pages.ModuleGraphPreferencePage" class="org.eclipse.titanium.preferences.pages.GraphMetricsPage" - name="Metrics" - category="org.eclipse.titanium.preferences.pages.GraphPreferencePage"/> - <page - id="org.eclipse.titanium.preferences.pages.GraphPreferencePage" + name="Metrics" category="org.eclipse.titanium.preferences.pages.GraphPreferencePage" /> + <page id="org.eclipse.titanium.preferences.pages.GraphPreferencePage" class="org.eclipse.titanium.preferences.pages.GraphPreferencePage" name="Graph" - category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage"/> - <page - id="org.eclipse.titanium.ClusterCategory" + category="org.eclipse.titanium.preferences.pages.TitaniumPreferencePage" /> + <page id="org.eclipse.titanium.ClusterCategory" class="org.eclipse.titanium.preferences.pages.GraphClusterPage" - name="Clusters" - category="org.eclipse.titanium.preferences.pages.GraphPreferencePage"/> + name="Clusters" category="org.eclipse.titanium.preferences.pages.GraphPreferencePage" /> <page id="org.eclipse.titanium.preferences.pages.GraphClusterFolderNamePage" class="org.eclipse.titanium.preferences.pages.GraphClusterFolderNamePage" - name="Using module location" - category="org.eclipse.titanium.ClusterCategory"/> + name="Using module location" category="org.eclipse.titanium.ClusterCategory" /> <page id="org.eclipse.titanium.preferences.pages.GraphClusterRegexpPage" class="org.eclipse.titanium.preferences.pages.GraphClusterRegexpPage" - name="Using regular expressions" - category="org.eclipse.titanium.ClusterCategory"/> - <page - id="org.eclipse.titanium.preferences.pages.GraphClusterAutoPage" + name="Using regular expressions" category="org.eclipse.titanium.ClusterCategory" /> + <page id="org.eclipse.titanium.preferences.pages.GraphClusterAutoPage" class="org.eclipse.titanium.preferences.pages.GraphClusterAutoPage" - name="Automatic method" - category="org.eclipse.titanium.ClusterCategory"/> + name="Automatic method" category="org.eclipse.titanium.ClusterCategory" /> <page id="org.eclipse.titanium.preferences.pages.GraphClusterModuleNamePage" class="org.eclipse.titanium.preferences.pages.GraphClusterModuleNamePage" - name="Using module names" - category="org.eclipse.titanium.ClusterCategory"/> - <page - category="org.eclipse.titanium.preferences.pages.MarkersPreferencePage" - class="org.eclipse.titanium.preferences.pages.RepairTimePage" - id="org.eclipse.titanium.preferences.pages.RepairTimePage" - name="Code smell repair times"> + name="Using module names" category="org.eclipse.titanium.ClusterCategory" /> + <page category="org.eclipse.titanium.preferences.pages.MarkersPreferencePage" + class="org.eclipse.titanium.preferences.pages.RepairTimePage" id="org.eclipse.titanium.preferences.pages.RepairTimePage" + name="Code smell repair times"> </page> </extension> - <extension - point="org.eclipse.ui.preferenceTransfer"> - <transfer - icon="resources/icons/titan.gif" - name="Titanium preferences" + <extension point="org.eclipse.ui.preferenceTransfer"> + <transfer icon="resources/icons/titan.gif" name="Titanium preferences" id="org.eclipse.titanium.preferences.export.all"> <mapping scope="instance"> - <entry node="org.eclipse.titanium"/> + <entry node="org.eclipse.titanium" /> </mapping> <description> -Export preferences of Titanium, including setting of - - organize import - - code smells - - source code metrics + Export preferences of Titanium, including setting of + - organize import + - code smells + - source code metrics </description> </transfer> </extension> - + <!-- Commands --> - <extension - point="org.eclipse.ui.commands"> - <category - id="org.eclipse.titanium.commands.Commands" - name="Titanium commands"/> - <command - categoryId="org.eclipse.titanium.commands.Commands" + <extension point="org.eclipse.ui.commands"> + <category id="org.eclipse.titanium.commands.Commands" name="Titanium commands" /> + <command categoryId="org.eclipse.titanium.commands.Commands" description="Add necessary and remove unused imports. Effects of this action can be tuned in the Titanium > Imports preference page." - id="org.eclipse.titanium.commands.OrganizeImportsCommand" - name="Organize imports"/> - <command - categoryId="org.eclipse.titanium.commands.Commands" - description="Check a module for code smells" - id="org.eclipse.titanium.commands.CheckCodeSmellsCommand" + id="org.eclipse.titanium.commands.OrganizeImportsCommand" name="Organize imports" /> + <command categoryId="org.eclipse.titanium.commands.Commands" + description="Check a module for code smells" id="org.eclipse.titanium.commands.CheckCodeSmellsCommand" defaultHandler="org.eclipse.titanium.actions.CheckCodeSmells" - name="Check code smells"/> - <command - categoryId="org.eclipse.titanium.commands.Commands" - description="Search for graph node" - id="org.eclipse.titanium.commands.GraphSearch" - name="Graph Search"> + name="Check code smells" /> + <command categoryId="org.eclipse.titanium.commands.Commands" + description="Search for graph node" id="org.eclipse.titanium.commands.GraphSearch" + name="Graph Search"> </command> - <command - categoryId="org.eclipse.titanium.commands.Commands" - description="Save graph to pajek" - id="org.eclipse.titanium.commands.GraphSave" - name="GraphSave"> + <command categoryId="org.eclipse.titanium.commands.Commands" + description="Save graph to pajek" id="org.eclipse.titanium.commands.GraphSave" + name="GraphSave"> </command> - <command - categoryId="org.eclipse.titanium.commands.Commands" - description="Export of graph to image" - id="org.eclipse.titanium.commands.GraphExport" - name="GraphExport"> + <command categoryId="org.eclipse.titanium.commands.Commands" + description="Export of graph to image" id="org.eclipse.titanium.commands.GraphExport" + name="GraphExport"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.ModuleGraphAction" - id="org.eclipse.titanium.actions.ModuleGraphAction" - name="GenerateModuleGraph"> + <command defaultHandler="org.eclipse.titanium.actions.ModuleGraphAction" + id="org.eclipse.titanium.actions.ModuleGraphAction" name="GenerateModuleGraph"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.ComponentGraphAction" - id="org.eclipse.titanium.actions.ComponentGraphAction" - name="GenerateComponentGraph"> + <command defaultHandler="org.eclipse.titanium.actions.ComponentGraphAction" + id="org.eclipse.titanium.actions.ComponentGraphAction" name="GenerateComponentGraph"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.ExportProblems" - id="org.eclipse.titanium.actions.ExportProblems" - name="ExportMarkers"> + <command defaultHandler="org.eclipse.titanium.actions.ExportProblems" + id="org.eclipse.titanium.actions.ExportProblems" name="ExportMarkers"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.ExportDataForSonarAction" - id="org.eclipse.titanium.actions.ExportDataForSonarAction" - name="ExportDataForSonarAction"> + <command defaultHandler="org.eclipse.titanium.actions.ExportDataForSonarAction" + id="org.eclipse.titanium.actions.ExportDataForSonarAction" name="ExportDataForSonarAction"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.MetricsViewOpener" - id="org.eclipse.titanium.actions.ViewMetrics" - name="ViewMetrics"> + <command defaultHandler="org.eclipse.titanium.actions.MetricsViewOpener" + id="org.eclipse.titanium.actions.ViewMetrics" name="ViewMetrics"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.TopViewOpener" - id="org.eclipse.titanium.actions.ViewTopRiskMetrics" - name="ViewTopRiskMetrics"> + <command defaultHandler="org.eclipse.titanium.actions.TopViewOpener" + id="org.eclipse.titanium.actions.ViewTopRiskMetrics" name="ViewTopRiskMetrics"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.OrganizeFromBrowser" - id="org.eclipse.titanium.actions.OrganizeFromBrowser" - name="OrganizeFromBrowser"> + <command defaultHandler="org.eclipse.titanium.actions.OrganizeFromBrowser" + id="org.eclipse.titanium.actions.OrganizeFromBrowser" name="OrganizeFromBrowser"> </command> - <command - defaultHandler="org.eclipse.titanium.actions.OrganizeFromEditor" - id="org.eclipse.titanium.commands.OrganizeImports" - name="OrganizeImports"> + <command defaultHandler="org.eclipse.titanium.actions.OrganizeFromEditor" + id="org.eclipse.titanium.commands.OrganizeImports" name="OrganizeImports"> </command> </extension> - + <!-- Key bindings --> - <extension - point="org.eclipse.ui.bindings"> - <key - commandId="org.eclipse.titanium.commands.OrganizeImportsCommand" + <extension point="org.eclipse.ui.bindings"> + <key commandId="org.eclipse.titanium.commands.OrganizeImportsCommand" contextId="org.eclipse.titan.designer.editors.TTCN3EditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+SHIFT+O"/> - <key - commandId="org.eclipse.titanium.commands.GraphSearch" - contextId="org.eclipse.titanium.contexts.GraphContext" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+F"> + sequence="CTRL+SHIFT+O" /> + <key commandId="org.eclipse.titanium.commands.GraphSearch" + contextId="org.eclipse.titanium.contexts.GraphContext" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" + sequence="CTRL+F"> </key> - <key - commandId="org.eclipse.titanium.commands.GraphSave" - contextId="org.eclipse.titanium.contexts.GraphContext" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+S"> + <key commandId="org.eclipse.titanium.commands.GraphSave" + contextId="org.eclipse.titanium.contexts.GraphContext" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" + sequence="CTRL+S"> </key> - <key - commandId="org.eclipse.titanium.commands.GraphExport" - contextId="org.eclipse.titanium.contexts.GraphContext" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+E"> + <key commandId="org.eclipse.titanium.commands.GraphExport" + contextId="org.eclipse.titanium.contexts.GraphContext" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" + sequence="CTRL+E"> </key> </extension> - - <!-- Editor actions --> - - <!-- Views--> - <extension - point="org.eclipse.ui.views"> - <view - id="org.eclipse.titanium.metrics.view" - name="Metrics View" - icon="resources/icons/metrics_view.gif" - class="org.eclipse.titanium.metrics.view.MetricsView" - category="org.eclipse.titanium"/> - <view - id="org.eclipse.titanium.metrics.topview" - name="Top riskiest modules" - icon="resources/icons/metrics_top_worst.gif" - class="org.eclipse.titanium.metrics.topview.TopView" - category="org.eclipse.titanium"/> + + <!-- Editor actions --> + + <!-- Views --> + <extension point="org.eclipse.ui.views"> + <view id="org.eclipse.titanium.metrics.view" name="Metrics View" + icon="resources/icons/metrics_view.gif" class="org.eclipse.titanium.metrics.view.MetricsView" + category="org.eclipse.titanium" /> + <view id="org.eclipse.titanium.metrics.topview" name="Top riskiest modules" + icon="resources/icons/metrics_top_worst.gif" class="org.eclipse.titanium.metrics.topview.TopView" + category="org.eclipse.titanium" /> </extension> - <extension - point="org.eclipse.core.resources.markers" - id="org.eclipse.titanium.markers.CodeSmellMarker" - name="Titanium code smells"> - <super type="org.eclipse.core.resources.problemmarker"/> - <attribute name="problem"/> + <extension point="org.eclipse.core.resources.markers" + id="org.eclipse.titanium.markers.CodeSmellMarker" name="Titanium code smells"> + <super type="org.eclipse.core.resources.problemmarker" /> + <attribute name="problem" /> </extension> - <extension - point="org.eclipse.core.resources.markers" - id="org.eclipse.titanium.markers.ProjectCodeSmellMarker" - name="Titanium code smells (global to project)"> - <super type="org.eclipse.titanium.markers.CodeSmellMarker"/> - <attribute name="problem"/> + <extension point="org.eclipse.core.resources.markers" + id="org.eclipse.titanium.markers.ProjectCodeSmellMarker" name="Titanium code smells (global to project)"> + <super type="org.eclipse.titanium.markers.CodeSmellMarker" /> + <attribute name="problem" /> </extension> - <extension - point="org.eclipse.core.resources.markers" - id="org.eclipse.titanium.markers.ModuleCodeSmellMarker" - name="Titanium code smells (local to a module)"> - <super type="org.eclipse.titanium.markers.CodeSmellMarker"/> - <attribute name="problem"/> + <extension point="org.eclipse.core.resources.markers" + id="org.eclipse.titanium.markers.ModuleCodeSmellMarker" name="Titanium code smells (local to a module)"> + <super type="org.eclipse.titanium.markers.CodeSmellMarker" /> + <attribute name="problem" /> </extension> - - <extension - id="org.eclipse.titanium.applications.SaveModuleNet" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titanium.applications.SaveModuleNet"> - </run> + + <extension id="org.eclipse.titanium.applications.SaveModuleNet" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titanium.applications.SaveModuleNet"> + </run> </application> </extension> - <extension - point="org.eclipse.titan.designer.extensions.post_analyze"> - <client - class="org.eclipse.titanium.markers.utils.ExecuteAnalyzer"> + <extension point="org.eclipse.titan.designer.extensions.post_analyze"> + <client class="org.eclipse.titanium.markers.utils.ExecuteAnalyzer"> </client> </extension> <extension point="org.eclipse.help.toc"> - <toc file="toc.xml" primary="true"/> + <toc file="toc.xml" primary="true" /> </extension> - <extension - point="org.eclipse.ui.contexts"> - <context - id="org.eclipse.titanium.contexts.GraphContext" - name="GraphEditorContext" - parentId="org.eclipse.ui.contexts.window"> - </context> + <extension point="org.eclipse.ui.contexts"> + <context id="org.eclipse.titanium.contexts.GraphContext" + name="GraphEditorContext" parentId="org.eclipse.ui.contexts.window"> + </context> </extension> - <extension - id="org.eclipse.titanium.applications.SaveComponentNet" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titanium.applications.SaveComponentNet"> - </run> - </application> + <extension id="org.eclipse.titanium.applications.SaveComponentNet" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titanium.applications.SaveComponentNet"> + </run> + </application> </extension> - <extension - point="org.eclipse.ui.menus"> - <menuContribution - locationURI="popup:org.eclipse.ui.popup.any?after=additions"> - <menu - id="org.eclipse.titanium.menu.ProjectMenu2" - label="Titanium"> - <command - commandId="org.eclipse.titanium.actions.OrganizeFromBrowser" - label="Organize imports" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IResource"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <separator - name="metrics" - visible="true"> - </separator> - <command - commandId="org.eclipse.titanium.actions.ViewMetrics" - label="View metrics" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titanium.actions.ViewTopRiskMetrics" - label="View top risk metrics" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <separator - name="marker" - visible="true"> - </separator> - <command - commandId="org.eclipse.titanium.actions.ExportProblems" - label="Export problem markers to xls" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IResource"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titanium.actions.ExportDataForSonarAction" - label="Export data for SonarQube" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <separator - name="graph" - visible="true"> - </separator> - <command - commandId="org.eclipse.titanium.actions.ModuleGraphAction" - label="Draw module structure" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - <command - commandId="org.eclipse.titanium.actions.ComponentGraphAction" - label="Draw component structure" - mode="FORCE_TEXT"> - <visibleWhen - checkEnabled="false"> - <with - variable="selection"> - <iterate - operator="or"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="org.eclipse.titan.designer.core.TITANNature"> - </test> - </adapt> - </iterate> - </with> - </visibleWhen> - </command> - </menu> - </menuContribution> - <menuContribution - allPopups="true" - locationURI="popup:org.eclipse.titan.designer.editors.ttcn3editor.context?after=additions"> - <menu - label="Titanium"> - <command - commandId="org.eclipse.titanium.commands.OrganizeImports" - icon="resources/icons/titan.gif" - id="org.eclipse.titanium.commands.OrganizeImports" - label="Organize imports"> - </command> - </menu> - </menuContribution> - <menuContribution - allPopups="true" - locationURI="popup:org.eclipse.titan.designer.editors.ttcn3ppeditor.context?after=additions"> - <menu - label="Titanium"> - <command - commandId="org.eclipse.titanium.commands.OrganizeImports" - icon="resources/icons/titan.gif" - id="org.eclipse.titanium.commands.OrganizeImports" - label="Organize imports"> - </command> - </menu> - </menuContribution> + <extension point="org.eclipse.ui.menus"> + <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions"> + <menu id="org.eclipse.titanium.menu.ProjectMenu2" label="Titanium"> + <command commandId="org.eclipse.titanium.actions.OrganizeFromBrowser" + label="Organize imports" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IResource"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <separator name="metrics" visible="true"> + </separator> + <command commandId="org.eclipse.titanium.actions.ViewMetrics" + label="View metrics" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command commandId="org.eclipse.titanium.actions.ViewTopRiskMetrics" + label="View top risk metrics" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <separator name="marker" visible="true"> + </separator> + <command commandId="org.eclipse.titanium.actions.ExportProblems" + label="Export problem markers to xls" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IResource"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command commandId="org.eclipse.titanium.actions.ExportDataForSonarAction" + label="Export data for SonarQube" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <separator name="graph" visible="true"> + </separator> + <command commandId="org.eclipse.titanium.actions.ModuleGraphAction" + label="Draw module structure" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + <command commandId="org.eclipse.titanium.actions.ComponentGraphAction" + label="Draw component structure" mode="FORCE_TEXT"> + <visibleWhen checkEnabled="false"> + <with variable="selection"> + <iterate operator="or"> + <adapt type="org.eclipse.core.resources.IProject"> + <test property="org.eclipse.core.resources.projectNature" + value="org.eclipse.titan.designer.core.TITANNature"> + </test> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + </menu> + </menuContribution> + <menuContribution allPopups="true" + locationURI="popup:org.eclipse.titan.designer.editors.ttcn3editor.context?after=additions"> + <menu label="Titanium"> + <command commandId="org.eclipse.titanium.commands.OrganizeImports" + icon="resources/icons/titan.gif" id="org.eclipse.titanium.commands.OrganizeImports" + label="Organize imports"> + </command> + </menu> + </menuContribution> + <menuContribution allPopups="true" + locationURI="popup:org.eclipse.titan.designer.editors.ttcn3ppeditor.context?after=additions"> + <menu label="Titanium"> + <command commandId="org.eclipse.titanium.commands.OrganizeImports" + icon="resources/icons/titan.gif" id="org.eclipse.titanium.commands.OrganizeImports" + label="Organize imports"> + </command> + </menu> + </menuContribution> </extension> - <extension - id="org.eclipse.titanium.applications.SaveModuleDot" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titanium.applications.SaveModuleDot"> - </run> - </application> + <extension id="org.eclipse.titanium.applications.SaveModuleDot" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titanium.applications.SaveModuleDot"> + </run> + </application> </extension> - <extension - id="org.eclipse.titanium.applications.SaveComponentDot" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.titanium.applications.SaveComponentDot"> - </run> - </application> + <extension id="org.eclipse.titanium.applications.SaveComponentDot" + point="org.eclipse.core.runtime.applications"> + <application cardinality="singleton-global" thread="main" + visible="true"> + <run class="org.eclipse.titanium.applications.SaveComponentDot"> + </run> + </application> </extension> </plugin> diff --git a/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromBrowser.java b/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromBrowser.java index 594672a44fc503d1201181442fd739d0028a205a..c5212a15cb2067ca5f38d4e4a7607b955e219b10 100644 --- a/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromBrowser.java +++ b/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromBrowser.java @@ -223,7 +223,6 @@ class OrganizeImportsOp implements IRunnableWithProgress { } for (IProject project : projects) { - GlobalParser.getProjectSourceParser(project).setFullSemanticAnalysisNeeded(); GlobalParser.getProjectSourceParser(project).analyzeAll(); } diff --git a/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromEditor.java b/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromEditor.java index a09fab36820936e34acb03b120d8a62dffacd7c7..f045d98456f1a32dab1d3bb2abd21c118c832562 100644 --- a/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromEditor.java +++ b/org.eclipse.titanium/src/org/eclipse/titanium/actions/OrganizeFromEditor.java @@ -14,15 +14,12 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Platform; import org.eclipse.jface.action.IAction; import org.eclipse.ltk.core.refactoring.TextFileChange; import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.designer.editors.ttcn3editor.TTCN3Editor; import org.eclipse.titan.designer.editors.ttcnppeditor.TTCNPPEditor; import org.eclipse.titan.designer.parsers.GlobalParser; -import org.eclipse.titan.designer.preferences.PreferenceConstants; -import org.eclipse.titan.designer.productUtilities.ProductConstants; import org.eclipse.titanium.organize.OrganizeImports; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.PlatformUI; @@ -41,14 +38,8 @@ public final class OrganizeFromEditor extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); - final boolean enableRiskyRefactoring = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, - PreferenceConstants.ENABLERISKYREFACTORING, false, null); - if(!enableRiskyRefactoring) { - ErrorReporter.logError("Risky refactoring is not enabled!"); - return null; - } - if (editor == null || !(editor instanceof TTCN3Editor || (editor instanceof TTCNPPEditor && enableRiskyRefactoring))) { + if (editor == null || !(editor instanceof TTCN3Editor || (editor instanceof TTCNPPEditor))) { ErrorReporter.logError("The editor is not found or not a Titan TTCN-3 editor"); return null; } diff --git a/org.eclipse.titanium/src/org/eclipse/titanium/error/ErrorMessage.java b/org.eclipse.titanium/src/org/eclipse/titanium/error/ErrorMessage.java index 9ae326a03f88a8b80af3d1dba1d3205e80ddac60..6b5bae64547fc1900b9fc7008cf6711d49d6bee7 100644 --- a/org.eclipse.titanium/src/org/eclipse/titanium/error/ErrorMessage.java +++ b/org.eclipse.titanium/src/org/eclipse/titanium/error/ErrorMessage.java @@ -10,7 +10,6 @@ package org.eclipse.titanium.error; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.dialogs.PreferencesUtil; /** @@ -47,14 +46,14 @@ public class ErrorMessage { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog err = new MessageDialog(new Shell(Display.getDefault()), windowTitle, null, message, dialogType, + MessageDialog err = new MessageDialog(null, windowTitle, null, message, dialogType, new String[] { IDialogConstants.OK_LABEL, buttonTitle }, 0) { @Override protected void buttonPressed(int buttonId) { super.buttonPressed(buttonId); if (buttonId == 1) { - PreferencesUtil.createPreferenceDialogOn(new Shell(Display.getDefault()), pageName, null, + PreferencesUtil.createPreferenceDialogOn(null, pageName, null, null).open(); } } @@ -78,7 +77,7 @@ public class ErrorMessage { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - MessageDialog err = new MessageDialog(new Shell(Display.getDefault()), title, null, message, dialogType, + MessageDialog err = new MessageDialog(null, title, null, message, dialogType, new String[] { IDialogConstants.OK_LABEL }, 0); err.open(); } diff --git a/org.eclipse.titanium/src/org/eclipse/titanium/markers/spotters/implementation/UnusedStartedRefFuncRetVal.java b/org.eclipse.titanium/src/org/eclipse/titanium/markers/spotters/implementation/UnusedStartedRefFuncRetVal.java index ee32b7ee4b8e397c521d5898f34a7003a5a11013..ea3c2f1514b0b7c7c7224fcefe161a9195c80170 100644 --- a/org.eclipse.titanium/src/org/eclipse/titanium/markers/spotters/implementation/UnusedStartedRefFuncRetVal.java +++ b/org.eclipse.titanium/src/org/eclipse/titanium/markers/spotters/implementation/UnusedStartedRefFuncRetVal.java @@ -40,14 +40,14 @@ public class UnusedStartedRefFuncRetVal extends BaseModuleCodeSmellSpotter { CompilationTimeStamp timestamp = CompilationTimeStamp.getBaseTimestamp(); Start_Referenced_Component_Statement s = (Start_Referenced_Component_Statement) node; - Value dereferedValue = s.getDereferedValue(); - if (dereferedValue == null) { + Value dereferredValue = s.getDereferredValue(); + if (dereferredValue == null) { return; } - switch (dereferedValue.getValuetype()) { + switch (dereferredValue.getValuetype()) { case EXPRESSION_VALUE: - if (Operation_type.REFERS_OPERATION.equals(((Expression_Value) dereferedValue).getOperationType())) { + if (Operation_type.REFERS_OPERATION.equals(((Expression_Value) dereferredValue).getOperationType())) { return; } break; @@ -58,7 +58,7 @@ public class UnusedStartedRefFuncRetVal extends BaseModuleCodeSmellSpotter { break; } - IType type = dereferedValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE); + IType type = dereferredValue.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE); if (type != null) { type = type.getTypeRefdLast(timestamp); } @@ -110,7 +110,7 @@ public class UnusedStartedRefFuncRetVal extends BaseModuleCodeSmellSpotter { if (!returnTypeCorrect) { String msg = MessageFormat.format(PROBLEM, functionType.getTypename(), returnType.getTypename()); - problems.report(dereferedValue.getLocation(), msg); + problems.report(dereferredValue.getLocation(), msg); } } } diff --git a/org.eclipse.titanium/src/org/eclipse/titanium/organize/OrganizeImports.java b/org.eclipse.titanium/src/org/eclipse/titanium/organize/OrganizeImports.java index 97679f49d6d769af4e2ab56ae5d146a4e649f360..b4fe9e607bf016a8e26c1bfd016e0f1cf0c44cc8 100644 --- a/org.eclipse.titanium/src/org/eclipse/titanium/organize/OrganizeImports.java +++ b/org.eclipse.titanium/src/org/eclipse/titanium/organize/OrganizeImports.java @@ -89,7 +89,7 @@ public final class OrganizeImports { */ public static Location findReferenceInProject(final Reference reference, final IProject project) { ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(project); - DeclarationCollector declarationCollector = new DeclarationCollector(reference, projectSourceParser); + DeclarationCollector declarationCollector = new DeclarationCollector(reference); for (String moduleName : projectSourceParser.getKnownModuleNames()) { Module m = projectSourceParser.getModuleByName(moduleName); if (m != null) { diff --git a/org.eclipse.titanium/src/org/eclipse/titanium/preferences/pages/MarkersPreferencePage.java b/org.eclipse.titanium/src/org/eclipse/titanium/preferences/pages/MarkersPreferencePage.java index 2ce09246087253a96ed4430a7313debf3bbbf605..0655f892eeca521a3ef1ce0fde77e59b6cb87504 100644 --- a/org.eclipse.titanium/src/org/eclipse/titanium/preferences/pages/MarkersPreferencePage.java +++ b/org.eclipse.titanium/src/org/eclipse/titanium/preferences/pages/MarkersPreferencePage.java @@ -108,8 +108,8 @@ public final class MarkersPreferencePage extends FieldEditorPreferencePage imple m.put(ProblemTypePreference.MAGIC_CONSTANTS, "It is always recommended to extract local literal values into constants and use the constants in the code.\n" + "Since otherwise sooner or later it will be forgotten what that exact value was meaning"); - m.put(ProblemTypePreference.MISSING_FRIEND, "When the module refered to in a friend declaration could not be found.."); - m.put(ProblemTypePreference.MISSING_IMPORT, "When a module refered to in an import statement could not be found."); + m.put(ProblemTypePreference.MISSING_FRIEND, "When the module referred to in a friend declaration could not be found.."); + m.put(ProblemTypePreference.MISSING_IMPORT, "When a module referred to in an import statement could not be found."); m.put(ProblemTypePreference.MODULENAME_IN_DEFINITION, "As definitions can be referenced in the modulename.identifier format," + " it is of no value if the name of the module is duplicated in the name of the definition\n" + "But makes it longer"); diff --git a/org.eclipse.titanium/toc.xml b/org.eclipse.titanium/toc.xml index 4209f2bb943c1967e149d83095bbbe64ab6a376f..f62585fcd90424badfbd947b2735ac9802537160 100644 --- a/org.eclipse.titanium/toc.xml +++ b/org.eclipse.titanium/toc.xml @@ -1,15 +1,15 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2000-2015 Ericsson Telecom AB + Copyright (c) 2000-2016 Ericsson Telecom AB All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html --> -<?NLS TYPE="org.eclipse.help.toc"?> - -<toc label="Titanium Help"> +<?NLS TYPE="org.eclipse.help.toc"?> + +<toc label="Titanium Help"> <topic label="Titanium Description" href="docs/Titanium_Description.doc" /> <topic label="Titanium Reference Guide" href="docs/referenceguide.docx" /> </toc> \ No newline at end of file