From a16fbf9649dd5ac5e36da689b61712d78facf8b3 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 26 Oct 2009 18:48:28 +0300 Subject: [PATCH 01/18] IDEADEV-41003 --- .../src/messages/ActionsBundle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties index fced9ee99ce5..b05f74365044 100644 --- a/platform/platform-resources-en/src/messages/ActionsBundle.properties +++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties @@ -1144,8 +1144,8 @@ group.ProjectViewPopupMenu.text=Project View Popup Menu group.FavoritesViewPopupMenu.text=Favorites View Popup Menu group.CommanderViewPopupMenu.text=Commander View Popup Menu group.NavbarPopupMenu.text=Navigation Bar -action.NewInspectionsInLatestVersion.text=What's new in IDEA 8 -action.NewInspectionsInLatestVersion.description=Show inspections new in IDEA 8 +action.NewInspectionsInLatestVersion.text=What's new in IDEA 9 +action.NewInspectionsInLatestVersion.description=Show inspections new in IDEA 9 action.RerunFailedTests.text=Rerun Failed Tests action.RerunFailedTests.description=Run only tests that failed/crashed after last run group.AnalyzeJavaMenu.text=Analyze Java Menu From cc24b6828c61da89da8c25c98b34ca09126da500 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 26 Oct 2009 18:52:28 +0300 Subject: [PATCH 02/18] write thread dumps to correct directory (IDEADEV-40838) --- .../src/com/intellij/diagnostic/PerformanceWatcher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java b/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java index 2757f8302768..8445c049e4a7 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java @@ -82,8 +82,8 @@ public class PerformanceWatcher implements ApplicationComponent { } }); - myLogDir = new File(PathManager.getSystemPath() + "/log/threadDumps-" + myDateFormat.format(new Date()) - + "-" + ApplicationInfo.getInstance().getBuildNumber()); + myLogDir = new File(PathManager.getLogPath() + "/threadDumps-" + myDateFormat.format(new Date()) + + "-" + ApplicationInfo.getInstance().getBuild().asString()); myLogDir.mkdirs(); myCurHangLogDir = myLogDir; myThreadMXBean = ManagementFactory.getThreadMXBean(); From 85035da9fadb9f7e75b61c423ff880ba45c95ade Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Thu, 22 Oct 2009 17:10:41 +0400 Subject: [PATCH 03/18] Git: background roots update --- .../src/git4idea/vfs/GitRootTracker.java | 201 ++++++++++-------- 1 file changed, 114 insertions(+), 87 deletions(-) diff --git a/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java b/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java index c1a5417c7aad..41da7cfd1eb4 100644 --- a/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java +++ b/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java @@ -26,16 +26,13 @@ import com.intellij.openapi.command.CommandAdapter; import com.intellij.openapi.command.CommandEvent; import com.intellij.openapi.command.CommandListener; import com.intellij.openapi.command.CommandProcessor; -import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.progress.ProgressIndicator; -import com.intellij.openapi.progress.ProgressManager; -import com.intellij.openapi.progress.Task; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ModuleRootEvent; import com.intellij.openapi.roots.ModuleRootListener; import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.startup.StartupManager; import com.intellij.openapi.ui.Messages; +import com.intellij.openapi.util.Computable; import com.intellij.openapi.vcs.ProjectLevelVcsManager; import com.intellij.openapi.vcs.VcsDirectoryMapping; import com.intellij.openapi.vcs.VcsListener; @@ -61,9 +58,6 @@ import java.util.concurrent.atomic.AtomicBoolean; * shows balloon that notifies user about the problem and offers to correct root mapping. */ public class GitRootTracker implements VcsListener { - - private static final Logger LOG = Logger.getInstance("#git4idea.vfs.GitRootTracker"); - /** * The context project */ @@ -97,6 +91,8 @@ public class GitRootTracker implements VcsListener { */ private final AtomicBoolean myNotificationPosted = new AtomicBoolean(false); + private final Object myCheckRootsLock = new Object(); + private Notification myNotification; /** @@ -159,7 +155,7 @@ public class GitRootTracker implements VcsListener { if (!myRootsInvalidated.compareAndSet(true, false)) { return; } - checkRoots(false); + scheduleRootsCheck(false); } }; CommandProcessor.getInstance().addCommandListener(myCommandListener); @@ -172,14 +168,14 @@ public class GitRootTracker implements VcsListener { if (!myRootsInvalidated.compareAndSet(true, false)) { return; } - checkRoots(false); + scheduleRootsCheck(false); } }; fileManager.addVirtualFileManagerListener(myVirtualFileManagerListener); - StartupManager.getInstance(myProject).registerPostStartupActivity(new Runnable() { + StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new Runnable() { public void run() { myIsEnabled.set(true); - checkRoots(true); + scheduleRootsCheck(true); } }); } @@ -200,10 +196,23 @@ public class GitRootTracker implements VcsListener { * {@inheritDoc} */ public void directoryMappingChanged() { - if (myProject.isDisposed()) { + scheduleRootsCheck(true); + } + + private void scheduleRootsCheck(final boolean rootsChanged) { + if (ApplicationManager.getApplication().isUnitTestMode() || ApplicationManager.getApplication().isHeadlessEnvironment()) { + doCheckRoots(rootsChanged); return; } - checkRoots(true); + + ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { + public void run() { + synchronized (myCheckRootsLock) { + if (myProject.isDisposed()) return; + doCheckRoots(rootsChanged); + } + } + }); } /** @@ -211,63 +220,53 @@ public class GitRootTracker implements VcsListener { * * @param rootsChanged */ - private void checkRoots(boolean rootsChanged) { + private void doCheckRoots(boolean rootsChanged) { if (!myIsEnabled.get() || (!rootsChanged && !myHasGitRoots.get())) { return; } - ProgressManager.getInstance().run(new Task.Backgroundable(myProject, "Checking unmapped Git roots...") { - @Override - public void run(@NotNull ProgressIndicator indicator) { - ApplicationManager.getApplication().runReadAction(new Runnable() { - public void run() { - LOG.info("Checking unmapped Git roots..."); - long start = System.currentTimeMillis(); - doCheck(); - LOG.info("Unmapped Git roots checked in " + (System.currentTimeMillis() - start) + "ms"); + + final boolean[] hasInvalidRoots = {false}; + final HashSet rootSet = new HashSet(); + ApplicationManager.getApplication().runReadAction(new Runnable() { + public void run() { + for (VcsDirectoryMapping m : myVcsManager.getDirectoryMappings()) { + if (!m.getVcs().equals(myVcs.getName())) { + continue; } - }); - myMulticaster.gitRootsChanged(); + String path = m.getDirectory(); + if (path.length() == 0) { + VirtualFile baseDir = myProject.getBaseDir(); + assert baseDir != null; + path = baseDir.getPath(); + } + VirtualFile root = lookupFile(path); + if (root == null) { + hasInvalidRoots[0] = true; + break; + } + else { + rootSet.add(root.getPath()); + } + } } }); - } - private void doCheck() { - boolean hasInvalidRoots = false; - HashSet rootSet = new HashSet(); - for (VcsDirectoryMapping m : myVcsManager.getDirectoryMappings()) { - if (!m.getVcs().equals(myVcs.getName())) { - continue; - } - String path = m.getDirectory(); - if (path.length() == 0) { - VirtualFile baseDir = myProject.getBaseDir(); - assert baseDir != null; - path = baseDir.getPath(); - } - VirtualFile root = lookupFile(path); - if (root == null) { - hasInvalidRoots = true; - break; - } - else { - rootSet.add(root.getPath()); - } - } - if (!hasInvalidRoots && rootSet.isEmpty()) { + if (!hasInvalidRoots[0] && rootSet.isEmpty()) { myHasGitRoots.set(false); return; } else { myHasGitRoots.set(true); } - if (!hasInvalidRoots) { + + if (!hasInvalidRoots[0]) { // check if roots have a problem loop: for (String path : rootSet) { - VirtualFile root = lookupFile(path); - VirtualFile gitRoot = GitUtil.gitRootOrNull(root); - if (gitRoot == null || hasUnmappedSubroots(root, true, rootSet)) { - hasInvalidRoots = true; + VirtualFile root = lookupFileInReadAction(path); + VirtualFile gitRoot = getGitRootInReadAction(root); + if (gitRoot == null || hasUnmappedSubroots(root, rootSet)) { + hasInvalidRoots[0] = true; break; } for (String otherPath : rootSet) { @@ -275,46 +274,59 @@ public class GitRootTracker implements VcsListener { continue; } if (otherPath.startsWith(path)) { - VirtualFile otherFile = lookupFile(otherPath); + VirtualFile otherFile = lookupFileInReadAction(otherPath); if (otherFile == null) { - hasInvalidRoots = true; + hasInvalidRoots[0] = true; break loop; } - VirtualFile otherRoot = GitUtil.gitRootOrNull(otherFile); + VirtualFile otherRoot = getGitRootInReadAction(otherFile); if (otherRoot == null || otherRoot == root || otherFile != otherRoot) { - hasInvalidRoots = true; + hasInvalidRoots[0] = true; break loop; } } } } } - if (!hasInvalidRoots) { - // all roots are correct - if (myNotificationPosted.compareAndSet(true, false)) { - if (myNotification != null) { - if (!myNotification.isExpired()) { - myNotification.expire(); - } + ApplicationManager.getApplication().invokeLater(new Runnable() { + public void run() { + if (!hasInvalidRoots[0]) { + // all roots are correct + if (myNotificationPosted.compareAndSet(true, false)) { + if (myNotification != null) { + if (!myNotification.isExpired()) { + myNotification.expire(); + } - myNotification = null; - } - } - return; - } - if (myNotificationPosted.compareAndSet(false, true)) { - myNotification = new Notification(GIT_INVALID_ROOTS_ID, GitBundle.getString("root.tracker.message.title"), - GitBundle.getString("root.tracker.message"), - NotificationType.ERROR, new NotificationListener() { - public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) { - if (fixRoots()) { - notification.expire(); + myNotification = null; } } - }); + return; + } + if (myNotificationPosted.compareAndSet(false, true)) { + myNotification = new Notification(GIT_INVALID_ROOTS_ID, GitBundle.getString("root.tracker.message.title"), + GitBundle.getString("root.tracker.message"), + NotificationType.ERROR, new NotificationListener() { + public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) { + if (fixRoots()) { + notification.expire(); + } + } + }); - Notifications.Bus.notify(myNotification, myProject); - } + Notifications.Bus.notify(myNotification, myProject); + } + myMulticaster.gitRootsChanged(); + } + }); + } + + private VirtualFile getGitRootInReadAction(final VirtualFile root) { + return ApplicationManager.getApplication().runReadAction(new Computable() { + public VirtualFile compute() { + return GitUtil.gitRootOrNull(root); + } + }); } /** @@ -324,14 +336,21 @@ public class GitRootTracker implements VcsListener { * @param rootSet the mapped root set * @return true if there are unmapped subroots */ - private static boolean hasUnmappedSubroots(VirtualFile directory, boolean isRoot, HashSet rootSet) { - for (VirtualFile child : directory.getChildren()) { - if (child.getName().equals(".git")) { - if (isRoot || !child.isDirectory()) - continue; - return !rootSet.contains(directory.getPath()); + private static boolean hasUnmappedSubroots(final VirtualFile directory, HashSet rootSet) { + VirtualFile[] children = ApplicationManager.getApplication().runReadAction(new Computable() { + public VirtualFile[] compute() { + return directory.getChildren(); } - if (child.isDirectory() && hasUnmappedSubroots(child, false, rootSet)) { + }); + + for (VirtualFile child : children) { + if (child.getName().equals(".git") || !child.isDirectory()) { + continue; + } + if (child.findChild(".git") != null && !rootSet.contains(child.getPath())) { + return true; + } + if (hasUnmappedSubroots(child, rootSet)) { return true; } } @@ -440,6 +459,14 @@ public class GitRootTracker implements VcsListener { return myLocalFileSystem.findFileByPath(path); } + private VirtualFile lookupFileInReadAction(final String path) { + return ApplicationManager.getApplication().runReadAction(new Computable() { + public VirtualFile compute() { + return lookupFile(path); + } + }); + } + /** * Add subroots for the content root * From fc18ca4c7f2be7a2adeb41bec857b819e4b6211e Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Fri, 23 Oct 2009 18:18:39 +0400 Subject: [PATCH 04/18] git: backgound roots check++ --- .../src/git4idea/vfs/GitRootTracker.java | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java b/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java index 41da7cfd1eb4..4f846f580f40 100644 --- a/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java +++ b/plugins/git4idea/src/git4idea/vfs/GitRootTracker.java @@ -305,14 +305,15 @@ public class GitRootTracker implements VcsListener { } if (myNotificationPosted.compareAndSet(false, true)) { myNotification = new Notification(GIT_INVALID_ROOTS_ID, GitBundle.getString("root.tracker.message.title"), - GitBundle.getString("root.tracker.message"), - NotificationType.ERROR, new NotificationListener() { - public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) { - if (fixRoots()) { - notification.expire(); - } - } - }); + GitBundle.getString("root.tracker.message"), NotificationType.ERROR, + new NotificationListener() { + public void hyperlinkUpdate(@NotNull Notification notification, + @NotNull HyperlinkEvent event) { + if (fixRoots()) { + notification.expire(); + } + } + }); Notifications.Bus.notify(myNotification, myProject); } @@ -336,18 +337,24 @@ public class GitRootTracker implements VcsListener { * @param rootSet the mapped root set * @return true if there are unmapped subroots */ - private static boolean hasUnmappedSubroots(final VirtualFile directory, HashSet rootSet) { + private static boolean hasUnmappedSubroots(final VirtualFile directory, final HashSet rootSet) { VirtualFile[] children = ApplicationManager.getApplication().runReadAction(new Computable() { public VirtualFile[] compute() { return directory.getChildren(); } }); - for (VirtualFile child : children) { + for (final VirtualFile child : children) { if (child.getName().equals(".git") || !child.isDirectory()) { continue; } - if (child.findChild(".git") != null && !rootSet.contains(child.getPath())) { + boolean hasUnmapped = ApplicationManager.getApplication().runReadAction(new Computable() { + public Boolean compute() { + if (child.isValid()) return false; + return child.findChild(".git") != null && !rootSet.contains(child.getPath()); + } + }); + if (hasUnmapped) { return true; } if (hasUnmappedSubroots(child, rootSet)) { From 1e817e07c265430c7bf131cf3fd0f3b329ba2bda Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Wed, 14 Oct 2009 11:53:06 +0400 Subject: [PATCH 05/18] Maven: infinite recursion fix --- .../maven/importing/MavenBaseModifiableModelsProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenBaseModifiableModelsProvider.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenBaseModifiableModelsProvider.java index 08d1a4ada56f..c34c4e0d351d 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenBaseModifiableModelsProvider.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenBaseModifiableModelsProvider.java @@ -162,11 +162,11 @@ public abstract class MavenBaseModifiableModelsProvider implements MavenModifiab } public ModuleRootModel getRootModel(Module module) { - return getRootModel(module); + return MavenBaseModifiableModelsProvider.this.getRootModel(module); } public FacetModel getFacetModel(Module module) { - return getFacetModel(module); + return MavenBaseModifiableModelsProvider.this.getFacetModel(module); } } From af08dfc93953bcf0330a8145b06e784a61a025c6 Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Wed, 14 Oct 2009 11:55:12 +0400 Subject: [PATCH 06/18] Settings: keymap label binded to the chooser --- .../src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java index 5486135e6470..f0001836964f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java @@ -135,11 +135,13 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable { private JPanel createKeymapListPanel() { JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); - panel.add(new JLabel(KeyMapBundle.message("keymaps.border.factory.title")), new GridBagConstraints(0,0, 1, 1, 0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,2,0,0), 0,0)); myKeymapList = new JComboBox(myKeymapListModel); myKeymapList.setEditor(new MyEditor()); myKeymapList.setRenderer(new MyKeymapRenderer()); + JLabel keymapLabel = new JLabel(KeyMapBundle.message("keymaps.border.factory.title")); + keymapLabel.setLabelFor(myKeymapList); + panel.add(keymapLabel, new GridBagConstraints(0,0, 1, 1, 0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,2,0,0), 0,0)); panel.add(myKeymapList, new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,4,0,0),0,0)); panel.add(createKeymapButtonsPanel(), new GridBagConstraints(2,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,0),0,0)); From 7998adf5b5e485c3489212b429aa6bc902016108 Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Wed, 21 Oct 2009 14:13:53 +0400 Subject: [PATCH 07/18] Actions: do not hide non-dumb-aware actions, just disable them --- .../src/com/intellij/openapi/actionSystem/ex/ActionUtil.java | 1 - 1 file changed, 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java index f1e3716d4705..f66748dfb773 100644 --- a/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java +++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java @@ -114,7 +114,6 @@ public class ActionUtil { presentation.putClientProperty(WAS_ENABLED_BEFORE_DUMB, enabledBeforeUpdate); } presentation.setEnabled(false); - presentation.setVisible(false); } } From 38484eb58249677e0a033b4036fb091486e9fe04 Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Mon, 26 Oct 2009 19:10:04 +0300 Subject: [PATCH 08/18] fix tests: do not throw exception on empty extension if in headless or unit-tests mode --- .../impl/stores/StateStorageManagerImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StateStorageManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StateStorageManagerImpl.java index 36c993fe3527..30f4261ec00a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StateStorageManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StateStorageManagerImpl.java @@ -16,6 +16,7 @@ package com.intellij.openapi.components.impl.stores; import com.intellij.openapi.Disposable; +import com.intellij.openapi.application.ex.ApplicationEx; import com.intellij.openapi.application.ex.ApplicationManagerEx; import com.intellij.openapi.components.*; import com.intellij.openapi.diagnostic.Logger; @@ -48,6 +49,13 @@ public abstract class StateStorageManagerImpl implements StateStorageManager, Di private static final Logger LOG = Logger.getInstance("#" + StateStorageManagerImpl.class.getName()); + private static final boolean ourHeadlessEnvironment; + + static { + final ApplicationEx ex = ApplicationManagerEx.getApplicationEx(); + ourHeadlessEnvironment = ex.isHeadlessEnvironment() || ex.isUnitTestMode(); + } + private final Map myMacros = new HashMap(); private final Map myStorages = new HashMap(); private final Map myPathToStorage = new HashMap(); @@ -269,7 +277,7 @@ public abstract class StateStorageManagerImpl implements StateStorageManager, Di } final String extension = FileUtil.getExtension(new File(expandedFile).getName()); - if (extension.length() == 0) { + if (!ourHeadlessEnvironment && extension.length() == 0) { throw new IllegalArgumentException("Extension is missing for storage file: " + expandedFile); } From d2f6432cc53d9b2271b44ce4ad78d77b2e0ac2ce Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Mon, 26 Oct 2009 18:58:52 +0300 Subject: [PATCH 09/18] xhtml conditional comments injection take 2 --- .../src/com/intellij/lexer/_XmlLexer.java | 5 + .../src/com/intellij/lexer/__XmlLexer.java | 695 ++++++++++-------- 2 files changed, 373 insertions(+), 327 deletions(-) diff --git a/xml/impl/src/com/intellij/lexer/_XmlLexer.java b/xml/impl/src/com/intellij/lexer/_XmlLexer.java index fb8c9a00af9e..d78deb86e315 100644 --- a/xml/impl/src/com/intellij/lexer/_XmlLexer.java +++ b/xml/impl/src/com/intellij/lexer/_XmlLexer.java @@ -23,7 +23,12 @@ public class _XmlLexer extends FlexAdapter { private int myState = __XmlLexer.YYINITIAL; public _XmlLexer(final __XmlLexer flexLexer) { + this(flexLexer, false); + } + + public _XmlLexer(final __XmlLexer flexLexer, final boolean conditionalCommentsSupport) { super(flexLexer); + flexLexer.setConditionalCommentsSupport(conditionalCommentsSupport); } private void packState() { diff --git a/xml/impl/src/com/intellij/lexer/__XmlLexer.java b/xml/impl/src/com/intellij/lexer/__XmlLexer.java index 205b197a5f32..42c7d9c8eb34 100644 --- a/xml/impl/src/com/intellij/lexer/__XmlLexer.java +++ b/xml/impl/src/com/intellij/lexer/__XmlLexer.java @@ -1,20 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* The following code was generated by JFlex 1.4.1 on 9/1/07 12:05 PM */ +/* The following code was generated by JFlex 1.4.1 on 10/26/09 6:47 PM */ /* It's an automatically generated code. Do not modify it. */ package com.intellij.lexer; @@ -27,8 +11,8 @@ import com.intellij.psi.xml.XmlTokenType; /** * This class is a scanner generated by * JFlex 1.4.1 - * on 9/1/07 12:05 PM from the specification file - * C:/work/Irida/tools/lexer/_XmlLexer.flex + * on 10/26/09 6:47 PM from the specification file + * /Users/spleaner/ideadev/tools/lexer/_XmlLexer.flex */ public class __XmlLexer implements FlexLexer { /** initial size of the lookahead buffer */ @@ -39,6 +23,7 @@ public class __XmlLexer implements FlexLexer { public static final int ATTR_LIST = 6; public static final int END_TAG = 4; public static final int ATTR_VALUE_DQ = 9; + public static final int C_COMMENT_END = 14; public static final int DTD_MARKUP = 8; public static final int CDATA = 12; public static final int ATTR = 7; @@ -48,75 +33,76 @@ public class __XmlLexer implements FlexLexer { public static final int YYINITIAL = 0; public static final int COMMENT = 5; public static final int DOCTYPE = 11; + public static final int C_COMMENT_START = 13; public static final int ATTR_VALUE_SQ = 10; /** * Translates characters to character classes */ private static final String ZZ_CMAP_PACKED = - "\11\0\2\3\1\0\2\3\22\0\1\3\1\13\1\55\1\6\1\4"+ - "\1\63\1\23\1\56\5\0\1\10\1\7\1\61\12\2\1\11\1\26"+ - "\1\12\1\62\1\22\1\57\1\0\1\17\1\52\1\15\1\16\1\46"+ - "\1\42\2\1\1\54\2\1\1\53\1\50\1\1\1\43\1\45\2\1"+ - "\1\47\1\20\1\51\3\1\1\44\1\1\1\14\1\64\1\21\1\0"+ - "\1\1\1\0\1\30\1\37\4\42\1\27\4\1\1\24\1\40\1\36"+ - "\1\32\1\31\1\34\1\1\1\33\1\25\1\35\2\1\1\41\2\1"+ - "\1\5\1\0\1\60\54\0\1\1\12\0\1\1\4\0\1\1\5\0"+ - "\27\1\1\0\37\1\1\0\u013f\1\31\0\162\1\4\0\14\1\16\0"+ - "\5\1\11\0\1\1\213\0\1\1\13\0\1\1\1\0\3\1\1\0"+ - "\1\1\1\0\24\1\1\0\54\1\1\0\46\1\1\0\5\1\4\0"+ - "\202\1\10\0\105\1\1\0\46\1\2\0\2\1\6\0\20\1\41\0"+ - "\46\1\2\0\1\1\7\0\47\1\110\0\33\1\5\0\3\1\56\0"+ - "\32\1\5\0\13\1\43\0\2\1\1\0\143\1\1\0\1\1\17\0"+ - "\2\1\7\0\2\1\12\0\3\1\2\0\1\1\20\0\1\1\1\0"+ - "\36\1\35\0\3\1\60\0\46\1\13\0\1\1\u0152\0\66\1\3\0"+ - "\1\1\22\0\1\1\7\0\12\1\43\0\10\1\2\0\2\1\2\0"+ - "\26\1\1\0\7\1\1\0\1\1\3\0\4\1\3\0\1\1\36\0"+ - "\2\1\1\0\3\1\16\0\2\1\23\0\6\1\4\0\2\1\2\0"+ - "\26\1\1\0\7\1\1\0\2\1\1\0\2\1\1\0\2\1\37\0"+ - "\4\1\1\0\1\1\23\0\3\1\20\0\11\1\1\0\3\1\1\0"+ - "\26\1\1\0\7\1\1\0\2\1\1\0\5\1\3\0\1\1\22\0"+ - "\1\1\17\0\2\1\43\0\10\1\2\0\2\1\2\0\26\1\1\0"+ - "\7\1\1\0\2\1\1\0\5\1\3\0\1\1\36\0\2\1\1\0"+ - "\3\1\17\0\1\1\21\0\1\1\1\0\6\1\3\0\3\1\1\0"+ - "\4\1\3\0\2\1\1\0\1\1\1\0\2\1\3\0\2\1\3\0"+ - "\3\1\3\0\10\1\1\0\3\1\113\0\10\1\1\0\3\1\1\0"+ - "\27\1\1\0\12\1\1\0\5\1\46\0\2\1\43\0\10\1\1\0"+ - "\3\1\1\0\27\1\1\0\12\1\1\0\5\1\3\0\1\1\40\0"+ - "\1\1\1\0\2\1\43\0\10\1\1\0\3\1\1\0\27\1\1\0"+ - "\20\1\46\0\2\1\43\0\22\1\3\0\30\1\1\0\11\1\1\0"+ - "\1\1\2\0\7\1\72\0\60\1\1\0\2\1\14\0\7\1\72\0"+ - "\2\1\1\0\1\1\2\0\2\1\1\0\1\1\2\0\1\1\6\0"+ - "\4\1\1\0\7\1\1\0\3\1\1\0\1\1\1\0\1\1\2\0"+ - "\2\1\1\0\4\1\1\0\2\1\11\0\1\1\2\0\5\1\1\0"+ - "\1\1\25\0\2\1\42\0\1\1\77\0\10\1\1\0\42\1\35\0"+ - "\4\1\164\0\42\1\1\0\5\1\1\0\2\1\45\0\6\1\112\0"+ - "\46\1\12\0\51\1\7\0\132\1\5\0\104\1\5\0\122\1\6\0"+ - "\7\1\1\0\77\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0"+ - "\1\1\1\0\4\1\2\0\47\1\1\0\1\1\1\0\4\1\2\0"+ - "\37\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0\1\1\1\0"+ - "\4\1\2\0\7\1\1\0\7\1\1\0\27\1\1\0\37\1\1\0"+ - "\1\1\1\0\4\1\2\0\7\1\1\0\47\1\1\0\23\1\105\0"+ - "\125\1\14\0\u026c\1\2\0\10\1\12\0\32\1\5\0\113\1\25\0"+ - "\15\1\1\0\4\1\16\0\22\1\16\0\22\1\16\0\15\1\1\0"+ - "\3\1\17\0\64\1\43\0\1\1\4\0\1\1\103\0\130\1\10\0"+ - "\51\1\127\0\35\1\63\0\36\1\2\0\5\1\u038b\0\154\1\224\0"+ - "\234\1\4\0\132\1\6\0\26\1\2\0\6\1\2\0\46\1\2\0"+ - "\6\1\2\0\10\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+ - "\37\1\2\0\65\1\1\0\7\1\1\0\1\1\3\0\3\1\1\0"+ - "\7\1\3\0\4\1\2\0\6\1\4\0\15\1\5\0\3\1\1\0"+ - "\7\1\164\0\1\1\15\0\1\1\202\0\1\1\4\0\1\1\2\0"+ - "\12\1\1\0\1\1\3\0\5\1\6\0\1\1\1\0\1\1\1\0"+ - "\1\1\1\0\4\1\1\0\3\1\1\0\7\1\3\0\3\1\5\0"+ - "\5\1\u0ebb\0\2\1\52\0\5\1\5\0\2\1\4\0\126\1\6\0"+ - "\3\1\1\0\132\1\1\0\4\1\5\0\50\1\4\0\136\1\21\0"+ - "\30\1\70\0\20\1\u0200\0\u19b6\1\112\0\u51a6\1\132\0\u048d\1\u0773\0"+ - "\u2ba4\1\u215c\0\u012e\1\2\0\73\1\225\0\7\1\14\0\5\1\5\0"+ - "\1\1\1\0\12\1\1\0\15\1\1\0\5\1\1\0\1\1\1\0"+ - "\2\1\1\0\2\1\1\0\154\1\41\0\u016b\1\22\0\100\1\2\0"+ - "\66\1\50\0\14\1\164\0\5\1\1\0\207\1\44\0\32\1\6\0"+ - "\32\1\13\0\131\1\3\0\6\1\2\0\6\1\2\0\6\1\2\0"+ - "\3\1\43\0"; + "\11\0\2\3\1\0\2\3\22\0\1\3\1\15\1\57\1\6\1\4"+ + "\1\65\1\16\1\60\1\14\1\14\3\0\1\11\1\10\1\63\12\2"+ + "\1\12\1\30\1\17\1\64\1\13\1\61\1\0\1\23\1\54\1\21"+ + "\1\22\1\50\1\44\2\1\1\56\2\1\1\55\1\52\1\1\1\45"+ + "\1\47\2\1\1\51\1\24\1\53\3\1\1\46\1\1\1\20\1\66"+ + "\1\25\1\0\1\7\1\0\1\32\1\41\4\44\1\31\4\1\1\26"+ + "\1\42\1\40\1\34\1\33\1\36\1\1\1\35\1\27\1\37\2\1"+ + "\1\43\2\1\1\5\1\14\1\62\54\0\1\1\12\0\1\1\4\0"+ + "\1\1\5\0\27\1\1\0\37\1\1\0\u013f\1\31\0\162\1\4\0"+ + "\14\1\16\0\5\1\11\0\1\1\213\0\1\1\13\0\1\1\1\0"+ + "\3\1\1\0\1\1\1\0\24\1\1\0\54\1\1\0\46\1\1\0"+ + "\5\1\4\0\202\1\10\0\105\1\1\0\46\1\2\0\2\1\6\0"+ + "\20\1\41\0\46\1\2\0\1\1\7\0\47\1\110\0\33\1\5\0"+ + "\3\1\56\0\32\1\5\0\13\1\43\0\2\1\1\0\143\1\1\0"+ + "\1\1\17\0\2\1\7\0\2\1\12\0\3\1\2\0\1\1\20\0"+ + "\1\1\1\0\36\1\35\0\3\1\60\0\46\1\13\0\1\1\u0152\0"+ + "\66\1\3\0\1\1\22\0\1\1\7\0\12\1\43\0\10\1\2\0"+ + "\2\1\2\0\26\1\1\0\7\1\1\0\1\1\3\0\4\1\3\0"+ + "\1\1\36\0\2\1\1\0\3\1\16\0\2\1\23\0\6\1\4\0"+ + "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\1\0\2\1\1\0"+ + "\2\1\37\0\4\1\1\0\1\1\23\0\3\1\20\0\11\1\1\0"+ + "\3\1\1\0\26\1\1\0\7\1\1\0\2\1\1\0\5\1\3\0"+ + "\1\1\22\0\1\1\17\0\2\1\43\0\10\1\2\0\2\1\2\0"+ + "\26\1\1\0\7\1\1\0\2\1\1\0\5\1\3\0\1\1\36\0"+ + "\2\1\1\0\3\1\17\0\1\1\21\0\1\1\1\0\6\1\3\0"+ + "\3\1\1\0\4\1\3\0\2\1\1\0\1\1\1\0\2\1\3\0"+ + "\2\1\3\0\3\1\3\0\10\1\1\0\3\1\113\0\10\1\1\0"+ + "\3\1\1\0\27\1\1\0\12\1\1\0\5\1\46\0\2\1\43\0"+ + "\10\1\1\0\3\1\1\0\27\1\1\0\12\1\1\0\5\1\3\0"+ + "\1\1\40\0\1\1\1\0\2\1\43\0\10\1\1\0\3\1\1\0"+ + "\27\1\1\0\20\1\46\0\2\1\43\0\22\1\3\0\30\1\1\0"+ + "\11\1\1\0\1\1\2\0\7\1\72\0\60\1\1\0\2\1\14\0"+ + "\7\1\72\0\2\1\1\0\1\1\2\0\2\1\1\0\1\1\2\0"+ + "\1\1\6\0\4\1\1\0\7\1\1\0\3\1\1\0\1\1\1\0"+ + "\1\1\2\0\2\1\1\0\4\1\1\0\2\1\11\0\1\1\2\0"+ + "\5\1\1\0\1\1\25\0\2\1\42\0\1\1\77\0\10\1\1\0"+ + "\42\1\35\0\4\1\164\0\42\1\1\0\5\1\1\0\2\1\45\0"+ + "\6\1\112\0\46\1\12\0\51\1\7\0\132\1\5\0\104\1\5\0"+ + "\122\1\6\0\7\1\1\0\77\1\1\0\1\1\1\0\4\1\2\0"+ + "\7\1\1\0\1\1\1\0\4\1\2\0\47\1\1\0\1\1\1\0"+ + "\4\1\2\0\37\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0"+ + "\1\1\1\0\4\1\2\0\7\1\1\0\7\1\1\0\27\1\1\0"+ + "\37\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0\47\1\1\0"+ + "\23\1\105\0\125\1\14\0\u026c\1\2\0\10\1\12\0\32\1\5\0"+ + "\113\1\25\0\15\1\1\0\4\1\16\0\22\1\16\0\22\1\16\0"+ + "\15\1\1\0\3\1\17\0\64\1\43\0\1\1\4\0\1\1\103\0"+ + "\130\1\10\0\51\1\127\0\35\1\63\0\36\1\2\0\5\1\u038b\0"+ + "\154\1\224\0\234\1\4\0\132\1\6\0\26\1\2\0\6\1\2\0"+ + "\46\1\2\0\6\1\2\0\10\1\1\0\1\1\1\0\1\1\1\0"+ + "\1\1\1\0\37\1\2\0\65\1\1\0\7\1\1\0\1\1\3\0"+ + "\3\1\1\0\7\1\3\0\4\1\2\0\6\1\4\0\15\1\5\0"+ + "\3\1\1\0\7\1\164\0\1\1\15\0\1\1\202\0\1\1\4\0"+ + "\1\1\2\0\12\1\1\0\1\1\3\0\5\1\6\0\1\1\1\0"+ + "\1\1\1\0\1\1\1\0\4\1\1\0\3\1\1\0\7\1\3\0"+ + "\3\1\5\0\5\1\u0ebb\0\2\1\52\0\5\1\5\0\2\1\4\0"+ + "\126\1\6\0\3\1\1\0\132\1\1\0\4\1\5\0\50\1\4\0"+ + "\136\1\21\0\30\1\70\0\20\1\u0200\0\u19b6\1\112\0\u51a6\1\132\0"+ + "\u048d\1\u0773\0\u2ba4\1\u215c\0\u012e\1\2\0\73\1\225\0\7\1\14\0"+ + "\5\1\5\0\1\1\1\0\12\1\1\0\15\1\1\0\5\1\1\0"+ + "\1\1\1\0\2\1\1\0\2\1\1\0\154\1\41\0\u016b\1\22\0"+ + "\100\1\2\0\66\1\50\0\14\1\164\0\5\1\1\0\207\1\44\0"+ + "\32\1\6\0\32\1\13\0\131\1\3\0\6\1\2\0\6\1\2\0"+ + "\6\1\2\0\3\1\43\0"; /** * Translates characters to character classes @@ -129,19 +115,19 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = - "\1\1\4\0\1\2\7\0\1\1\1\3\1\1\1\4"+ - "\1\5\1\1\1\5\1\6\1\7\1\5\1\10\1\5"+ - "\2\11\1\5\4\12\1\13\1\2\1\14\1\15\3\16"+ - "\1\17\1\20\1\21\3\22\1\14\1\23\3\22\1\5"+ - "\1\24\2\13\2\5\2\1\2\0\1\25\1\26\6\0"+ - "\1\6\1\0\1\27\2\11\1\30\1\13\2\0\1\15"+ - "\5\0\1\31\1\0\2\13\3\0\1\32\4\0\1\33"+ - "\7\0\1\34\1\35\1\36\1\37\2\13\1\40\1\41"+ - "\2\0\1\42\2\0\2\13\2\0\2\13\2\0\1\43"+ - "\1\44\4\0\1\45\1\46"; + "\1\1\16\0\1\1\1\2\1\1\1\3\1\4\1\1"+ + "\1\3\1\5\1\6\1\7\2\3\2\10\1\3\4\11"+ + "\1\12\3\13\1\14\1\15\3\16\1\17\1\20\1\21"+ + "\2\22\1\23\1\22\1\24\3\22\1\25\1\3\2\12"+ + "\2\3\2\1\1\26\1\13\4\26\1\27\10\0\1\30"+ + "\1\31\1\5\1\0\1\32\2\10\1\33\1\12\2\0"+ + "\1\15\5\0\1\34\1\0\2\12\3\0\1\35\1\36"+ + "\1\0\1\37\12\0\1\40\1\41\1\42\1\43\1\44"+ + "\2\12\1\45\1\46\2\0\1\47\2\0\2\12\2\0"+ + "\2\12\2\0\1\50\1\51\4\0\1\52\1\53"; private static int [] zzUnpackAction() { - int [] result = new int[132]; + int [] result = new int[145]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -166,26 +152,28 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); private static final String ZZ_ROWMAP_PACKED_0 = - "\0\0\0\65\0\152\0\237\0\324\0\u0109\0\u013e\0\u0173"+ - "\0\u01a8\0\u01dd\0\u0212\0\u0247\0\u027c\0\u02b1\0\u02e6\0\u031b"+ - "\0\u0350\0\u0385\0\u03ba\0\u03ef\0\u0424\0\u0459\0\u048e\0\u03ef"+ - "\0\u04c3\0\u04f8\0\u052d\0\u0562\0\u03ef\0\u048e\0\u0385\0\u0562"+ - "\0\u0597\0\u05cc\0\u0601\0\u0636\0\u03ef\0\u048e\0\u0385\0\u03ef"+ - "\0\u03ef\0\u03ef\0\u03ef\0\u066b\0\u048e\0\u0385\0\u03ef\0\u06a0"+ - "\0\u06d5\0\u070a\0\u073f\0\u03ef\0\u0774\0\u07a9\0\u07de\0\u0813"+ - "\0\u03ef\0\u0848\0\u087d\0\u08b2\0\u03ef\0\u03ef\0\u08e7\0\u091c"+ - "\0\u0951\0\u0986\0\u09bb\0\u09f0\0\u0a25\0\u0a5a\0\u03ef\0\u0a8f"+ - "\0\u0ac4\0\u03ef\0\u0af9\0\u0b2e\0\u0b63\0\u0b98\0\u0bcd\0\u0c02"+ - "\0\u0c37\0\u0c6c\0\u073f\0\u03ef\0\u0ca1\0\u0cd6\0\u0d0b\0\u07de"+ - "\0\u0813\0\u0d40\0\u03ef\0\u0d75\0\u0daa\0\u0ddf\0\u0e14\0\u03ef"+ - "\0\u0e49\0\u0e7e\0\u0eb3\0\u0ee8\0\u0f1d\0\u0f52\0\u0f87\0\u04f8"+ - "\0\u03ef\0\u03ef\0\u03ef\0\u0fbc\0\u0ff1\0\u03ef\0\u03ef\0\u1026"+ - "\0\u105b\0\u03ef\0\u1090\0\u10c5\0\u10fa\0\u112f\0\u1164\0\u1199"+ - "\0\u11ce\0\u1203\0\u1238\0\u126d\0\u0597\0\u0597\0\u12a2\0\u12d7"+ - "\0\u130c\0\u1341\0\u03ef\0\u03ef"; + "\0\0\0\67\0\156\0\245\0\334\0\u0113\0\u014a\0\u0181"+ + "\0\u01b8\0\u01ef\0\u0226\0\u025d\0\u0294\0\u02cb\0\u0302\0\u0339"+ + "\0\u0370\0\u03a7\0\u03de\0\u0415\0\u044c\0\u0483\0\u04ba\0\u04f1"+ + "\0\u0483\0\u0528\0\u055f\0\u0596\0\u05cd\0\u0604\0\u0483\0\u03de"+ + "\0\u0528\0\u0604\0\u063b\0\u0483\0\u0672\0\u06a9\0\u0483\0\u06e0"+ + "\0\u0483\0\u03de\0\u0528\0\u0483\0\u0483\0\u0483\0\u0483\0\u0717"+ + "\0\u03de\0\u0528\0\u0483\0\u074e\0\u0785\0\u07bc\0\u0483\0\u07f3"+ + "\0\u082a\0\u0861\0\u0898\0\u08cf\0\u0483\0\u0906\0\u0483\0\u093d"+ + "\0\u0672\0\u03de\0\u0528\0\u0974\0\u0483\0\u09ab\0\u09e2\0\u0a19"+ + "\0\u0a50\0\u0a87\0\u0abe\0\u0af5\0\u0b2c\0\u0483\0\u0483\0\u0b63"+ + "\0\u0b9a\0\u0483\0\u0bd1\0\u0c08\0\u0483\0\u0c3f\0\u0c76\0\u0cad"+ + "\0\u0ce4\0\u0d1b\0\u0d52\0\u0d89\0\u0dc0\0\u07f3\0\u0483\0\u0df7"+ + "\0\u0e2e\0\u0e65\0\u0898\0\u08cf\0\u0e9c\0\u0483\0\u0483\0\u0ed3"+ + "\0\u0483\0\u0f0a\0\u0f41\0\u0f78\0\u0faf\0\u0fe6\0\u101d\0\u1054"+ + "\0\u108b\0\u10c2\0\u10f9\0\u0596\0\u0483\0\u0483\0\u0483\0\u0483"+ + "\0\u1130\0\u1167\0\u0483\0\u0483\0\u119e\0\u11d5\0\u0483\0\u120c"+ + "\0\u1243\0\u127a\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4"+ + "\0\u13fb\0\u063b\0\u063b\0\u1432\0\u1469\0\u14a0\0\u14d7\0\u0483"+ + "\0\u0483"; private static int [] zzUnpackRowMap() { - int [] result = new int[132]; + int [] result = new int[145]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -208,101 +196,106 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_TRANS = zzUnpackTrans(); private static final String ZZ_TRANS_PACKED_0 = - "\3\16\1\17\1\20\1\16\1\20\3\16\1\21\10\16"+ - "\1\22\40\16\1\23\1\24\1\25\1\24\1\26\6\24"+ - "\1\27\2\24\4\25\1\24\1\30\1\22\2\25\1\24"+ - "\26\25\4\24\1\31\4\24\1\32\10\24\1\27\2\24"+ - "\4\32\2\24\1\22\2\32\1\24\12\32\1\33\13\32"+ - "\2\24\1\34\5\24\3\35\1\26\6\35\1\36\10\35"+ - "\1\37\33\35\1\40\5\35\1\24\1\41\1\24\1\26"+ - "\6\24\1\27\2\24\4\41\1\24\1\30\1\22\2\41"+ - "\1\24\26\41\10\24\10\42\1\43\54\42\1\24\1\44"+ - "\1\24\1\26\6\24\1\27\2\24\4\44\2\24\1\22"+ - "\2\44\1\24\26\44\10\24\3\45\1\26\6\45\1\46"+ - "\10\45\1\47\31\45\1\50\1\51\3\45\1\52\2\45"+ - "\12\24\1\27\10\24\1\22\41\24\4\53\1\54\1\53"+ - "\1\54\3\53\1\55\10\53\1\56\31\53\1\57\5\53"+ - "\1\60\5\53\1\61\1\53\1\61\3\53\1\55\10\53"+ - "\1\56\32\53\1\57\4\53\1\62\1\53\1\24\1\41"+ - "\1\24\1\26\6\24\1\27\1\24\1\63\4\41\1\24"+ - "\1\64\1\22\2\41\1\24\16\41\1\65\1\41\1\66"+ - "\5\41\1\67\1\70\6\24\21\71\1\72\43\71\3\16"+ - "\2\0\1\16\1\0\3\16\1\0\10\16\1\0\40\16"+ - "\1\23\3\0\1\17\66\0\1\73\72\0\1\74\43\0"+ - "\1\75\1\0\1\76\4\0\1\77\4\0\1\100\6\0"+ - "\4\77\3\0\1\101\1\77\1\0\1\101\1\102\3\77"+ - "\1\103\1\77\1\104\16\77\10\0\3\16\1\0\6\16"+ - "\1\0\10\16\1\0\40\16\1\23\66\0\2\25\4\0"+ - "\2\25\1\105\3\0\4\25\3\0\2\25\1\0\26\25"+ - "\13\0\1\26\74\0\1\106\73\0\1\107\43\0\2\32"+ - "\4\0\2\32\1\110\3\0\4\32\3\0\2\32\1\0"+ - "\26\32\11\0\2\32\4\0\2\32\1\110\3\0\4\32"+ - "\3\0\2\32\1\0\11\32\1\111\14\32\32\0\1\112"+ - "\43\0\2\41\4\0\2\41\1\113\3\0\4\41\3\0"+ - "\2\41\1\0\26\41\10\0\10\42\1\114\64\42\1\115"+ - "\54\42\1\0\2\44\4\0\2\44\1\116\3\0\4\44"+ - "\3\0\2\44\1\0\26\44\15\0\1\117\141\0\1\120"+ - "\7\0\1\121\141\0\1\122\2\0\21\123\1\124\33\123"+ - "\1\125\7\123\1\0\2\41\4\0\2\41\1\113\3\0"+ - "\4\41\3\0\2\41\1\0\22\41\1\126\3\41\11\0"+ - "\2\41\4\0\2\41\1\113\3\0\4\41\3\0\2\41"+ - "\1\0\15\41\1\127\10\41\10\0\55\130\1\53\7\130"+ - "\56\131\1\53\6\131\21\0\1\132\43\0\12\73\1\0"+ - "\45\73\1\133\4\73\10\0\1\134\3\0\1\135\1\0"+ - "\1\136\47\0\2\77\4\0\2\77\1\137\3\0\4\77"+ - "\3\0\2\77\1\140\26\77\12\0\1\141\36\0\1\142"+ - "\24\0\2\77\4\0\2\77\1\137\3\0\4\77\3\0"+ - "\1\77\1\143\1\140\26\77\11\0\2\77\4\0\2\77"+ - "\1\137\3\0\4\77\3\0\2\77\1\140\2\77\1\144"+ - "\6\77\1\145\14\77\11\0\2\77\4\0\2\77\1\137"+ - "\3\0\4\77\3\0\2\77\1\140\6\77\1\146\17\77"+ - "\11\0\2\77\4\0\2\77\1\137\3\0\4\77\3\0"+ - "\2\77\1\140\10\77\1\147\15\77\11\0\2\105\4\0"+ - "\2\105\4\0\4\105\3\0\2\105\1\0\26\105\20\0"+ - "\1\134\3\0\1\135\51\0\2\110\4\0\2\110\4\0"+ - "\4\110\3\0\2\110\1\0\26\110\11\0\2\32\4\0"+ - "\2\32\1\110\3\0\4\32\3\0\1\150\1\32\1\0"+ - "\26\32\11\0\2\113\4\0\2\113\4\0\4\113\3\0"+ - "\2\113\1\0\26\113\10\0\10\42\1\0\54\42\22\0"+ - "\1\151\43\0\2\116\4\0\2\116\4\0\4\116\3\0"+ - "\2\116\1\0\26\116\10\0\55\117\1\0\2\117\1\152"+ - "\4\117\55\120\1\0\5\120\1\153\1\120\56\121\1\0"+ - "\1\121\1\152\4\121\56\122\1\0\4\122\1\153\1\122"+ - "\55\125\1\123\7\125\1\0\2\41\4\0\2\41\1\113"+ - "\3\0\4\41\3\0\2\41\1\0\23\41\1\154\2\41"+ - "\11\0\2\41\4\0\2\41\1\113\3\0\4\41\3\0"+ - "\2\41\1\0\20\41\1\155\5\41\32\0\1\156\52\0"+ - "\1\157\71\0\1\160\112\0\1\161\22\0\2\137\4\0"+ - "\2\137\4\0\4\137\3\0\2\137\1\140\26\137\12\0"+ - "\1\141\23\0\1\162\40\0\1\163\12\0\3\163\10\0"+ - "\1\163\6\0\1\163\2\0\1\163\3\0\1\163\3\0"+ - "\1\163\13\0\2\77\4\0\2\77\1\137\3\0\4\77"+ - "\3\0\2\77\1\162\26\77\11\0\2\77\4\0\2\77"+ - "\1\137\3\0\4\77\3\0\2\77\1\140\3\77\1\164"+ - "\22\77\11\0\2\77\4\0\2\77\1\137\3\0\4\77"+ - "\3\0\2\77\1\140\2\77\1\143\23\77\11\0\2\77"+ - "\4\0\2\77\1\137\3\0\4\77\3\0\2\77\1\140"+ - "\3\77\1\101\22\77\11\0\2\77\4\0\2\77\1\137"+ - "\3\0\4\77\3\0\2\77\1\140\4\77\1\145\21\77"+ - "\11\0\2\41\4\0\2\41\1\113\3\0\4\41\3\0"+ - "\2\41\1\0\24\41\1\165\1\41\11\0\2\41\4\0"+ - "\2\41\1\113\3\0\3\41\1\166\3\0\2\41\1\0"+ - "\26\41\26\0\1\167\63\0\1\170\51\0\1\163\12\0"+ - "\3\163\6\0\1\162\1\0\1\163\6\0\1\163\2\0"+ - "\1\163\3\0\1\163\3\0\1\163\13\0\2\77\4\0"+ - "\2\77\1\137\3\0\4\77\3\0\2\77\1\140\4\77"+ - "\1\143\21\77\11\0\2\41\4\0\2\41\1\113\3\0"+ - "\4\41\3\0\2\41\1\0\25\41\1\171\11\0\2\41"+ - "\4\0\2\41\1\113\3\0\4\41\3\0\2\41\1\0"+ - "\17\41\1\172\6\41\27\0\1\173\65\0\1\174\45\0"+ - "\2\41\4\0\2\41\1\113\3\0\1\175\3\41\3\0"+ - "\2\41\1\0\26\41\11\0\2\41\4\0\2\41\1\113"+ - "\3\0\4\41\3\0\2\41\1\0\21\41\1\176\4\41"+ - "\30\0\1\177\110\0\1\200\37\0\1\201\112\0\1\202"+ - "\33\0\1\203\116\0\1\204\16\0"; + "\3\20\1\21\1\22\1\20\1\22\7\20\1\23\1\24"+ + "\46\20\1\25\1\26\1\27\1\26\1\30\3\26\1\27"+ + "\3\26\1\31\2\26\1\23\1\32\1\26\4\27\1\26"+ + "\2\27\1\26\26\27\4\26\1\33\4\26\1\34\5\26"+ + "\1\34\6\26\1\23\1\32\1\26\4\34\1\26\2\34"+ + "\1\26\12\34\1\35\13\34\2\26\1\36\5\26\3\37"+ + "\1\30\12\37\1\40\1\41\41\37\1\42\5\37\1\26"+ + "\1\43\1\26\1\30\3\26\1\43\3\26\1\31\2\26"+ + "\1\23\1\32\1\26\4\43\1\26\2\43\1\26\26\43"+ + "\10\26\11\44\1\45\5\44\1\46\1\47\46\44\1\26"+ + "\1\50\1\26\1\30\3\26\1\50\6\26\1\23\1\32"+ + "\1\26\4\50\1\26\2\50\1\26\26\50\10\26\3\51"+ + "\1\30\12\51\1\52\1\53\37\51\1\54\1\55\3\51"+ + "\1\56\2\51\16\26\1\23\1\32\47\26\4\57\1\60"+ + "\1\57\1\60\7\57\1\61\1\62\37\57\1\63\5\57"+ + "\1\64\5\57\1\65\1\57\1\65\7\57\1\61\1\62"+ + "\40\57\1\63\4\57\1\66\1\57\1\26\1\43\1\26"+ + "\1\30\3\26\1\43\3\26\1\67\2\26\1\23\1\32"+ + "\1\70\4\43\1\26\2\43\1\26\16\43\1\71\1\43"+ + "\1\72\5\43\1\73\1\74\6\26\25\75\1\76\41\75"+ + "\1\77\1\100\7\77\1\101\4\77\1\102\1\103\1\77"+ + "\4\100\1\104\2\100\1\77\26\100\11\77\1\100\7\77"+ + "\1\101\4\77\1\102\1\103\1\77\4\100\1\105\2\100"+ + "\1\77\26\100\10\77\3\20\2\0\1\20\1\0\7\20"+ + "\2\0\46\20\1\25\3\0\1\21\70\0\1\106\62\0"+ + "\1\107\4\0\1\110\1\107\11\0\4\107\1\0\1\111"+ + "\1\107\1\0\1\111\1\112\3\107\1\113\1\107\1\114"+ + "\16\107\25\0\1\115\43\0\1\116\1\0\1\117\3\0"+ + "\3\20\1\0\12\20\2\0\46\20\1\25\70\0\2\27"+ + "\4\0\3\27\1\120\6\0\4\27\1\0\2\27\1\0"+ + "\26\27\13\0\1\30\100\0\1\121\64\0\1\122\54\0"+ + "\2\34\4\0\3\34\1\123\6\0\4\34\1\0\2\34"+ + "\1\0\26\34\11\0\2\34\4\0\3\34\1\123\6\0"+ + "\4\34\1\0\2\34\1\0\11\34\1\124\14\34\23\0"+ + "\1\125\54\0\2\43\4\0\3\43\1\126\6\0\4\43"+ + "\1\0\2\43\1\0\26\43\21\0\1\127\72\0\1\130"+ + "\52\0\2\50\4\0\3\50\1\131\6\0\4\50\1\0"+ + "\2\50\1\0\26\50\15\0\1\132\145\0\1\133\7\0"+ + "\1\134\145\0\1\135\2\0\25\136\1\137\31\136\1\140"+ + "\7\136\1\0\2\43\4\0\3\43\1\126\6\0\4\43"+ + "\1\0\2\43\1\0\22\43\1\141\3\43\11\0\2\43"+ + "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ + "\15\43\1\142\10\43\10\0\57\143\1\57\7\143\60\144"+ + "\1\57\6\144\25\0\1\145\42\0\3\100\4\0\1\100"+ + "\3\0\3\100\2\0\4\100\1\0\2\100\1\0\26\100"+ + "\23\0\1\146\53\0\17\106\1\0\42\106\1\147\4\106"+ + "\1\0\2\107\4\0\3\107\1\150\6\0\4\107\1\0"+ + "\2\107\1\151\26\107\12\0\1\152\40\0\1\153\24\0"+ + "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\1\107"+ + "\1\154\1\151\26\107\11\0\2\107\4\0\3\107\1\150"+ + "\6\0\4\107\1\0\2\107\1\151\2\107\1\155\6\107"+ + "\1\156\14\107\11\0\2\107\4\0\3\107\1\150\6\0"+ + "\4\107\1\0\2\107\1\151\6\107\1\157\17\107\11\0"+ + "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\2\107"+ + "\1\151\10\107\1\160\15\107\21\0\1\161\6\0\1\162"+ + "\1\0\1\163\45\0\2\120\4\0\3\120\7\0\4\120"+ + "\1\0\2\120\1\0\26\120\21\0\1\161\6\0\1\162"+ + "\47\0\2\123\4\0\3\123\7\0\4\123\1\0\2\123"+ + "\1\0\26\123\11\0\2\34\4\0\3\34\1\123\6\0"+ + "\4\34\1\0\1\164\1\34\1\0\26\34\11\0\2\126"+ + "\4\0\3\126\7\0\4\126\1\0\2\126\1\0\26\126"+ + "\23\0\1\165\73\0\1\166\47\0\2\131\4\0\3\131"+ + "\7\0\4\131\1\0\2\131\1\0\26\131\10\0\57\132"+ + "\1\0\2\132\1\167\4\132\57\133\1\0\5\133\1\170"+ + "\1\133\60\134\1\0\1\134\1\167\4\134\60\135\1\0"+ + "\4\135\1\170\1\135\57\140\1\136\7\140\1\0\2\43"+ + "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ + "\23\43\1\171\2\43\11\0\2\43\4\0\3\43\1\126"+ + "\6\0\4\43\1\0\2\43\1\0\20\43\1\172\5\43"+ + "\23\0\1\173\54\0\2\150\4\0\3\150\7\0\4\150"+ + "\1\0\2\150\1\151\26\150\12\0\1\152\25\0\1\174"+ + "\40\0\1\175\16\0\3\175\6\0\1\175\6\0\1\175"+ + "\2\0\1\175\3\0\1\175\3\0\1\175\13\0\2\107"+ + "\4\0\3\107\1\150\6\0\4\107\1\0\2\107\1\174"+ + "\26\107\11\0\2\107\4\0\3\107\1\150\6\0\4\107"+ + "\1\0\2\107\1\151\3\107\1\176\22\107\11\0\2\107"+ + "\4\0\3\107\1\150\6\0\4\107\1\0\2\107\1\151"+ + "\2\107\1\154\23\107\11\0\2\107\4\0\3\107\1\150"+ + "\6\0\4\107\1\0\2\107\1\151\3\107\1\111\22\107"+ + "\11\0\2\107\4\0\3\107\1\150\6\0\4\107\1\0"+ + "\2\107\1\151\4\107\1\156\21\107\21\0\1\177\76\0"+ + "\1\200\112\0\1\201\22\0\2\43\4\0\3\43\1\126"+ + "\6\0\4\43\1\0\2\43\1\0\24\43\1\202\1\43"+ + "\11\0\2\43\4\0\3\43\1\126\6\0\3\43\1\203"+ + "\1\0\2\43\1\0\26\43\12\0\1\175\16\0\3\175"+ + "\4\0\1\174\1\0\1\175\6\0\1\175\2\0\1\175"+ + "\3\0\1\175\3\0\1\175\13\0\2\107\4\0\3\107"+ + "\1\150\6\0\4\107\1\0\2\107\1\151\4\107\1\154"+ + "\21\107\32\0\1\204\65\0\1\205\46\0\2\43\4\0"+ + "\3\43\1\126\6\0\4\43\1\0\2\43\1\0\25\43"+ + "\1\206\11\0\2\43\4\0\3\43\1\126\6\0\4\43"+ + "\1\0\2\43\1\0\17\43\1\207\6\43\33\0\1\210"+ + "\67\0\1\211\43\0\2\43\4\0\3\43\1\126\6\0"+ + "\1\212\3\43\1\0\2\43\1\0\26\43\11\0\2\43"+ + "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ + "\21\43\1\213\4\43\34\0\1\214\110\0\1\215\43\0"+ + "\1\216\112\0\1\217\37\0\1\220\116\0\1\221\16\0"; private static int [] zzUnpackTrans() { - int [] result = new int[4982]; + int [] result = new int[5390]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -343,16 +336,17 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\1\1\4\0\1\1\7\0\6\1\1\11\3\1\1\11"+ - "\4\1\1\11\7\1\1\11\2\1\4\11\3\1\1\11"+ - "\4\1\1\11\4\1\1\11\1\1\2\0\2\11\6\0"+ - "\1\1\1\0\1\11\2\1\1\11\1\1\2\0\1\1"+ - "\5\0\1\11\1\0\2\1\3\0\1\11\4\0\1\11"+ - "\7\0\1\1\3\11\2\1\2\11\2\0\1\11\2\0"+ - "\2\1\2\0\2\1\2\0\2\1\4\0\2\11"; + "\1\1\16\0\6\1\1\11\2\1\1\11\5\1\1\11"+ + "\4\1\1\11\2\1\1\11\1\1\1\11\2\1\4\11"+ + "\3\1\1\11\3\1\1\11\5\1\1\11\1\1\1\11"+ + "\5\1\1\11\10\0\2\11\1\1\1\0\1\11\2\1"+ + "\1\11\1\1\2\0\1\1\5\0\1\11\1\0\2\1"+ + "\3\0\2\11\1\0\1\11\12\0\1\1\4\11\2\1"+ + "\2\11\2\0\1\11\2\0\2\1\2\0\2\1\2\0"+ + "\2\1\4\0\2\11"; private static int [] zzUnpackAttribute() { - int [] result = new int[132]; + int [] result = new int[145]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -411,9 +405,23 @@ public class __XmlLexer implements FlexLexer { private boolean zzEOFDone; /* user code: */ - protected IElementType elTokenType = XmlTokenType.XML_DATA_CHARACTERS; - protected IElementType elTokenType2 = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; - protected IElementType javaEmbeddedTokenType = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; + private IElementType elTokenType = XmlTokenType.XML_DATA_CHARACTERS; + private IElementType elTokenType2 = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; + private IElementType javaEmbeddedTokenType = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; + private boolean myConditionalCommentsSupport; + + public void setConditionalCommentsSupport(final boolean b) { + myConditionalCommentsSupport = b; + } + + public void setElTypes(IElementType _elTokenType,IElementType _elTokenType2) { + elTokenType = _elTokenType; + elTokenType2 = _elTokenType2; + } + + public void setJavaEmbeddedType(IElementType _tokenType) { + javaEmbeddedTokenType = _tokenType; + } private int myPrevState = YYINITIAL; @@ -456,7 +464,7 @@ public class __XmlLexer implements FlexLexer { char [] map = new char[0x10000]; int i = 0; /* index in packed string */ int j = 0; /* index in unpacked array */ - while (i < 1244) { + while (i < 1248) { int count = packed.charAt(i++); char value = packed.charAt(i++); do map[j++] = value; while (--count > 0); @@ -485,7 +493,14 @@ public class __XmlLexer implements FlexLexer { // For Demetra compatibility public void reset(CharSequence buffer, int initialState){ - reset(buffer, 0, buffer.length(), initialState); + zzBuffer = buffer; + zzBufferArray = null; + zzCurrentPos = zzMarkedPos = zzStartRead = 0; + zzPushbackPos = 0; + zzAtEOF = false; + zzAtBOL = true; + zzEndRead = buffer.length(); + yybegin(initialState); } /** @@ -683,161 +698,187 @@ public class __XmlLexer implements FlexLexer { zzMarkedPos = zzMarkedPosL; switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 19: + case 20: { yybegin(ATTR_LIST); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; } - case 39: break; + case 44: break; case 18: { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; } - case 40: break; - case 36: + case 45: break; + case 41: { return XmlTokenType.XML_DOCTYPE_SYSTEM; } - case 41: break; + case 46: break; case 17: { return XmlTokenType.XML_EQ; } - case 42: break; - case 10: + case 47: break; + case 9: { return XmlTokenType.XML_TAG_CHARACTERS; } - case 43: break; - case 37: + case 48: break; + case 42: { yybegin(CDATA); return XmlTokenType.XML_CDATA_START; } - case 44: break; - case 6: + case 49: break; + case 5: { yybegin(ATTR_LIST); pushState(TAG); return XmlTokenType.XML_NAME; } - case 45: break; - case 22: + case 50: break; + case 25: { yybegin(END_TAG); return XmlTokenType.XML_END_TAG_START; } - case 46: break; - case 26: - { return elTokenType; - } - case 47: break; - case 11: - { return XmlTokenType.XML_NAME; - } - case 48: break; - case 35: - { return XmlTokenType.XML_DOCTYPE_PUBLIC; - } - case 49: break; - case 33: - { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START; - } - case 50: break; - case 31: - { return javaEmbeddedTokenType; - } case 51: break; - case 25: - { return XmlElementType.XML_MARKUP; + case 34: + { if (myConditionalCommentsSupport) { + yybegin(C_COMMENT_END); + return XmlTokenType.XML_CONDITIONAL_COMMENT_END_START; + } else return XmlTokenType.XML_COMMENT_CHARACTERS; } case 52: break; - case 28: - { yybegin(ATTR_LIST); pushState(PROCESSING_INSTRUCTION); return XmlTokenType.XML_NAME; + case 30: + { return elTokenType; } case 53: break; - case 3: - { return XmlTokenType.XML_REAL_WHITE_SPACE; + case 10: + { return XmlTokenType.XML_NAME; } case 54: break; + case 40: + { return XmlTokenType.XML_DOCTYPE_PUBLIC; + } + case 55: break; + case 39: + { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START; + } + case 56: break; + case 36: + { return javaEmbeddedTokenType; + } + case 57: break; + case 28: + { return XmlElementType.XML_MARKUP; + } + case 58: break; + case 32: + { yybegin(ATTR_LIST); pushState(PROCESSING_INSTRUCTION); return XmlTokenType.XML_NAME; + } + case 59: break; + case 2: + { return XmlTokenType.XML_REAL_WHITE_SPACE; + } + case 60: break; case 1: { return XmlTokenType.XML_DATA_CHARACTERS; } - case 55: break; - case 12: + case 61: break; + case 23: + { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_END; + } + case 62: break; + case 19: { return XmlTokenType.XML_BAD_CHARACTER; } - case 56: break; - case 8: + case 63: break; + case 7: { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; } - case 57: break; - case 5: + case 64: break; + case 29: + { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_START_END; + } + case 65: break; + case 33: + { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; + } + case 66: break; + case 4: + { yybegin(TAG); return XmlTokenType.XML_START_TAG_START; + } + case 67: break; + case 26: + { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; + } + case 68: break; + case 24: + { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; + } + case 69: break; + case 8: + { yybegin(PI_ANY); return XmlTokenType.XML_NAME; + } + case 70: break; + case 12: + { if (myConditionalCommentsSupport) { + yybegin(C_COMMENT_START); + return XmlTokenType.XML_CONDITIONAL_COMMENT_START; + } else return XmlTokenType.XML_COMMENT_CHARACTERS; + } + case 71: break; + case 13: + { yybegin(ATTR); return XmlTokenType.XML_NAME; + } + case 72: break; + case 14: + { yybegin(ATTR_LIST); yypushback(yylength()); + } + case 73: break; + case 21: + { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END; + } + case 74: break; + case 38: + { return XmlTokenType.XML_CHAR_ENTITY_REF; + } + case 75: break; + case 6: + { return XmlTokenType.XML_WHITE_SPACE; + } + case 76: break; + case 31: + { return XmlTokenType.XML_ENTITY_REF_TOKEN; + } + case 77: break; + case 15: + { yybegin(ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; + } + case 78: break; + case 16: + { yybegin(ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; + } + case 79: break; + case 22: + { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS; + } + case 80: break; + case 37: + { yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END; + } + case 81: break; + case 3: { if(yystate() == YYINITIAL){ return XmlTokenType.XML_BAD_CHARACTER; } else yybegin(popState()); yypushback(yylength()); } - case 58: break; - case 29: - { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; - } - case 59: break; - case 4: - { yybegin(TAG); return XmlTokenType.XML_START_TAG_START; - } - case 60: break; - case 23: - { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; - } - case 61: break; - case 21: - { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; - } - case 62: break; - case 9: - { yybegin(PI_ANY); return XmlTokenType.XML_NAME; - } - case 63: break; - case 13: - { yybegin(ATTR); return XmlTokenType.XML_NAME; - } - case 64: break; - case 14: - { yybegin(ATTR_LIST); yypushback(yylength()); - } - case 65: break; - case 20: - { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END; - } - case 66: break; - case 34: - { return XmlTokenType.XML_CHAR_ENTITY_REF; - } - case 67: break; - case 7: - { return XmlTokenType.XML_WHITE_SPACE; - } - case 68: break; - case 27: - { return XmlTokenType.XML_ENTITY_REF_TOKEN; - } - case 69: break; - case 15: - { yybegin(ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; - } - case 70: break; - case 16: - { yybegin(ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; - } - case 71: break; - case 32: - { yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END; - } - case 72: break; - case 30: + case 82: break; + case 35: { return elTokenType2; } - case 73: break; - case 24: + case 83: break; + case 27: { yybegin(YYINITIAL); return XmlTokenType.XML_PI_END; } - case 74: break; - case 38: + case 84: break; + case 43: { yybegin(DOCTYPE); return XmlTokenType.XML_DOCTYPE_START; } - case 75: break; - case 2: + case 85: break; + case 11: { return XmlTokenType.XML_COMMENT_CHARACTERS; } - case 76: break; + case 86: break; default: if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; From 4807a0348301b4bb2fd1377e7564e05182dc1dcf Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Mon, 26 Oct 2009 20:02:46 +0300 Subject: [PATCH 10/18] xhtml conditional comment injection take 3 --- .../ide/highlighter/XmlFileHighlighter.java | 4 ++++ .../lexer/XHtmlHighlightingLexer.java | 2 +- .../src/com/intellij/lexer/XHtmlLexer.java | 2 +- xml/impl/src/com/intellij/lexer/XmlLexer.java | 7 +++++- .../html/HtmlConditionalCommentInjector.java | 23 ++++++++----------- .../impl/source/parsing/xml/XmlParsing.java | 4 +++- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/xml/impl/src/com/intellij/ide/highlighter/XmlFileHighlighter.java b/xml/impl/src/com/intellij/ide/highlighter/XmlFileHighlighter.java index 9ee712fdf493..5f783eb89411 100644 --- a/xml/impl/src/com/intellij/ide/highlighter/XmlFileHighlighter.java +++ b/xml/impl/src/com/intellij/ide/highlighter/XmlFileHighlighter.java @@ -44,6 +44,10 @@ public class XmlFileHighlighter extends SyntaxHighlighterBase { keys1.put(XmlTokenType.XML_COMMENT_START, XmlHighlighterColors.XML_COMMENT); keys1.put(XmlTokenType.XML_COMMENT_END, XmlHighlighterColors.XML_COMMENT); keys1.put(XmlTokenType.XML_COMMENT_CHARACTERS, XmlHighlighterColors.XML_COMMENT); + keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_END, XmlHighlighterColors.XML_COMMENT); + keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_END_START, XmlHighlighterColors.XML_COMMENT); + keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_START, XmlHighlighterColors.XML_COMMENT); + keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_START_END, XmlHighlighterColors.XML_COMMENT); keys1.put(XmlTokenType.XML_START_TAG_START, XmlHighlighterColors.XML_TAG); keys1.put(XmlTokenType.XML_END_TAG_START, XmlHighlighterColors.XML_TAG); diff --git a/xml/impl/src/com/intellij/lexer/XHtmlHighlightingLexer.java b/xml/impl/src/com/intellij/lexer/XHtmlHighlightingLexer.java index 72880371f0ab..5f89e2096cb3 100644 --- a/xml/impl/src/com/intellij/lexer/XHtmlHighlightingLexer.java +++ b/xml/impl/src/com/intellij/lexer/XHtmlHighlightingLexer.java @@ -17,7 +17,7 @@ package com.intellij.lexer; public class XHtmlHighlightingLexer extends HtmlHighlightingLexer { public XHtmlHighlightingLexer() { - this(new XmlLexer()); + this(new XmlLexer(true)); } public XHtmlHighlightingLexer(Lexer baseLexer) { diff --git a/xml/impl/src/com/intellij/lexer/XHtmlLexer.java b/xml/impl/src/com/intellij/lexer/XHtmlLexer.java index 7b3ea972fc9d..4fa57f7eab50 100644 --- a/xml/impl/src/com/intellij/lexer/XHtmlLexer.java +++ b/xml/impl/src/com/intellij/lexer/XHtmlLexer.java @@ -28,7 +28,7 @@ public class XHtmlLexer extends HtmlLexer { } public XHtmlLexer() { - this(new XmlLexer()); + this(new XmlLexer(true)); } protected boolean isHtmlTagState(int state) { diff --git a/xml/impl/src/com/intellij/lexer/XmlLexer.java b/xml/impl/src/com/intellij/lexer/XmlLexer.java index 2f734078a9be..ecb1ee1d97ba 100644 --- a/xml/impl/src/com/intellij/lexer/XmlLexer.java +++ b/xml/impl/src/com/intellij/lexer/XmlLexer.java @@ -27,10 +27,15 @@ public class XmlLexer extends MergingLexerAdapter { XmlTokenType.XML_TAG_CHARACTERS, XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, XmlTokenType.XML_PI_TARGET, + XmlTokenType.XML_COMMENT_CHARACTERS, }); public XmlLexer() { - this(new _XmlLexer(new __XmlLexer((Reader)null))); + this(false); + } + + public XmlLexer(final boolean conditionalCommentsSupport) { + this(new _XmlLexer(new __XmlLexer((Reader)null), conditionalCommentsSupport)); } public XmlLexer(Lexer baseLexer) { diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/HtmlConditionalCommentInjector.java b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlConditionalCommentInjector.java index c77d779186e0..91cc8c55c7ce 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/html/HtmlConditionalCommentInjector.java +++ b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlConditionalCommentInjector.java @@ -16,7 +16,6 @@ package com.intellij.psi.impl.source.html; import com.intellij.lang.ASTNode; -import com.intellij.lang.html.HTMLLanguage; import com.intellij.lang.injection.MultiHostInjector; import com.intellij.lang.injection.MultiHostRegistrar; import com.intellij.openapi.util.TextRange; @@ -39,20 +38,18 @@ public class HtmlConditionalCommentInjector implements MultiHostInjector { if (host instanceof XmlComment) { final ASTNode comment = host.getNode(); if (comment != null) { - final ASTNode[] conditionalStarts = comment.getChildren(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_START_END)); - if (conditionalStarts.length > 0) { - final ASTNode[] conditionalEnds = comment.getChildren(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_END_START)); - if (conditionalEnds.length > 0) { - final ASTNode[] endOfEnd = comment.getChildren(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_END)); - if (endOfEnd.length > 0) { + final ASTNode conditionalStart = comment.findChildByType(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_START_END)); + if (conditionalStart != null) { + final ASTNode conditionalEnd = comment.findChildByType(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_END_START)); + if (conditionalEnd != null) { + final ASTNode endOfEnd = comment.findChildByType(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_END)); + if (endOfEnd != null) { final TextRange textRange = host.getTextRange(); final int startOffset = textRange.getStartOffset(); - - final ASTNode start = conditionalStarts[0]; - final ASTNode end = conditionalEnds[0]; - registrar.startInjecting(HTMLLanguage.INSTANCE).addPlace(null, null, (PsiLanguageInjectionHost)host, - new TextRange(start.getTextRange().getEndOffset() - startOffset, - end.getStartOffset() - startOffset)).doneInjecting(); + registrar.startInjecting(host.getParent().getLanguage()).addPlace(null, null, (PsiLanguageInjectionHost)host, + new TextRange( + conditionalStart.getTextRange().getEndOffset() - startOffset, + conditionalEnd.getStartOffset() - startOffset)).doneInjecting(); } } } diff --git a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParsing.java b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParsing.java index 87c86234216b..1c779b1ee412 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParsing.java +++ b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParsing.java @@ -321,7 +321,9 @@ public class XmlParsing { advance(); while (true) { final IElementType tt = token(); - if (tt == XML_COMMENT_CHARACTERS) { + if (tt == XML_COMMENT_CHARACTERS|| tt == XML_CONDITIONAL_COMMENT_START + || tt == XML_CONDITIONAL_COMMENT_START_END || tt == XML_CONDITIONAL_COMMENT_END_START + || tt == XML_CONDITIONAL_COMMENT_END) { advance(); continue; } From 8740f9fa359a3d53608b16c273003114a583beec Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 26 Oct 2009 16:34:59 +0000 Subject: [PATCH 11/18] catch INRE in debugger --- .../impl/src/com/intellij/debugger/engine/ContextUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/ContextUtil.java b/java/debugger/impl/src/com/intellij/debugger/engine/ContextUtil.java index 64bb76fbcbf6..161fb5846467 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/ContextUtil.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/ContextUtil.java @@ -22,6 +22,7 @@ import com.intellij.debugger.jdi.LocalVariableProxyImpl; import com.intellij.debugger.jdi.StackFrameProxyImpl; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; +import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Key; import com.intellij.psi.*; @@ -58,7 +59,11 @@ public class ContextUtil { // process already closed return null; } - return positionManager.getSourcePosition(location); + try { + return positionManager.getSourcePosition(location); + } catch (IndexNotReadyException e) { + return null; + } } @Nullable From 81e863bdfd2779d483d8e21a1b9c27697025372a Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 26 Oct 2009 17:08:43 +0000 Subject: [PATCH 12/18] WordCompletionTest->community --- .../codeInsight/completion/word/1.properties | 1 + .../codeInsight/completion/word/1.txt | 1 + .../codeInsight/completion/word/1.xml | 1 + .../completion/word/1_after.properties | 1 + .../codeInsight/completion/word/1_after.txt | 1 + .../codeInsight/completion/word/1_after.xml | 1 + .../codeInsight/completion/word/2.xml | 4 + .../codeInsight/completion/word/2_after.xml | 4 + .../codeInsight/completion/word/3.java | 3 + .../codeInsight/completion/word/3_after.java | 3 + .../codeInsight/completion/word/4.java | 4 + .../codeInsight/completion/word/4_after.java | 4 + .../completion/word/DollarsInPrefix.txt | 2 + .../completion/word/DollarsInPrefix_after.txt | 2 + .../completion/word/SpaceInComment.java | 4 + .../completion/word/TextInComment.java | 4 + .../completion/word/TextInComment_after.java | 4 + .../completion/WordCompletionTest.java | 106 ++++++++++++++++++ 18 files changed, 150 insertions(+) create mode 100644 java/java-tests/testData/codeInsight/completion/word/1.properties create mode 100644 java/java-tests/testData/codeInsight/completion/word/1.txt create mode 100644 java/java-tests/testData/codeInsight/completion/word/1.xml create mode 100644 java/java-tests/testData/codeInsight/completion/word/1_after.properties create mode 100644 java/java-tests/testData/codeInsight/completion/word/1_after.txt create mode 100644 java/java-tests/testData/codeInsight/completion/word/1_after.xml create mode 100644 java/java-tests/testData/codeInsight/completion/word/2.xml create mode 100644 java/java-tests/testData/codeInsight/completion/word/2_after.xml create mode 100644 java/java-tests/testData/codeInsight/completion/word/3.java create mode 100644 java/java-tests/testData/codeInsight/completion/word/3_after.java create mode 100644 java/java-tests/testData/codeInsight/completion/word/4.java create mode 100644 java/java-tests/testData/codeInsight/completion/word/4_after.java create mode 100644 java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix.txt create mode 100644 java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix_after.txt create mode 100644 java/java-tests/testData/codeInsight/completion/word/SpaceInComment.java create mode 100644 java/java-tests/testData/codeInsight/completion/word/TextInComment.java create mode 100644 java/java-tests/testData/codeInsight/completion/word/TextInComment_after.java create mode 100644 java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java diff --git a/java/java-tests/testData/codeInsight/completion/word/1.properties b/java/java-tests/testData/codeInsight/completion/word/1.properties new file mode 100644 index 000000000000..07ff18946dda --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/1.properties @@ -0,0 +1 @@ +Settings Sett other \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/1.txt b/java/java-tests/testData/codeInsight/completion/word/1.txt new file mode 100644 index 000000000000..07ff18946dda --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/1.txt @@ -0,0 +1 @@ +Settings Sett other \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/1.xml b/java/java-tests/testData/codeInsight/completion/word/1.xml new file mode 100644 index 000000000000..59ce61709e23 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/1.xml @@ -0,0 +1 @@ +Settings Sett other \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/1_after.properties b/java/java-tests/testData/codeInsight/completion/word/1_after.properties new file mode 100644 index 000000000000..d541cbaae542 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/1_after.properties @@ -0,0 +1 @@ +Settings Settings other \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/1_after.txt b/java/java-tests/testData/codeInsight/completion/word/1_after.txt new file mode 100644 index 000000000000..d541cbaae542 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/1_after.txt @@ -0,0 +1 @@ +Settings Settings other \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/1_after.xml b/java/java-tests/testData/codeInsight/completion/word/1_after.xml new file mode 100644 index 000000000000..0e55fb64166c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/1_after.xml @@ -0,0 +1 @@ +Settings Settings other \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/2.xml b/java/java-tests/testData/codeInsight/completion/word/2.xml new file mode 100644 index 000000000000..827ff426a45e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/2.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/2_after.xml b/java/java-tests/testData/codeInsight/completion/word/2_after.xml new file mode 100644 index 000000000000..2b4fb1785afa --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/2_after.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/3.java b/java/java-tests/testData/codeInsight/completion/word/3.java new file mode 100644 index 000000000000..6b5f498d02b1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/3.java @@ -0,0 +1,3 @@ +public class MyClass { + String b = "My"; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/3_after.java b/java/java-tests/testData/codeInsight/completion/word/3_after.java new file mode 100644 index 000000000000..362513c90f15 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/3_after.java @@ -0,0 +1,3 @@ +public class MyClass { + String b = "MyHardVariant"; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/4.java b/java/java-tests/testData/codeInsight/completion/word/4.java new file mode 100644 index 000000000000..ee67efda680b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/4.java @@ -0,0 +1,4 @@ +public class MyClass { + String b = "My"; + // pu +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/4_after.java b/java/java-tests/testData/codeInsight/completion/word/4_after.java new file mode 100644 index 000000000000..aad7a3fa2af9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/4_after.java @@ -0,0 +1,4 @@ +public class MyClass { + String b = "My"; + // public +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix.txt b/java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix.txt new file mode 100644 index 000000000000..d20aabb4aa61 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix.txt @@ -0,0 +1,2 @@ +$test +$te \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix_after.txt b/java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix_after.txt new file mode 100644 index 000000000000..eb7accf1a552 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/DollarsInPrefix_after.txt @@ -0,0 +1,2 @@ +$test +$test \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/SpaceInComment.java b/java/java-tests/testData/codeInsight/completion/word/SpaceInComment.java new file mode 100644 index 000000000000..aecf20aec235 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/SpaceInComment.java @@ -0,0 +1,4 @@ +public class MyClass { + + // comment +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/TextInComment.java b/java/java-tests/testData/codeInsight/completion/word/TextInComment.java new file mode 100644 index 000000000000..13285eca3293 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/TextInComment.java @@ -0,0 +1,4 @@ +public class MyClass { + + /** comment My */ +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/word/TextInComment_after.java b/java/java-tests/testData/codeInsight/completion/word/TextInComment_after.java new file mode 100644 index 000000000000..5e0022979846 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/word/TextInComment_after.java @@ -0,0 +1,4 @@ +public class MyClass { + + /** comment MyClass */ +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java new file mode 100644 index 000000000000..22613915de80 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java @@ -0,0 +1,106 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.JavaTestUtil; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiLiteralExpression; +import com.intellij.psi.PsiReference; +import com.intellij.psi.PsiReferenceBase; +import com.intellij.psi.impl.source.resolve.reference.PsiReferenceProviderBase; +import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; +import com.intellij.util.ProcessingContext; +import org.jetbrains.annotations.NotNull; + +/** + * Created by IntelliJ IDEA. + * User: Maxim.Mossienko + * Date: Oct 14, 2004 + * Time: 4:39:37 PM + * To change this template use File | Settings | File Templates. + */ +public class WordCompletionTest extends CompletionTestCase { + private static final String BASE_PATH = "/codeInsight/completion/word/"; + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + public void testKeyWordCompletion() throws Exception { + configureByFile(BASE_PATH + "1.txt"); + checkResultByFile(BASE_PATH + "1_after.txt"); + + configureByFile(BASE_PATH + "1.properties"); + checkResultByFile(BASE_PATH + "1_after.properties"); + + configureByFile(BASE_PATH + "1.xml"); + checkResultByFile(BASE_PATH + "1_after.xml"); + + configureByFile(BASE_PATH + "2.xml"); + configureByFile(BASE_PATH + "2_after.xml"); + } + + public void testNoWordCompletionForNonSoftReference() throws Throwable { + final PsiReferenceProviderBase softProvider = new PsiReferenceProviderBase() { + @NotNull + public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) { + return new PsiReference[]{new PsiReferenceBase(element) { + public PsiElement resolve() { + return null; + } + + public boolean isSoft() { + return true; + } + + public Object[] getVariants() { + return new Object[]{"MySoftVariant"}; + } + }}; + } + }; + final PsiReferenceProviderBase hardProvider = new PsiReferenceProviderBase() { + @NotNull + public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) { + return new PsiReference[]{new PsiReferenceBase(element) { + public PsiElement resolve() { + return null; + } + + public boolean isSoft() { + return false; + } + + public Object[] getVariants() { + return new Object[]{"MyHardVariant"}; + } + }}; + } + }; + ReferenceProvidersRegistry.getInstance(getProject()).registerReferenceProvider(PsiLiteralExpression.class, softProvider); + ReferenceProvidersRegistry.getInstance(getProject()).registerReferenceProvider(PsiLiteralExpression.class, hardProvider); + + configureByFile(BASE_PATH + "3.java"); + checkResultByFile(BASE_PATH + "3_after.java"); + } + + public void testComments() throws Throwable { + configureByFile(BASE_PATH + "4.java"); + checkResultByFile(BASE_PATH + "4_after.java"); + } + + public void testSpaceInComment() throws Throwable { + configureByFile(BASE_PATH + "SpaceInComment.java"); + checkResultByFile(BASE_PATH + "SpaceInComment.java"); + } + + public void testTextInComment() throws Throwable { + configureByFile(BASE_PATH + "TextInComment.java"); + checkResultByFile(BASE_PATH + "TextInComment_after.java"); + } + + public void testDollarsInPrefix() throws Throwable { + configureByFile(BASE_PATH + getTestName(false) + ".txt"); + checkResultByFile(BASE_PATH + getTestName(false) + "_after.txt"); + } + +} From ac18a7da71d4ebcb095503704edbbf89ca0e2a47 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 26 Oct 2009 20:49:45 +0300 Subject: [PATCH 13/18] remove incorrect dependency --- .../com/intellij/ui/PathsChooserComponent.form | 0 .../com/intellij/ui/PathsChooserComponent.java | 15 +++++++++++++++ platform/util/util.iml | 1 - 3 files changed, 15 insertions(+), 1 deletion(-) rename platform/{util => platform-api}/src/com/intellij/ui/PathsChooserComponent.form (100%) rename platform/{util => platform-api}/src/com/intellij/ui/PathsChooserComponent.java (84%) diff --git a/platform/util/src/com/intellij/ui/PathsChooserComponent.form b/platform/platform-api/src/com/intellij/ui/PathsChooserComponent.form similarity index 100% rename from platform/util/src/com/intellij/ui/PathsChooserComponent.form rename to platform/platform-api/src/com/intellij/ui/PathsChooserComponent.form diff --git a/platform/util/src/com/intellij/ui/PathsChooserComponent.java b/platform/platform-api/src/com/intellij/ui/PathsChooserComponent.java similarity index 84% rename from platform/util/src/com/intellij/ui/PathsChooserComponent.java rename to platform/platform-api/src/com/intellij/ui/PathsChooserComponent.java index d74b34e3c035..73f18084953d 100644 --- a/platform/util/src/com/intellij/ui/PathsChooserComponent.java +++ b/platform/platform-api/src/com/intellij/ui/PathsChooserComponent.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.ui; import com.intellij.openapi.fileChooser.FileChooserDescriptor; diff --git a/platform/util/util.iml b/platform/util/util.iml index 619f920cf77c..315d1bbcb801 100644 --- a/platform/util/util.iml +++ b/platform/util/util.iml @@ -16,7 +16,6 @@ - From 2ae4b1b3476ed8334a336248d14c6d3dbeb48d6f Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Mon, 26 Oct 2009 22:07:40 +0300 Subject: [PATCH 14/18] fixing tests (xml lexer still reports unexpected character in comment content) --- .../src/com/intellij/lexer/__XmlLexer.java | 363 +++++++++--------- 1 file changed, 183 insertions(+), 180 deletions(-) diff --git a/xml/impl/src/com/intellij/lexer/__XmlLexer.java b/xml/impl/src/com/intellij/lexer/__XmlLexer.java index 42c7d9c8eb34..ac4b50698288 100644 --- a/xml/impl/src/com/intellij/lexer/__XmlLexer.java +++ b/xml/impl/src/com/intellij/lexer/__XmlLexer.java @@ -1,4 +1,4 @@ -/* The following code was generated by JFlex 1.4.1 on 10/26/09 6:47 PM */ +/* The following code was generated by JFlex 1.4.1 on 26.10.09 22:00 */ /* It's an automatically generated code. Do not modify it. */ package com.intellij.lexer; @@ -11,8 +11,8 @@ import com.intellij.psi.xml.XmlTokenType; /** * This class is a scanner generated by * JFlex 1.4.1 - * on 10/26/09 6:47 PM from the specification file - * /Users/spleaner/ideadev/tools/lexer/_XmlLexer.flex + * on 26.10.09 22:00 from the specification file + * C:/IDEA/tools/lexer/_XmlLexer.flex */ public class __XmlLexer implements FlexLexer { /** initial size of the lookahead buffer */ @@ -115,19 +115,20 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = - "\1\1\16\0\1\1\1\2\1\1\1\3\1\4\1\1"+ - "\1\3\1\5\1\6\1\7\2\3\2\10\1\3\4\11"+ - "\1\12\3\13\1\14\1\15\3\16\1\17\1\20\1\21"+ - "\2\22\1\23\1\22\1\24\3\22\1\25\1\3\2\12"+ - "\2\3\2\1\1\26\1\13\4\26\1\27\10\0\1\30"+ - "\1\31\1\5\1\0\1\32\2\10\1\33\1\12\2\0"+ - "\1\15\5\0\1\34\1\0\2\12\3\0\1\35\1\36"+ - "\1\0\1\37\12\0\1\40\1\41\1\42\1\43\1\44"+ - "\2\12\1\45\1\46\2\0\1\47\2\0\2\12\2\0"+ - "\2\12\2\0\1\50\1\51\4\0\1\52\1\53"; + "\1\1\4\0\1\2\11\0\1\1\1\3\1\1\1\4"+ + "\1\5\1\1\1\4\1\6\1\7\1\10\2\4\2\11"+ + "\1\4\4\12\1\13\1\2\1\14\1\2\1\15\1\16"+ + "\3\17\1\20\1\21\1\22\2\23\1\14\1\23\1\24"+ + "\3\23\1\25\1\4\2\13\2\4\2\1\1\26\1\2"+ + "\4\26\1\27\10\0\1\30\1\31\1\6\1\0\1\32"+ + "\2\11\1\33\1\13\2\0\1\2\1\16\5\0\1\34"+ + "\1\0\2\13\3\0\1\35\1\36\1\0\1\37\12\0"+ + "\1\40\1\41\1\42\1\43\1\44\2\13\1\45\1\46"+ + "\2\0\1\47\2\0\2\13\2\0\2\13\2\0\1\50"+ + "\1\51\4\0\1\52\1\53"; private static int [] zzUnpackAction() { - int [] result = new int[145]; + int [] result = new int[146]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -156,24 +157,24 @@ public class __XmlLexer implements FlexLexer { "\0\u01b8\0\u01ef\0\u0226\0\u025d\0\u0294\0\u02cb\0\u0302\0\u0339"+ "\0\u0370\0\u03a7\0\u03de\0\u0415\0\u044c\0\u0483\0\u04ba\0\u04f1"+ "\0\u0483\0\u0528\0\u055f\0\u0596\0\u05cd\0\u0604\0\u0483\0\u03de"+ - "\0\u0528\0\u0604\0\u063b\0\u0483\0\u0672\0\u06a9\0\u0483\0\u06e0"+ - "\0\u0483\0\u03de\0\u0528\0\u0483\0\u0483\0\u0483\0\u0483\0\u0717"+ - "\0\u03de\0\u0528\0\u0483\0\u074e\0\u0785\0\u07bc\0\u0483\0\u07f3"+ - "\0\u082a\0\u0861\0\u0898\0\u08cf\0\u0483\0\u0906\0\u0483\0\u093d"+ - "\0\u0672\0\u03de\0\u0528\0\u0974\0\u0483\0\u09ab\0\u09e2\0\u0a19"+ - "\0\u0a50\0\u0a87\0\u0abe\0\u0af5\0\u0b2c\0\u0483\0\u0483\0\u0b63"+ - "\0\u0b9a\0\u0483\0\u0bd1\0\u0c08\0\u0483\0\u0c3f\0\u0c76\0\u0cad"+ - "\0\u0ce4\0\u0d1b\0\u0d52\0\u0d89\0\u0dc0\0\u07f3\0\u0483\0\u0df7"+ - "\0\u0e2e\0\u0e65\0\u0898\0\u08cf\0\u0e9c\0\u0483\0\u0483\0\u0ed3"+ - "\0\u0483\0\u0f0a\0\u0f41\0\u0f78\0\u0faf\0\u0fe6\0\u101d\0\u1054"+ - "\0\u108b\0\u10c2\0\u10f9\0\u0596\0\u0483\0\u0483\0\u0483\0\u0483"+ - "\0\u1130\0\u1167\0\u0483\0\u0483\0\u119e\0\u11d5\0\u0483\0\u120c"+ - "\0\u1243\0\u127a\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4"+ - "\0\u13fb\0\u063b\0\u063b\0\u1432\0\u1469\0\u14a0\0\u14d7\0\u0483"+ - "\0\u0483"; + "\0\u0528\0\u0604\0\u063b\0\u0672\0\u06a9\0\u06e0\0\u0672\0\u0717"+ + "\0\u0483\0\u03de\0\u0528\0\u0483\0\u0483\0\u0483\0\u0483\0\u074e"+ + "\0\u03de\0\u0528\0\u0483\0\u0785\0\u07bc\0\u07f3\0\u0483\0\u082a"+ + "\0\u0861\0\u0898\0\u08cf\0\u0906\0\u0483\0\u093d\0\u0483\0\u0974"+ + "\0\u09ab\0\u03de\0\u0528\0\u09e2\0\u0483\0\u0a19\0\u0a50\0\u0a87"+ + "\0\u0abe\0\u0af5\0\u0b2c\0\u0b63\0\u0b9a\0\u0483\0\u0483\0\u0bd1"+ + "\0\u0c08\0\u0483\0\u0c3f\0\u0c76\0\u0483\0\u0cad\0\u0ce4\0\u0d1b"+ + "\0\u0d52\0\u0d89\0\u0dc0\0\u0df7\0\u0e2e\0\u0e65\0\u082a\0\u0483"+ + "\0\u0e9c\0\u0ed3\0\u0f0a\0\u08cf\0\u0906\0\u0f41\0\u0483\0\u0483"+ + "\0\u0f78\0\u0483\0\u0faf\0\u0fe6\0\u101d\0\u1054\0\u108b\0\u10c2"+ + "\0\u10f9\0\u1130\0\u1167\0\u119e\0\u0596\0\u0483\0\u0672\0\u0483"+ + "\0\u0483\0\u11d5\0\u120c\0\u0483\0\u0483\0\u1243\0\u127a\0\u0483"+ + "\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4\0\u13fb\0\u1432"+ + "\0\u1469\0\u14a0\0\u063b\0\u063b\0\u14d7\0\u150e\0\u1545\0\u157c"+ + "\0\u0483\0\u0483"; private static int [] zzUnpackRowMap() { - int [] result = new int[145]; + int [] result = new int[146]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -231,71 +232,73 @@ public class __XmlLexer implements FlexLexer { "\1\0\26\34\11\0\2\34\4\0\3\34\1\123\6\0"+ "\4\34\1\0\2\34\1\0\11\34\1\124\14\34\23\0"+ "\1\125\54\0\2\43\4\0\3\43\1\126\6\0\4\43"+ - "\1\0\2\43\1\0\26\43\21\0\1\127\72\0\1\130"+ - "\52\0\2\50\4\0\3\50\1\131\6\0\4\50\1\0"+ - "\2\50\1\0\26\50\15\0\1\132\145\0\1\133\7\0"+ - "\1\134\145\0\1\135\2\0\25\136\1\137\31\136\1\140"+ - "\7\136\1\0\2\43\4\0\3\43\1\126\6\0\4\43"+ - "\1\0\2\43\1\0\22\43\1\141\3\43\11\0\2\43"+ - "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ - "\15\43\1\142\10\43\10\0\57\143\1\57\7\143\60\144"+ - "\1\57\6\144\25\0\1\145\42\0\3\100\4\0\1\100"+ - "\3\0\3\100\2\0\4\100\1\0\2\100\1\0\26\100"+ - "\23\0\1\146\53\0\17\106\1\0\42\106\1\147\4\106"+ - "\1\0\2\107\4\0\3\107\1\150\6\0\4\107\1\0"+ - "\2\107\1\151\26\107\12\0\1\152\40\0\1\153\24\0"+ - "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\1\107"+ - "\1\154\1\151\26\107\11\0\2\107\4\0\3\107\1\150"+ - "\6\0\4\107\1\0\2\107\1\151\2\107\1\155\6\107"+ - "\1\156\14\107\11\0\2\107\4\0\3\107\1\150\6\0"+ - "\4\107\1\0\2\107\1\151\6\107\1\157\17\107\11\0"+ - "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\2\107"+ - "\1\151\10\107\1\160\15\107\21\0\1\161\6\0\1\162"+ - "\1\0\1\163\45\0\2\120\4\0\3\120\7\0\4\120"+ - "\1\0\2\120\1\0\26\120\21\0\1\161\6\0\1\162"+ + "\1\0\2\43\1\0\26\43\10\0\11\44\1\127\66\44"+ + "\1\130\66\44\1\127\3\44\1\131\51\44\1\0\2\50"+ + "\4\0\3\50\1\132\6\0\4\50\1\0\2\50\1\0"+ + "\26\50\15\0\1\133\145\0\1\134\7\0\1\135\145\0"+ + "\1\136\2\0\25\137\1\140\31\137\1\141\7\137\1\0"+ + "\2\43\4\0\3\43\1\126\6\0\4\43\1\0\2\43"+ + "\1\0\22\43\1\142\3\43\11\0\2\43\4\0\3\43"+ + "\1\126\6\0\4\43\1\0\2\43\1\0\15\43\1\143"+ + "\10\43\10\0\57\144\1\57\7\144\60\145\1\57\6\145"+ + "\25\0\1\146\42\0\3\100\4\0\1\100\3\0\3\100"+ + "\2\0\4\100\1\0\2\100\1\0\26\100\21\0\1\130"+ + "\70\0\1\147\53\0\17\106\1\0\42\106\1\150\4\106"+ + "\1\0\2\107\4\0\3\107\1\151\6\0\4\107\1\0"+ + "\2\107\1\152\26\107\12\0\1\153\40\0\1\154\24\0"+ + "\2\107\4\0\3\107\1\151\6\0\4\107\1\0\1\107"+ + "\1\155\1\152\26\107\11\0\2\107\4\0\3\107\1\151"+ + "\6\0\4\107\1\0\2\107\1\152\2\107\1\156\6\107"+ + "\1\157\14\107\11\0\2\107\4\0\3\107\1\151\6\0"+ + "\4\107\1\0\2\107\1\152\6\107\1\160\17\107\11\0"+ + "\2\107\4\0\3\107\1\151\6\0\4\107\1\0\2\107"+ + "\1\152\10\107\1\161\15\107\21\0\1\162\6\0\1\163"+ + "\1\0\1\164\45\0\2\120\4\0\3\120\7\0\4\120"+ + "\1\0\2\120\1\0\26\120\21\0\1\162\6\0\1\163"+ "\47\0\2\123\4\0\3\123\7\0\4\123\1\0\2\123"+ "\1\0\26\123\11\0\2\34\4\0\3\34\1\123\6\0"+ - "\4\34\1\0\1\164\1\34\1\0\26\34\11\0\2\126"+ + "\4\34\1\0\1\165\1\34\1\0\26\34\11\0\2\126"+ "\4\0\3\126\7\0\4\126\1\0\2\126\1\0\26\126"+ - "\23\0\1\165\73\0\1\166\47\0\2\131\4\0\3\131"+ - "\7\0\4\131\1\0\2\131\1\0\26\131\10\0\57\132"+ - "\1\0\2\132\1\167\4\132\57\133\1\0\5\133\1\170"+ - "\1\133\60\134\1\0\1\134\1\167\4\134\60\135\1\0"+ - "\4\135\1\170\1\135\57\140\1\136\7\140\1\0\2\43"+ + "\10\0\11\44\1\0\55\44\13\0\1\166\53\0\11\44"+ + "\1\127\6\44\1\167\46\44\1\0\2\132\4\0\3\132"+ + "\7\0\4\132\1\0\2\132\1\0\26\132\10\0\57\133"+ + "\1\0\2\133\1\170\4\133\57\134\1\0\5\134\1\171"+ + "\1\134\60\135\1\0\1\135\1\170\4\135\60\136\1\0"+ + "\4\136\1\171\1\136\57\141\1\137\7\141\1\0\2\43"+ "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ - "\23\43\1\171\2\43\11\0\2\43\4\0\3\43\1\126"+ - "\6\0\4\43\1\0\2\43\1\0\20\43\1\172\5\43"+ - "\23\0\1\173\54\0\2\150\4\0\3\150\7\0\4\150"+ - "\1\0\2\150\1\151\26\150\12\0\1\152\25\0\1\174"+ - "\40\0\1\175\16\0\3\175\6\0\1\175\6\0\1\175"+ - "\2\0\1\175\3\0\1\175\3\0\1\175\13\0\2\107"+ - "\4\0\3\107\1\150\6\0\4\107\1\0\2\107\1\174"+ - "\26\107\11\0\2\107\4\0\3\107\1\150\6\0\4\107"+ - "\1\0\2\107\1\151\3\107\1\176\22\107\11\0\2\107"+ - "\4\0\3\107\1\150\6\0\4\107\1\0\2\107\1\151"+ - "\2\107\1\154\23\107\11\0\2\107\4\0\3\107\1\150"+ - "\6\0\4\107\1\0\2\107\1\151\3\107\1\111\22\107"+ - "\11\0\2\107\4\0\3\107\1\150\6\0\4\107\1\0"+ - "\2\107\1\151\4\107\1\156\21\107\21\0\1\177\76\0"+ - "\1\200\112\0\1\201\22\0\2\43\4\0\3\43\1\126"+ - "\6\0\4\43\1\0\2\43\1\0\24\43\1\202\1\43"+ - "\11\0\2\43\4\0\3\43\1\126\6\0\3\43\1\203"+ - "\1\0\2\43\1\0\26\43\12\0\1\175\16\0\3\175"+ - "\4\0\1\174\1\0\1\175\6\0\1\175\2\0\1\175"+ - "\3\0\1\175\3\0\1\175\13\0\2\107\4\0\3\107"+ - "\1\150\6\0\4\107\1\0\2\107\1\151\4\107\1\154"+ - "\21\107\32\0\1\204\65\0\1\205\46\0\2\43\4\0"+ + "\23\43\1\172\2\43\11\0\2\43\4\0\3\43\1\126"+ + "\6\0\4\43\1\0\2\43\1\0\20\43\1\173\5\43"+ + "\23\0\1\174\54\0\2\151\4\0\3\151\7\0\4\151"+ + "\1\0\2\151\1\152\26\151\12\0\1\153\25\0\1\175"+ + "\40\0\1\176\16\0\3\176\6\0\1\176\6\0\1\176"+ + "\2\0\1\176\3\0\1\176\3\0\1\176\13\0\2\107"+ + "\4\0\3\107\1\151\6\0\4\107\1\0\2\107\1\175"+ + "\26\107\11\0\2\107\4\0\3\107\1\151\6\0\4\107"+ + "\1\0\2\107\1\152\3\107\1\177\22\107\11\0\2\107"+ + "\4\0\3\107\1\151\6\0\4\107\1\0\2\107\1\152"+ + "\2\107\1\155\23\107\11\0\2\107\4\0\3\107\1\151"+ + "\6\0\4\107\1\0\2\107\1\152\3\107\1\111\22\107"+ + "\11\0\2\107\4\0\3\107\1\151\6\0\4\107\1\0"+ + "\2\107\1\152\4\107\1\157\21\107\21\0\1\200\76\0"+ + "\1\201\112\0\1\202\22\0\2\43\4\0\3\43\1\126"+ + "\6\0\4\43\1\0\2\43\1\0\24\43\1\203\1\43"+ + "\11\0\2\43\4\0\3\43\1\126\6\0\3\43\1\204"+ + "\1\0\2\43\1\0\26\43\12\0\1\176\16\0\3\176"+ + "\4\0\1\175\1\0\1\176\6\0\1\176\2\0\1\176"+ + "\3\0\1\176\3\0\1\176\13\0\2\107\4\0\3\107"+ + "\1\151\6\0\4\107\1\0\2\107\1\152\4\107\1\155"+ + "\21\107\32\0\1\205\65\0\1\206\46\0\2\43\4\0"+ "\3\43\1\126\6\0\4\43\1\0\2\43\1\0\25\43"+ - "\1\206\11\0\2\43\4\0\3\43\1\126\6\0\4\43"+ - "\1\0\2\43\1\0\17\43\1\207\6\43\33\0\1\210"+ - "\67\0\1\211\43\0\2\43\4\0\3\43\1\126\6\0"+ - "\1\212\3\43\1\0\2\43\1\0\26\43\11\0\2\43"+ + "\1\207\11\0\2\43\4\0\3\43\1\126\6\0\4\43"+ + "\1\0\2\43\1\0\17\43\1\210\6\43\33\0\1\211"+ + "\67\0\1\212\43\0\2\43\4\0\3\43\1\126\6\0"+ + "\1\213\3\43\1\0\2\43\1\0\26\43\11\0\2\43"+ "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ - "\21\43\1\213\4\43\34\0\1\214\110\0\1\215\43\0"+ - "\1\216\112\0\1\217\37\0\1\220\116\0\1\221\16\0"; + "\21\43\1\214\4\43\34\0\1\215\110\0\1\216\43\0"+ + "\1\217\112\0\1\220\37\0\1\221\116\0\1\222\16\0"; private static int [] zzUnpackTrans() { - int [] result = new int[5390]; + int [] result = new int[5555]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -336,17 +339,17 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\1\1\16\0\6\1\1\11\2\1\1\11\5\1\1\11"+ - "\4\1\1\11\2\1\1\11\1\1\1\11\2\1\4\11"+ - "\3\1\1\11\3\1\1\11\5\1\1\11\1\1\1\11"+ - "\5\1\1\11\10\0\2\11\1\1\1\0\1\11\2\1"+ - "\1\11\1\1\2\0\1\1\5\0\1\11\1\0\2\1"+ - "\3\0\2\11\1\0\1\11\12\0\1\1\4\11\2\1"+ + "\1\1\4\0\1\1\11\0\6\1\1\11\2\1\1\11"+ + "\5\1\1\11\11\1\1\11\2\1\4\11\3\1\1\11"+ + "\3\1\1\11\5\1\1\11\1\1\1\11\5\1\1\11"+ + "\10\0\2\11\1\1\1\0\1\11\2\1\1\11\1\1"+ + "\2\0\2\1\5\0\1\11\1\0\2\1\3\0\2\11"+ + "\1\0\1\11\12\0\1\1\1\11\1\1\2\11\2\1"+ "\2\11\2\0\1\11\2\0\2\1\2\0\2\1\2\0"+ "\2\1\4\0\2\11"; private static int [] zzUnpackAttribute() { - int [] result = new int[145]; + int [] result = new int[146]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -702,7 +705,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(ATTR_LIST); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; } case 44: break; - case 18: + case 19: { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; } case 45: break; @@ -710,11 +713,11 @@ public class __XmlLexer implements FlexLexer { { return XmlTokenType.XML_DOCTYPE_SYSTEM; } case 46: break; - case 17: + case 18: { return XmlTokenType.XML_EQ; } case 47: break; - case 9: + case 10: { return XmlTokenType.XML_TAG_CHARACTERS; } case 48: break; @@ -722,7 +725,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(CDATA); return XmlTokenType.XML_CDATA_START; } case 49: break; - case 5: + case 6: { yybegin(ATTR_LIST); pushState(TAG); return XmlTokenType.XML_NAME; } case 50: break; @@ -730,28 +733,28 @@ public class __XmlLexer implements FlexLexer { { yybegin(END_TAG); return XmlTokenType.XML_END_TAG_START; } case 51: break; - case 34: - { if (myConditionalCommentsSupport) { - yybegin(C_COMMENT_END); - return XmlTokenType.XML_CONDITIONAL_COMMENT_END_START; - } else return XmlTokenType.XML_COMMENT_CHARACTERS; - } - case 52: break; case 30: { return elTokenType; } - case 53: break; - case 10: + case 52: break; + case 11: { return XmlTokenType.XML_NAME; } - case 54: break; + case 53: break; case 40: { return XmlTokenType.XML_DOCTYPE_PUBLIC; } - case 55: break; + case 54: break; case 39: { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START; } + case 55: break; + case 13: + { if (myConditionalCommentsSupport) { + yybegin(C_COMMENT_START); + return XmlTokenType.XML_CONDITIONAL_COMMENT_START; + } else return XmlTokenType.XML_COMMENT_CHARACTERS; + } case 56: break; case 36: { return javaEmbeddedTokenType; @@ -765,7 +768,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(ATTR_LIST); pushState(PROCESSING_INSTRUCTION); return XmlTokenType.XML_NAME; } case 59: break; - case 2: + case 3: { return XmlTokenType.XML_REAL_WHITE_SPACE; } case 60: break; @@ -777,11 +780,11 @@ public class __XmlLexer implements FlexLexer { { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_END; } case 62: break; - case 19: + case 12: { return XmlTokenType.XML_BAD_CHARACTER; } case 63: break; - case 7: + case 8: { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; } case 64: break; @@ -789,79 +792,79 @@ public class __XmlLexer implements FlexLexer { { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_START_END; } case 65: break; - case 33: - { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; - } - case 66: break; case 4: - { yybegin(TAG); return XmlTokenType.XML_START_TAG_START; - } - case 67: break; - case 26: - { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; - } - case 68: break; - case 24: - { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; - } - case 69: break; - case 8: - { yybegin(PI_ANY); return XmlTokenType.XML_NAME; - } - case 70: break; - case 12: - { if (myConditionalCommentsSupport) { - yybegin(C_COMMENT_START); - return XmlTokenType.XML_CONDITIONAL_COMMENT_START; - } else return XmlTokenType.XML_COMMENT_CHARACTERS; - } - case 71: break; - case 13: - { yybegin(ATTR); return XmlTokenType.XML_NAME; - } - case 72: break; - case 14: - { yybegin(ATTR_LIST); yypushback(yylength()); - } - case 73: break; - case 21: - { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END; - } - case 74: break; - case 38: - { return XmlTokenType.XML_CHAR_ENTITY_REF; - } - case 75: break; - case 6: - { return XmlTokenType.XML_WHITE_SPACE; - } - case 76: break; - case 31: - { return XmlTokenType.XML_ENTITY_REF_TOKEN; - } - case 77: break; - case 15: - { yybegin(ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; - } - case 78: break; - case 16: - { yybegin(ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; - } - case 79: break; - case 22: - { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS; - } - case 80: break; - case 37: - { yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END; - } - case 81: break; - case 3: { if(yystate() == YYINITIAL){ return XmlTokenType.XML_BAD_CHARACTER; } else yybegin(popState()); yypushback(yylength()); } + case 66: break; + case 33: + { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; + } + case 67: break; + case 5: + { yybegin(TAG); return XmlTokenType.XML_START_TAG_START; + } + case 68: break; + case 34: + { if (myConditionalCommentsSupport) { + yybegin(C_COMMENT_END); + return XmlTokenType.XML_CONDITIONAL_COMMENT_END_START; + } else return XmlTokenType.XML_COMMENT_CHARACTERS; + } + case 69: break; + case 26: + { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; + } + case 70: break; + case 24: + { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; + } + case 71: break; + case 9: + { yybegin(PI_ANY); return XmlTokenType.XML_NAME; + } + case 72: break; + case 14: + { yybegin(ATTR); return XmlTokenType.XML_NAME; + } + case 73: break; + case 15: + { yybegin(ATTR_LIST); yypushback(yylength()); + } + case 74: break; + case 21: + { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END; + } + case 75: break; + case 38: + { return XmlTokenType.XML_CHAR_ENTITY_REF; + } + case 76: break; + case 7: + { return XmlTokenType.XML_WHITE_SPACE; + } + case 77: break; + case 31: + { return XmlTokenType.XML_ENTITY_REF_TOKEN; + } + case 78: break; + case 16: + { yybegin(ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; + } + case 79: break; + case 17: + { yybegin(ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; + } + case 80: break; + case 22: + { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS; + } + case 81: break; + case 37: + { yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END; + } case 82: break; case 35: { return elTokenType2; @@ -875,7 +878,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(DOCTYPE); return XmlTokenType.XML_DOCTYPE_START; } case 85: break; - case 11: + case 2: { return XmlTokenType.XML_COMMENT_CHARACTERS; } case 86: break; From 22608c043f0d7c678305b800c00f7dddf930ebd3 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Mon, 26 Oct 2009 22:35:29 +0300 Subject: [PATCH 15/18] Fix bookmarks popup toolbar actions broken with introduction of FilteringListModel. --- .../ide/bookmarks/BookmarkManager.java | 4 ++-- .../bookmarks/actions/BookmarksAction.java | 18 +++++++------- .../src/com/intellij/ui/ListUtil.java | 24 +++++++++++++++++-- .../ui/speedSearch/FilteringListModel.java | 10 ++++++-- 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/bookmarks/BookmarkManager.java b/platform/lang-impl/src/com/intellij/ide/bookmarks/BookmarkManager.java index 79837c313d62..b70dec36df83 100644 --- a/platform/lang-impl/src/com/intellij/ide/bookmarks/BookmarkManager.java +++ b/platform/lang-impl/src/com/intellij/ide/bookmarks/BookmarkManager.java @@ -87,7 +87,7 @@ public class BookmarkManager implements PersistentStateComponent { public void addTextBookmark(VirtualFile file, int lineIndex, String description) { Bookmark b = new Bookmark(myProject, file, lineIndex, description); myBus.syncPublisher(BookmarksListener.TOPIC).bookmarkAdded(b); - myBookmarks.add(b); + myBookmarks.add(0, b); } public static String getAutoDescription(final Editor editor, final int lineIndex) { @@ -108,7 +108,7 @@ public class BookmarkManager implements PersistentStateComponent { if (findFileBookmark(file) != null) return; Bookmark b = new Bookmark(myProject, file, description); - myBookmarks.add(b); + myBookmarks.add(0, b); myBus.syncPublisher(BookmarksListener.TOPIC).bookmarkAdded(b); } diff --git a/platform/lang-impl/src/com/intellij/ide/bookmarks/actions/BookmarksAction.java b/platform/lang-impl/src/com/intellij/ide/bookmarks/actions/BookmarksAction.java index 73b777affd7f..a317b6fd5439 100644 --- a/platform/lang-impl/src/com/intellij/ide/bookmarks/actions/BookmarksAction.java +++ b/platform/lang-impl/src/com/intellij/ide/bookmarks/actions/BookmarksAction.java @@ -49,6 +49,7 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; import com.intellij.ui.*; +import com.intellij.ui.speedSearch.FilteringListModel; import com.intellij.util.Alarm; import com.intellij.util.Function; import org.jetbrains.annotations.Nullable; @@ -257,7 +258,7 @@ public class BookmarksAction extends AnAction implements DumbAware { final DefaultListModel model = new DefaultListModel(); for (Bookmark bookmark : BookmarkManager.getInstance(project).getValidBookmarks()) { - model.insertElementAt(new BookmarkItem(bookmark), 0); + model.addElement(new BookmarkItem(bookmark)); } if (bookmarkAtPlace == null) { @@ -601,11 +602,6 @@ public class BookmarksAction extends AnAction implements DumbAware { b.setDescription(description); - DefaultListModel model = (DefaultListModel)myList.getModel(); - String fake = "Fake Element to make list re-count its size"; - model.addElement(fake); - model.removeElement(fake); - myPopup.setUiVisible(true); myPopup.setSize(myPopup.getContent().getPreferredSize()); } @@ -642,6 +638,12 @@ public class BookmarksAction extends AnAction implements DumbAware { } } + private static boolean notFiltered(JList list) { + if (!(list.getModel() instanceof FilteringListModel)) return true; + final FilteringListModel model = (FilteringListModel)list.getModel(); + return model.getOriginalModel().getSize() == model.getSize(); + } + private static class MoveBookmarkUpAction extends AnAction { private final Project myProject; private final JList myList; @@ -655,7 +657,7 @@ public class BookmarksAction extends AnAction implements DumbAware { @Override public void update(AnActionEvent e) { - e.getPresentation().setEnabled(getSelectedBookmarks(myList).size() == 1 && myList.getSelectedIndex() > 0); + e.getPresentation().setEnabled(notFiltered(myList) && getSelectedBookmarks(myList).size() == 1 && myList.getSelectedIndex() > 0); } @Override @@ -679,7 +681,7 @@ public class BookmarksAction extends AnAction implements DumbAware { @Override public void update(AnActionEvent e) { int modelSize = myList.getModel().getSize(); - if (modelSize == 0) { + if (modelSize == 0 || !notFiltered(myList)) { e.getPresentation().setEnabled(false); } else { diff --git a/platform/platform-api/src/com/intellij/ui/ListUtil.java b/platform/platform-api/src/com/intellij/ui/ListUtil.java index 505d17fa18a9..dc3c86baac34 100644 --- a/platform/platform-api/src/com/intellij/ui/ListUtil.java +++ b/platform/platform-api/src/com/intellij/ui/ListUtil.java @@ -17,6 +17,7 @@ package com.intellij.ui; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Condition; +import com.intellij.ui.speedSearch.FilteringListModel; import javax.swing.*; import javax.swing.event.ListSelectionEvent; @@ -120,7 +121,7 @@ public class ListUtil { } public static int moveSelectedItemsUp(JList list) { - DefaultListModel model = (DefaultListModel)list.getModel(); + DefaultListModel model = getModel(list); int[] indices = list.getSelectedIndices(); if (!canMoveSelectedItemsUp(list)) return 0; for(int i = 0; i < indices.length; i++){ @@ -144,7 +145,7 @@ public class ListUtil { } public static int moveSelectedItemsDown(JList list) { - DefaultListModel model = (DefaultListModel)list.getModel(); + DefaultListModel model = getModel(list); int[] indices = list.getSelectedIndices(); if (!canMoveSelectedItemsDown(list)) return 0; for(int i = indices.length - 1; i >= 0 ; i--){ @@ -162,6 +163,14 @@ public class ListUtil { return indices.length; } + private static DefaultListModel getModel(JList list) { + final ListModel model = list.getModel(); + if (model instanceof FilteringListModel) { + return (DefaultListModel)((FilteringListModel)model).getOriginalModel(); + } + return (DefaultListModel)model; + } + public static boolean canMoveSelectedItemsDown(JList list) { ListModel model = list.getModel(); int[] indices = list.getSelectedIndices(); @@ -256,6 +265,7 @@ public class ListUtil { private static ListModelExtension getExtensions(ListModel model) { if (model instanceof DefaultListModel) return DEFAULT_MODEL; if (model instanceof SortedListModel) return SORTED_MODEL; + if (model instanceof FilteringListModel) return FILTERED_MODEL; if (model == null) LOG.assertTrue(false); else LOG.assertTrue(false, "Unknown model class: " + model.getClass().getName()); @@ -286,4 +296,14 @@ public class ListUtil { model.remove(index); } }; + + private static final ListModelExtension FILTERED_MODEL = new ListModelExtension() { + public Object get(FilteringListModel model, int index) { + return model.getElementAt(index); + } + + public void remove(FilteringListModel model, int index) { + model.remove(index); + } + }; } diff --git a/platform/platform-api/src/com/intellij/ui/speedSearch/FilteringListModel.java b/platform/platform-api/src/com/intellij/ui/speedSearch/FilteringListModel.java index 1e541312cd44..0cf9487760a1 100644 --- a/platform/platform-api/src/com/intellij/ui/speedSearch/FilteringListModel.java +++ b/platform/platform-api/src/com/intellij/ui/speedSearch/FilteringListModel.java @@ -31,7 +31,6 @@ import java.util.List; * @author max */ public class FilteringListModel extends AbstractListModel { - private final JList myList; private final ListModel myOriginalModel; private final List myData = new ArrayList(); private Condition myCondition = null; @@ -52,7 +51,6 @@ public class FilteringListModel extends AbstractListModel { }; protected FilteringListModel(JList list) { - myList = list; myOriginalModel = list.getModel(); myOriginalModel.addListDataListener(myListDataListener); @@ -111,4 +109,12 @@ public class FilteringListModel extends AbstractListModel { public boolean contains(T value) { return myData.contains(value); } + + public ListModel getOriginalModel() { + return myOriginalModel; + } + + public void remove(int index) { + ((DefaultListModel)myOriginalModel).removeElement(myData.get(index)); + } } From 3989f4efd78872c9e70f28ed99d02bd9fa60bcf9 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Tue, 27 Oct 2009 00:22:30 +0300 Subject: [PATCH 16/18] added some waitForSmartMode() to reduce possibility of IndexNotReadyException() --- .../impl/src/com/intellij/compiler/impl/CompileDriver.java | 4 ++++ .../src/com/intellij/util/indexing/FileBasedIndex.java | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java index ff3f5491d80a..cce777214891 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java @@ -859,6 +859,8 @@ public class CompileDriver { throw new ExitException(ExitStatus.CANCELLED); } + DumbService.getInstance(myProject).waitForSmartMode(); + if (snapshot == null || ContainerUtil.intersects(generatedTypes, compilerManager.getRegisteredInputTypes(translator))) { // rescan snapshot if previously generated files can influence the input of this compiler snapshot = ApplicationManager.getApplication().runReadAction(new Computable() { @@ -1318,6 +1320,7 @@ public class CompileDriver { finally { CompilerUtil.refreshIOFiles(filesToRefresh); if (!generatedFiles.isEmpty()) { + DumbService.getInstance(myProject).waitForSmartMode(); List vFiles = ApplicationManager.getApplication().runReadAction(new Computable>() { public List compute() { final ArrayList vFiles = new ArrayList(generatedFiles.size()); @@ -1544,6 +1547,7 @@ public class CompileDriver { final List toProcess = new ArrayList(); final Set allUrls = new HashSet(); final IOException[] ex = {null}; + DumbService.getInstance(myProject).waitForSmartMode(); ApplicationManager.getApplication().runReadAction(new Runnable() { public void run() { try { diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java index fbc60acce57c..aea6b47bb529 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java @@ -591,10 +591,9 @@ public class FileBasedIndex implements ApplicationComponent { return; //indexed eagerly in foreground while building unindexed file list } - final ProgressManager progressManager = ProgressManager.getInstance(); - progressManager.checkCanceled(); // DumbModeAction.CANCEL + ProgressManager.checkCanceled(); // DumbModeAction.CANCEL - final ProgressIndicator progressIndicator = progressManager.getProgressIndicator(); + final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator(); if (progressIndicator instanceof BackgroundableProcessIndicator) { final BackgroundableProcessIndicator indicator = (BackgroundableProcessIndicator)progressIndicator; if (indicator.getDumbModeAction() == DumbModeAction.WAIT) { From 4c7ba40579dc70bca276d72086362514708caeb9 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Tue, 27 Oct 2009 00:23:56 +0300 Subject: [PATCH 17/18] clear output dir on rebuild is true by default (fed up with complaints about compiler errors in 'green' sources) --- .../com/intellij/compiler/CompilerWorkspaceConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java b/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java index 0ec5b7887301..154dcbf457d2 100644 --- a/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java +++ b/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java @@ -40,7 +40,7 @@ public class CompilerWorkspaceConfiguration implements PersistentStateComponent< public boolean AUTO_SHOW_ERRORS_IN_EDITOR = true; @Deprecated public boolean CLOSE_MESSAGE_VIEW_IF_SUCCESS = true; public boolean COMPILE_DEPENDENT_FILES = false; - public boolean CLEAR_OUTPUT_DIRECTORY = false; + public boolean CLEAR_OUTPUT_DIRECTORY = true; public boolean ASSERT_NOT_NULL = true; public static CompilerWorkspaceConfiguration getInstance(Project project) { From 96e71cf9bc73d6d0c5e486c14e4c54799b4a7a6b Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Tue, 27 Oct 2009 01:32:52 +0300 Subject: [PATCH 18/18] fixing tests (xml lexer still reports unexpected character in comment content), 2 --- .../src/com/intellij/lexer/__XmlLexer.java | 225 +++++++++--------- 1 file changed, 112 insertions(+), 113 deletions(-) diff --git a/xml/impl/src/com/intellij/lexer/__XmlLexer.java b/xml/impl/src/com/intellij/lexer/__XmlLexer.java index ac4b50698288..b173839647b1 100644 --- a/xml/impl/src/com/intellij/lexer/__XmlLexer.java +++ b/xml/impl/src/com/intellij/lexer/__XmlLexer.java @@ -1,17 +1,17 @@ -/* The following code was generated by JFlex 1.4.1 on 26.10.09 22:00 */ +/* The following code was generated by JFlex 1.4.1 on 27.10.09 1:12 */ /* It's an automatically generated code. Do not modify it. */ package com.intellij.lexer; import com.intellij.psi.tree.IElementType; -import com.intellij.psi.xml.XmlElementType; -import com.intellij.psi.xml.XmlTokenType; +import com.intellij.psi.*; +import com.intellij.psi.xml.*; /** * This class is a scanner generated by * JFlex 1.4.1 - * on 26.10.09 22:00 from the specification file + * on 27.10.09 1:12 from the specification file * C:/IDEA/tools/lexer/_XmlLexer.flex */ public class __XmlLexer implements FlexLexer { @@ -115,20 +115,20 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = - "\1\1\4\0\1\2\11\0\1\1\1\3\1\1\1\4"+ - "\1\5\1\1\1\4\1\6\1\7\1\10\2\4\2\11"+ - "\1\4\4\12\1\13\1\2\1\14\1\2\1\15\1\16"+ - "\3\17\1\20\1\21\1\22\2\23\1\14\1\23\1\24"+ - "\3\23\1\25\1\4\2\13\2\4\2\1\1\26\1\2"+ - "\4\26\1\27\10\0\1\30\1\31\1\6\1\0\1\32"+ - "\2\11\1\33\1\13\2\0\1\2\1\16\5\0\1\34"+ - "\1\0\2\13\3\0\1\35\1\36\1\0\1\37\12\0"+ - "\1\40\1\41\1\42\1\43\1\44\2\13\1\45\1\46"+ - "\2\0\1\47\2\0\2\13\2\0\2\13\2\0\1\50"+ - "\1\51\4\0\1\52\1\53"; + "\1\1\16\0\1\1\1\2\1\1\1\3\1\4\1\1"+ + "\1\3\1\5\1\6\1\7\2\3\2\10\1\3\4\11"+ + "\1\12\1\13\1\14\1\13\1\15\1\16\3\17\1\20"+ + "\1\21\1\22\2\23\1\14\1\23\1\24\3\23\1\25"+ + "\1\3\2\12\2\3\2\1\1\26\1\13\4\26\1\27"+ + "\10\0\1\30\1\31\1\5\1\0\1\32\2\10\1\33"+ + "\1\12\2\0\1\16\5\0\1\34\1\0\2\12\3\0"+ + "\1\35\1\36\1\0\1\37\12\0\1\40\1\41\1\42"+ + "\1\43\1\44\2\12\1\45\1\46\2\0\1\47\2\0"+ + "\2\12\2\0\2\12\2\0\1\50\1\51\4\0\1\52"+ + "\1\53"; private static int [] zzUnpackAction() { - int [] result = new int[146]; + int [] result = new int[145]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -157,24 +157,24 @@ public class __XmlLexer implements FlexLexer { "\0\u01b8\0\u01ef\0\u0226\0\u025d\0\u0294\0\u02cb\0\u0302\0\u0339"+ "\0\u0370\0\u03a7\0\u03de\0\u0415\0\u044c\0\u0483\0\u04ba\0\u04f1"+ "\0\u0483\0\u0528\0\u055f\0\u0596\0\u05cd\0\u0604\0\u0483\0\u03de"+ - "\0\u0528\0\u0604\0\u063b\0\u0672\0\u06a9\0\u06e0\0\u0672\0\u0717"+ - "\0\u0483\0\u03de\0\u0528\0\u0483\0\u0483\0\u0483\0\u0483\0\u074e"+ - "\0\u03de\0\u0528\0\u0483\0\u0785\0\u07bc\0\u07f3\0\u0483\0\u082a"+ - "\0\u0861\0\u0898\0\u08cf\0\u0906\0\u0483\0\u093d\0\u0483\0\u0974"+ - "\0\u09ab\0\u03de\0\u0528\0\u09e2\0\u0483\0\u0a19\0\u0a50\0\u0a87"+ - "\0\u0abe\0\u0af5\0\u0b2c\0\u0b63\0\u0b9a\0\u0483\0\u0483\0\u0bd1"+ - "\0\u0c08\0\u0483\0\u0c3f\0\u0c76\0\u0483\0\u0cad\0\u0ce4\0\u0d1b"+ - "\0\u0d52\0\u0d89\0\u0dc0\0\u0df7\0\u0e2e\0\u0e65\0\u082a\0\u0483"+ - "\0\u0e9c\0\u0ed3\0\u0f0a\0\u08cf\0\u0906\0\u0f41\0\u0483\0\u0483"+ - "\0\u0f78\0\u0483\0\u0faf\0\u0fe6\0\u101d\0\u1054\0\u108b\0\u10c2"+ - "\0\u10f9\0\u1130\0\u1167\0\u119e\0\u0596\0\u0483\0\u0672\0\u0483"+ - "\0\u0483\0\u11d5\0\u120c\0\u0483\0\u0483\0\u1243\0\u127a\0\u0483"+ - "\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4\0\u13fb\0\u1432"+ - "\0\u1469\0\u14a0\0\u063b\0\u063b\0\u14d7\0\u150e\0\u1545\0\u157c"+ - "\0\u0483\0\u0483"; + "\0\u0528\0\u0604\0\u063b\0\u0483\0\u0672\0\u06a9\0\u0483\0\u06e0"+ + "\0\u0483\0\u03de\0\u0528\0\u0483\0\u0483\0\u0483\0\u0483\0\u0717"+ + "\0\u03de\0\u0528\0\u0483\0\u074e\0\u0785\0\u07bc\0\u0483\0\u07f3"+ + "\0\u082a\0\u0861\0\u0898\0\u08cf\0\u0483\0\u0906\0\u0483\0\u093d"+ + "\0\u0974\0\u03de\0\u0528\0\u09ab\0\u0483\0\u09e2\0\u0a19\0\u0a50"+ + "\0\u0a87\0\u0abe\0\u0af5\0\u0b2c\0\u0b63\0\u0483\0\u0483\0\u0b9a"+ + "\0\u0bd1\0\u0483\0\u0c08\0\u0c3f\0\u0483\0\u0c76\0\u0cad\0\u0ce4"+ + "\0\u0d1b\0\u0d52\0\u0d89\0\u0dc0\0\u0df7\0\u07f3\0\u0483\0\u0e2e"+ + "\0\u0e65\0\u0e9c\0\u0898\0\u08cf\0\u0ed3\0\u0483\0\u0483\0\u0f0a"+ + "\0\u0483\0\u0f41\0\u0f78\0\u0faf\0\u0fe6\0\u101d\0\u1054\0\u108b"+ + "\0\u10c2\0\u10f9\0\u1130\0\u0596\0\u0483\0\u0483\0\u0483\0\u0483"+ + "\0\u1167\0\u119e\0\u0483\0\u0483\0\u11d5\0\u120c\0\u0483\0\u1243"+ + "\0\u127a\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4\0\u13fb"+ + "\0\u1432\0\u063b\0\u063b\0\u1469\0\u14a0\0\u14d7\0\u150e\0\u0483"+ + "\0\u0483"; private static int [] zzUnpackRowMap() { - int [] result = new int[146]; + int [] result = new int[145]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -232,73 +232,72 @@ public class __XmlLexer implements FlexLexer { "\1\0\26\34\11\0\2\34\4\0\3\34\1\123\6\0"+ "\4\34\1\0\2\34\1\0\11\34\1\124\14\34\23\0"+ "\1\125\54\0\2\43\4\0\3\43\1\126\6\0\4\43"+ - "\1\0\2\43\1\0\26\43\10\0\11\44\1\127\66\44"+ - "\1\130\66\44\1\127\3\44\1\131\51\44\1\0\2\50"+ - "\4\0\3\50\1\132\6\0\4\50\1\0\2\50\1\0"+ - "\26\50\15\0\1\133\145\0\1\134\7\0\1\135\145\0"+ - "\1\136\2\0\25\137\1\140\31\137\1\141\7\137\1\0"+ + "\1\0\2\43\1\0\26\43\10\0\11\44\1\127\55\44"+ + "\15\0\1\130\52\0\2\50\4\0\3\50\1\131\6\0"+ + "\4\50\1\0\2\50\1\0\26\50\15\0\1\132\145\0"+ + "\1\133\7\0\1\134\145\0\1\135\2\0\25\136\1\137"+ + "\31\136\1\140\7\136\1\0\2\43\4\0\3\43\1\126"+ + "\6\0\4\43\1\0\2\43\1\0\22\43\1\141\3\43"+ + "\11\0\2\43\4\0\3\43\1\126\6\0\4\43\1\0"+ + "\2\43\1\0\15\43\1\142\10\43\10\0\57\143\1\57"+ + "\7\143\60\144\1\57\6\144\25\0\1\145\42\0\3\100"+ + "\4\0\1\100\3\0\3\100\2\0\4\100\1\0\2\100"+ + "\1\0\26\100\21\0\1\127\70\0\1\146\53\0\17\106"+ + "\1\0\42\106\1\147\4\106\1\0\2\107\4\0\3\107"+ + "\1\150\6\0\4\107\1\0\2\107\1\151\26\107\12\0"+ + "\1\152\40\0\1\153\24\0\2\107\4\0\3\107\1\150"+ + "\6\0\4\107\1\0\1\107\1\154\1\151\26\107\11\0"+ + "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\2\107"+ + "\1\151\2\107\1\155\6\107\1\156\14\107\11\0\2\107"+ + "\4\0\3\107\1\150\6\0\4\107\1\0\2\107\1\151"+ + "\6\107\1\157\17\107\11\0\2\107\4\0\3\107\1\150"+ + "\6\0\4\107\1\0\2\107\1\151\10\107\1\160\15\107"+ + "\21\0\1\161\6\0\1\162\1\0\1\163\45\0\2\120"+ + "\4\0\3\120\7\0\4\120\1\0\2\120\1\0\26\120"+ + "\21\0\1\161\6\0\1\162\47\0\2\123\4\0\3\123"+ + "\7\0\4\123\1\0\2\123\1\0\26\123\11\0\2\34"+ + "\4\0\3\34\1\123\6\0\4\34\1\0\1\164\1\34"+ + "\1\0\26\34\11\0\2\126\4\0\3\126\7\0\4\126"+ + "\1\0\2\126\1\0\26\126\23\0\1\165\73\0\1\166"+ + "\47\0\2\131\4\0\3\131\7\0\4\131\1\0\2\131"+ + "\1\0\26\131\10\0\57\132\1\0\2\132\1\167\4\132"+ + "\57\133\1\0\5\133\1\170\1\133\60\134\1\0\1\134"+ + "\1\167\4\134\60\135\1\0\4\135\1\170\1\135\57\140"+ + "\1\136\7\140\1\0\2\43\4\0\3\43\1\126\6\0"+ + "\4\43\1\0\2\43\1\0\23\43\1\171\2\43\11\0"+ "\2\43\4\0\3\43\1\126\6\0\4\43\1\0\2\43"+ - "\1\0\22\43\1\142\3\43\11\0\2\43\4\0\3\43"+ - "\1\126\6\0\4\43\1\0\2\43\1\0\15\43\1\143"+ - "\10\43\10\0\57\144\1\57\7\144\60\145\1\57\6\145"+ - "\25\0\1\146\42\0\3\100\4\0\1\100\3\0\3\100"+ - "\2\0\4\100\1\0\2\100\1\0\26\100\21\0\1\130"+ - "\70\0\1\147\53\0\17\106\1\0\42\106\1\150\4\106"+ - "\1\0\2\107\4\0\3\107\1\151\6\0\4\107\1\0"+ - "\2\107\1\152\26\107\12\0\1\153\40\0\1\154\24\0"+ - "\2\107\4\0\3\107\1\151\6\0\4\107\1\0\1\107"+ - "\1\155\1\152\26\107\11\0\2\107\4\0\3\107\1\151"+ - "\6\0\4\107\1\0\2\107\1\152\2\107\1\156\6\107"+ - "\1\157\14\107\11\0\2\107\4\0\3\107\1\151\6\0"+ - "\4\107\1\0\2\107\1\152\6\107\1\160\17\107\11\0"+ - "\2\107\4\0\3\107\1\151\6\0\4\107\1\0\2\107"+ - "\1\152\10\107\1\161\15\107\21\0\1\162\6\0\1\163"+ - "\1\0\1\164\45\0\2\120\4\0\3\120\7\0\4\120"+ - "\1\0\2\120\1\0\26\120\21\0\1\162\6\0\1\163"+ - "\47\0\2\123\4\0\3\123\7\0\4\123\1\0\2\123"+ - "\1\0\26\123\11\0\2\34\4\0\3\34\1\123\6\0"+ - "\4\34\1\0\1\165\1\34\1\0\26\34\11\0\2\126"+ - "\4\0\3\126\7\0\4\126\1\0\2\126\1\0\26\126"+ - "\10\0\11\44\1\0\55\44\13\0\1\166\53\0\11\44"+ - "\1\127\6\44\1\167\46\44\1\0\2\132\4\0\3\132"+ - "\7\0\4\132\1\0\2\132\1\0\26\132\10\0\57\133"+ - "\1\0\2\133\1\170\4\133\57\134\1\0\5\134\1\171"+ - "\1\134\60\135\1\0\1\135\1\170\4\135\60\136\1\0"+ - "\4\136\1\171\1\136\57\141\1\137\7\141\1\0\2\43"+ - "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ - "\23\43\1\172\2\43\11\0\2\43\4\0\3\43\1\126"+ - "\6\0\4\43\1\0\2\43\1\0\20\43\1\173\5\43"+ - "\23\0\1\174\54\0\2\151\4\0\3\151\7\0\4\151"+ - "\1\0\2\151\1\152\26\151\12\0\1\153\25\0\1\175"+ - "\40\0\1\176\16\0\3\176\6\0\1\176\6\0\1\176"+ - "\2\0\1\176\3\0\1\176\3\0\1\176\13\0\2\107"+ - "\4\0\3\107\1\151\6\0\4\107\1\0\2\107\1\175"+ - "\26\107\11\0\2\107\4\0\3\107\1\151\6\0\4\107"+ - "\1\0\2\107\1\152\3\107\1\177\22\107\11\0\2\107"+ - "\4\0\3\107\1\151\6\0\4\107\1\0\2\107\1\152"+ - "\2\107\1\155\23\107\11\0\2\107\4\0\3\107\1\151"+ - "\6\0\4\107\1\0\2\107\1\152\3\107\1\111\22\107"+ - "\11\0\2\107\4\0\3\107\1\151\6\0\4\107\1\0"+ - "\2\107\1\152\4\107\1\157\21\107\21\0\1\200\76\0"+ - "\1\201\112\0\1\202\22\0\2\43\4\0\3\43\1\126"+ - "\6\0\4\43\1\0\2\43\1\0\24\43\1\203\1\43"+ - "\11\0\2\43\4\0\3\43\1\126\6\0\3\43\1\204"+ - "\1\0\2\43\1\0\26\43\12\0\1\176\16\0\3\176"+ - "\4\0\1\175\1\0\1\176\6\0\1\176\2\0\1\176"+ - "\3\0\1\176\3\0\1\176\13\0\2\107\4\0\3\107"+ - "\1\151\6\0\4\107\1\0\2\107\1\152\4\107\1\155"+ - "\21\107\32\0\1\205\65\0\1\206\46\0\2\43\4\0"+ - "\3\43\1\126\6\0\4\43\1\0\2\43\1\0\25\43"+ - "\1\207\11\0\2\43\4\0\3\43\1\126\6\0\4\43"+ - "\1\0\2\43\1\0\17\43\1\210\6\43\33\0\1\211"+ - "\67\0\1\212\43\0\2\43\4\0\3\43\1\126\6\0"+ - "\1\213\3\43\1\0\2\43\1\0\26\43\11\0\2\43"+ - "\4\0\3\43\1\126\6\0\4\43\1\0\2\43\1\0"+ - "\21\43\1\214\4\43\34\0\1\215\110\0\1\216\43\0"+ - "\1\217\112\0\1\220\37\0\1\221\116\0\1\222\16\0"; + "\1\0\20\43\1\172\5\43\23\0\1\173\54\0\2\150"+ + "\4\0\3\150\7\0\4\150\1\0\2\150\1\151\26\150"+ + "\12\0\1\152\25\0\1\174\40\0\1\175\16\0\3\175"+ + "\6\0\1\175\6\0\1\175\2\0\1\175\3\0\1\175"+ + "\3\0\1\175\13\0\2\107\4\0\3\107\1\150\6\0"+ + "\4\107\1\0\2\107\1\174\26\107\11\0\2\107\4\0"+ + "\3\107\1\150\6\0\4\107\1\0\2\107\1\151\3\107"+ + "\1\176\22\107\11\0\2\107\4\0\3\107\1\150\6\0"+ + "\4\107\1\0\2\107\1\151\2\107\1\154\23\107\11\0"+ + "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\2\107"+ + "\1\151\3\107\1\111\22\107\11\0\2\107\4\0\3\107"+ + "\1\150\6\0\4\107\1\0\2\107\1\151\4\107\1\156"+ + "\21\107\21\0\1\177\76\0\1\200\112\0\1\201\22\0"+ + "\2\43\4\0\3\43\1\126\6\0\4\43\1\0\2\43"+ + "\1\0\24\43\1\202\1\43\11\0\2\43\4\0\3\43"+ + "\1\126\6\0\3\43\1\203\1\0\2\43\1\0\26\43"+ + "\12\0\1\175\16\0\3\175\4\0\1\174\1\0\1\175"+ + "\6\0\1\175\2\0\1\175\3\0\1\175\3\0\1\175"+ + "\13\0\2\107\4\0\3\107\1\150\6\0\4\107\1\0"+ + "\2\107\1\151\4\107\1\154\21\107\32\0\1\204\65\0"+ + "\1\205\46\0\2\43\4\0\3\43\1\126\6\0\4\43"+ + "\1\0\2\43\1\0\25\43\1\206\11\0\2\43\4\0"+ + "\3\43\1\126\6\0\4\43\1\0\2\43\1\0\17\43"+ + "\1\207\6\43\33\0\1\210\67\0\1\211\43\0\2\43"+ + "\4\0\3\43\1\126\6\0\1\212\3\43\1\0\2\43"+ + "\1\0\26\43\11\0\2\43\4\0\3\43\1\126\6\0"+ + "\4\43\1\0\2\43\1\0\21\43\1\213\4\43\34\0"+ + "\1\214\110\0\1\215\43\0\1\216\112\0\1\217\37\0"+ + "\1\220\116\0\1\221\16\0"; private static int [] zzUnpackTrans() { - int [] result = new int[5555]; + int [] result = new int[5445]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -339,17 +338,17 @@ public class __XmlLexer implements FlexLexer { private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\1\1\4\0\1\1\11\0\6\1\1\11\2\1\1\11"+ - "\5\1\1\11\11\1\1\11\2\1\4\11\3\1\1\11"+ - "\3\1\1\11\5\1\1\11\1\1\1\11\5\1\1\11"+ - "\10\0\2\11\1\1\1\0\1\11\2\1\1\11\1\1"+ - "\2\0\2\1\5\0\1\11\1\0\2\1\3\0\2\11"+ - "\1\0\1\11\12\0\1\1\1\11\1\1\2\11\2\1"+ + "\1\1\16\0\6\1\1\11\2\1\1\11\5\1\1\11"+ + "\4\1\1\11\2\1\1\11\1\1\1\11\2\1\4\11"+ + "\3\1\1\11\3\1\1\11\5\1\1\11\1\1\1\11"+ + "\5\1\1\11\10\0\2\11\1\1\1\0\1\11\2\1"+ + "\1\11\1\1\2\0\1\1\5\0\1\11\1\0\2\1"+ + "\3\0\2\11\1\0\1\11\12\0\1\1\4\11\2\1"+ "\2\11\2\0\1\11\2\0\2\1\2\0\2\1\2\0"+ "\2\1\4\0\2\11"; private static int [] zzUnpackAttribute() { - int [] result = new int[146]; + int [] result = new int[145]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -717,7 +716,7 @@ public class __XmlLexer implements FlexLexer { { return XmlTokenType.XML_EQ; } case 47: break; - case 10: + case 9: { return XmlTokenType.XML_TAG_CHARACTERS; } case 48: break; @@ -725,7 +724,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(CDATA); return XmlTokenType.XML_CDATA_START; } case 49: break; - case 6: + case 5: { yybegin(ATTR_LIST); pushState(TAG); return XmlTokenType.XML_NAME; } case 50: break; @@ -737,7 +736,7 @@ public class __XmlLexer implements FlexLexer { { return elTokenType; } case 52: break; - case 11: + case 10: { return XmlTokenType.XML_NAME; } case 53: break; @@ -768,7 +767,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(ATTR_LIST); pushState(PROCESSING_INSTRUCTION); return XmlTokenType.XML_NAME; } case 59: break; - case 3: + case 2: { return XmlTokenType.XML_REAL_WHITE_SPACE; } case 60: break; @@ -784,7 +783,7 @@ public class __XmlLexer implements FlexLexer { { return XmlTokenType.XML_BAD_CHARACTER; } case 63: break; - case 8: + case 7: { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; } case 64: break; @@ -792,7 +791,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_START_END; } case 65: break; - case 4: + case 3: { if(yystate() == YYINITIAL){ return XmlTokenType.XML_BAD_CHARACTER; } @@ -803,7 +802,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; } case 67: break; - case 5: + case 4: { yybegin(TAG); return XmlTokenType.XML_START_TAG_START; } case 68: break; @@ -822,7 +821,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; } case 71: break; - case 9: + case 8: { yybegin(PI_ANY); return XmlTokenType.XML_NAME; } case 72: break; @@ -842,7 +841,7 @@ public class __XmlLexer implements FlexLexer { { return XmlTokenType.XML_CHAR_ENTITY_REF; } case 76: break; - case 7: + case 6: { return XmlTokenType.XML_WHITE_SPACE; } case 77: break; @@ -878,7 +877,7 @@ public class __XmlLexer implements FlexLexer { { yybegin(DOCTYPE); return XmlTokenType.XML_DOCTYPE_START; } case 85: break; - case 2: + case 11: { return XmlTokenType.XML_COMMENT_CHARACTERS; } case 86: break;