diff options
Diffstat (limited to 'valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionsElementScanner.java')
-rw-r--r-- | valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionsElementScanner.java | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionsElementScanner.java b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionsElementScanner.java index 322124dd8c..ee6601ef0a 100644 --- a/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionsElementScanner.java +++ b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionsElementScanner.java @@ -1,13 +1,13 @@ /******************************************************************************* * Copyright (c) 2008, 2009 Phil Muldoon <pkmuldoon@picobot.org>. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Phil Muldoon <pkmuldoon@picobot.org> - initial API. + * Phil Muldoon <pkmuldoon@picobot.org> - initial API. * Red Hat - modifications for use with Valgrind plugins. *******************************************************************************/ package org.eclipse.linuxtools.internal.valgrind.ui.editor; @@ -29,47 +29,47 @@ import org.eclipse.swt.SWT; public class SuppressionsElementScanner extends BufferedRuleBasedScanner { - public static final String MEMCHECK = "Memcheck"; //$NON-NLS-1$ - public static final String[] MEMCHECK_SUPP_TYPES = new String[] { - "Value0", "Value1", "Value2", "Value4", "Value8", "Value16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ - "Cond", //$NON-NLS-1$ - "Addr1", "Addr2", "Addr4", "Addr8", "Addr16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - "Jump", //$NON-NLS-1$ - "Param", //$NON-NLS-1$ - "Free", //$NON-NLS-1$ - "Overlap", //$NON-NLS-1$ - "Leak" //$NON-NLS-1$ - }; - public static final String[] CONTEXTS = new String[] { "obj", "fun" //$NON-NLS-1$ //$NON-NLS-2$ - }; + public static final String MEMCHECK = "Memcheck"; //$NON-NLS-1$ + public static final String[] MEMCHECK_SUPP_TYPES = new String[] { + "Value0", "Value1", "Value2", "Value4", "Value8", "Value16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + "Cond", //$NON-NLS-1$ + "Addr1", "Addr2", "Addr4", "Addr8", "Addr16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + "Jump", //$NON-NLS-1$ + "Param", //$NON-NLS-1$ + "Free", //$NON-NLS-1$ + "Overlap", //$NON-NLS-1$ + "Leak" //$NON-NLS-1$ + }; + public static final String[] CONTEXTS = new String[] { "obj", "fun" //$NON-NLS-1$ //$NON-NLS-2$ + }; + + public SuppressionsElementScanner(ColorManager colorManager) { + String[] tools = { MEMCHECK }; + Map<String, List<String>> kinds = new HashMap<>(); + kinds.put(MEMCHECK, Arrays.asList(MEMCHECK_SUPP_TYPES)); + + IToken defaultToken = new Token(new TextAttribute(colorManager + .getColor(ISuppressionsColorConstants.DEFAULT))); + IToken toolToken = new Token(new TextAttribute(colorManager + .getColor(ISuppressionsColorConstants.TOOL), null, SWT.BOLD)); + IToken suppKindToken = new Token(new TextAttribute(colorManager + .getColor(ISuppressionsColorConstants.SUPP_TYPE))); + IToken contextToken = new Token(new TextAttribute(colorManager + .getColor(ISuppressionsColorConstants.CONTEXT), null, SWT.BOLD)); + IToken commentToken = new Token(new TextAttribute(colorManager + .getColor(ISuppressionsColorConstants.COMMENT))); - public SuppressionsElementScanner(ColorManager colorManager) { - String[] tools = { MEMCHECK }; - Map<String, List<String>> kinds = new HashMap<>(); - kinds.put(MEMCHECK, Arrays.asList(MEMCHECK_SUPP_TYPES)); - - IToken defaultToken = new Token(new TextAttribute(colorManager - .getColor(ISuppressionsColorConstants.DEFAULT))); - IToken toolToken = new Token(new TextAttribute(colorManager - .getColor(ISuppressionsColorConstants.TOOL), null, SWT.BOLD)); - IToken suppKindToken = new Token(new TextAttribute(colorManager - .getColor(ISuppressionsColorConstants.SUPP_TYPE))); - IToken contextToken = new Token(new TextAttribute(colorManager - .getColor(ISuppressionsColorConstants.CONTEXT), null, SWT.BOLD)); - IToken commentToken = new Token(new TextAttribute(colorManager - .getColor(ISuppressionsColorConstants.COMMENT))); - - setDefaultReturnToken(defaultToken); - setRules(new IRule[] { - new EndOfLineRule("#", commentToken), //$NON-NLS-1$ - new SuppressionToolRule(tools, toolToken), - new SuppressionKindRule(kinds, suppKindToken), - new SuppressionToolRule(CONTEXTS, contextToken), - new WhitespaceRule(new IWhitespaceDetector() { - @Override - public boolean isWhitespace(char c) { - return Character.isWhitespace(c); - } - }) }); - } + setDefaultReturnToken(defaultToken); + setRules(new IRule[] { + new EndOfLineRule("#", commentToken), //$NON-NLS-1$ + new SuppressionToolRule(tools, toolToken), + new SuppressionKindRule(kinds, suppKindToken), + new SuppressionToolRule(CONTEXTS, contextToken), + new WhitespaceRule(new IWhitespaceDetector() { + @Override + public boolean isWhitespace(char c) { + return Character.isWhitespace(c); + } + }) }); + } } |