tools/java/src/stx/libjava/tools/text/Highlighter.java
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 16 Sep 2013 01:04:57 +0100
branchdevelopment
changeset 2733 3d97124aebf5
parent 2728 658220e93dc9
child 2774 d68db9271133
permissions -rw-r--r--
Fixes for syntax highlighting. Even full class source is fully parser and indexed as the parser seems to be fast enough (at least at i5 CPU).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
     1
package stx.libjava.tools.text;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
     3
import net.sf.jasperreports.components.sort.FieldFilter;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
     4
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
import org.eclipse.jdt.core.compiler.InvalidInputException;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
     6
import org.eclipse.jdt.internal.compiler.ASTVisitor;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
import org.eclipse.jdt.internal.compiler.CompilationResult;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
     9
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    11
import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    12
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    13
import org.eclipse.jdt.internal.compiler.ast.FieldReference;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    14
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    15
import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    18
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    19
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    20
import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    21
import org.eclipse.jdt.internal.compiler.lookup.MethodScope;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    25
import stx.libjava.tools.environment.Resolver;
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    26
import stx.libjava.tools.parser.Parser;
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    27
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    28
public class Highlighter extends Parser {
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    30
    protected Marker marker;
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    31
    protected Indexer indexer;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    33
    public Highlighter() {
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    34
        this(new Marker() {            
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
            @Override
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
            public void mark(int kind, int from, int to) {
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    37
            }
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    38
        },
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    39
        new Indexer() {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    40
            
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    41
            @Override
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    42
            public void index(ASTNode node, int from, int to) {                
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
        });
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
    
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    47
    public Highlighter(Marker marker, Indexer indexer) {
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
        this(
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
                new ProblemReporter(
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
                        DefaultErrorHandlingPolicies.proceedWithAllProblems(), 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
                        new CompilerOptions(), 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
                        new DefaultProblemFactory()),
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
                true, 
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    54
                marker,
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    55
                indexer);
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    58
    public Highlighter(ProblemReporter problemReporter,
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    59
            boolean optimizeStringLiterals, Marker marker, Indexer indexer) {
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
        super(problemReporter, optimizeStringLiterals);
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
        setMarker(marker);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    62
        setIndexer(indexer);
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    65
    public Marker getMarker() {
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
        return marker;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
    }
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    68
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    69
    public void setMarker(Marker marker) {
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
        this.marker = marker;        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    71
        ((HighlightingScanner)this.scanner).marker = marker;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    74
    public Indexer getIndexer() {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    75
        return indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    76
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    77
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    78
    public void setIndexer(Indexer indexer) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    79
        this.indexer = indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    80
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    81
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    82
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
    public void initializeScanner(){
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    84
        this.scanner = new Highlighter.HighlightingScanner(
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
            false /*comment*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
            false /*whitespace*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
            false, /* will be set in initialize(boolean) */
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
            this.options.sourceLevel /*sourceLevel*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
            this.options.complianceLevel /*complianceLevel*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
            this.options.taskTags/*taskTags*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
            this.options.taskPriorities/*taskPriorities*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
            this.options.isTaskCaseSensitive/*taskCaseSensitive*/);
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
    }
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    94
    
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    95
    
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    96
    public CompilationUnitDeclaration parse(ICompilationUnit cu, boolean diet, boolean resolve) {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    97
        CompilationUnitDeclaration cud = super.parse(cu, diet, resolve);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    98
        HighlightingAndIndexingVisitor v = new HighlightingAndIndexingVisitor();
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    99
        cud.ignoreFurtherInvestigation = false;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   100
        v.setMarker(marker);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   101
        v.setIndexer(indexer);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   102
        cud.traverse(v, (CompilationUnitScope)null);                            
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   103
        return cud;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   104
    }
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   105
    
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   106
    
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   107
    public ASTNode[] parseClassBodyDeclarations(char[] source, int offset, int length, CompilationUnitDeclaration unit) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   108
        ASTNode[] nodes = super.parseClassBodyDeclarations(source, offset, length, unit);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   109
        HighlightingAndIndexingVisitor v = new HighlightingAndIndexingVisitor();
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   110
        v.setMarker(marker);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   111
        v.setIndexer(indexer);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   112
        for (int i = 0; i < nodes.length; i++) {
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   113
            ASTNode n = nodes[i];            
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   114
            if (n instanceof MethodDeclaration) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   115
                ((MethodDeclaration)n).traverse(v, (ClassScope)null);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   116
            } else {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   117
                nodes[i].traverse(v, null);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   118
            }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   119
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   120
        return nodes;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   121
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   122
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   123
    
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   124
    public static class HighlightingAndIndexingVisitor extends ASTVisitor {
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   125
        protected Marker marker;        
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   126
        protected Indexer indexer;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   127
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   128
        public Marker getMarker() {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   129
            return marker;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   130
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   131
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   132
        public void setMarker(Marker marker) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   133
            this.marker = marker;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   134
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   135
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   136
        public Indexer getIndexer() {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   137
            return indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   138
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   139
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   140
        public void setIndexer(Indexer indexer) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   141
            this.indexer = indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   142
        }
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   143
                     
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   144
        public void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope) {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   145
            marker.mark(Marker.MARK_FIELD, fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   146
            indexer.index(fieldDeclaration, fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   147
        }
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   148
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   149
        public void endVisit(FieldReference fieldReference, BlockScope scope) {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   150
            int start = (int)(fieldReference.nameSourcePosition >>> 32);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   151
            int stop  = (int)(fieldReference.nameSourcePosition & 0x0000FFFF);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   152
            marker.mark(Marker.MARK_FIELD, start, stop);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   153
            indexer.index(fieldReference, start, stop);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   154
        }
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   155
        public void endVisit(FieldReference fieldReference, ClassScope scope) {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   156
            int start = (int)(fieldReference.nameSourcePosition >>> 32);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   157
            int stop  = (int)(fieldReference.nameSourcePosition & 0x0000FFFF);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   158
            marker.mark(Marker.MARK_FIELD, start, stop);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   159
            indexer.index(fieldReference, start, stop);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   160
        }
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   161
        
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   162
                
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   163
        public void endVisit(MessageSend messageSend, BlockScope scope) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   164
            int start = (int)(messageSend.nameSourcePosition >>> 32);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   165
            int stop  = (int)(messageSend.nameSourcePosition & 0x0000FFFF);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   166
            marker.mark(Marker.MARK_SELECTOR, start, stop);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   167
            indexer.index(messageSend, start, stop);                                                                        
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   168
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   169
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   170
        public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   171
            int start = methodDeclaration.sourceStart;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   172
            int stop  = start + methodDeclaration.selector.length - 1;
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   173
            marker.mark(Marker.MARK_SELECTOR, start, stop);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   174
            
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   175
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   176
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   177
        public void endVisit(
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   178
                ConstructorDeclaration constructorDeclaration,
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   179
                ClassScope scope) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   180
            int start = constructorDeclaration.sourceStart;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   181
            int stop  = start + constructorDeclaration.selector.length - 1;
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   182
            marker.mark(Marker.MARK_SELECTOR, start, stop);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   183
            
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   184
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   185
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   186
        
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   187
    }
2723
02802ba0024f Added JavaSourceParser - a base class for JavaSyntaxHighlighter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2714
diff changeset
   188
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   189
    public static class HighlightingScanner extends org.eclipse.jdt.internal.compiler.parser.Scanner {
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
        
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   191
        public Marker marker;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
        protected int lastCommentPtr = -1;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   194
        public HighlightingScanner(boolean b, boolean c, boolean d, long sourceLevel,
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
                long complianceLevel, char[][] taskTags,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
                char[][] taskPriorities, boolean isTaskCaseSensitive) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
            super(b,c,d,sourceLevel, complianceLevel, taskTags, taskPriorities, isTaskCaseSensitive);
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
        public void recordComment(int token) {            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
            // compute position
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
            int start = this.startPosition;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
            int stop = this.currentPosition;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
            super.recordComment(token);
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   206
            switch (token) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   207
            case TokenNameCOMMENT_LINE:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   208
            case TokenNameCOMMENT_BLOCK:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   209
                marker.mark(Marker.MARK_COMMENT, start, stop);
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
                break;                 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
            case TokenNameCOMMENT_JAVADOC:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   212
                marker.mark(Marker.MARK_JAVADOC, start, stop);
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   213
                break;             
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
        public int getNextToken() throws InvalidInputException {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
            int t = super.getNextToken();
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
                               
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
            switch (t) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
            case TokenNamebreak:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   225
            case TokenNamecatch:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
            case TokenNameelse:    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
            case TokenNamefinally:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   228
            case TokenNamecontinue:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
            case TokenNamedefault:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   230
            case TokenNamedo:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
            case TokenNamefor:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   232
            case TokenNameif:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   233
            case TokenNamecase:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   234
            case TokenNamereturn:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   235
                marker.mark(Marker.MARK_KEYWORD_FLOW, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   236
                break;                                            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   237
            case TokenNameassert:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   238
            case TokenNameboolean:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   239
            case TokenNamebyte:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   240
            case TokenNamechar:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   241
            case TokenNameclass:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   242
            case TokenNamedouble:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   243
            case TokenNameextends:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   244
            case TokenNamefalse:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   245
            case TokenNamefinal:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   246
            case TokenNamethrow:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   247
            case TokenNametry:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   248
            case TokenNamewhile:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   249
            case TokenNameswitch:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   250
            case TokenNamefloat:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   251
            case TokenNameimplements:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
            case TokenNameimport:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   253
            case TokenNameinstanceof:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   254
            case TokenNameinterface:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   255
            case TokenNamelong:
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   256
            case TokenNameint:
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   257
            case TokenNamenative:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   258
            case TokenNamenew:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   259
            case TokenNamenull:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   260
            case TokenNamepackage:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   261
            case TokenNameprivate:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
            case TokenNameprotected:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   263
            case TokenNamepublic:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   264
            case TokenNameshort:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   265
            case TokenNamestatic:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   266
            case TokenNamestrictfp:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   267
            case TokenNamesuper:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   268
            case TokenNamesynchronized:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   269
            case TokenNamethis:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   270
            case TokenNamethrows:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   271
            case TokenNametransient:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   272
            case TokenNametrue:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   273
            case TokenNamevoid:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   274
            case TokenNamevolatile:            
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   275
                marker.mark(Marker.MARK_KEYWORD, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   276
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   277
            case TokenNameIntegerLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   278
            case TokenNameLongLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   279
            case TokenNameFloatingPointLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   280
            case TokenNameDoubleLiteral:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   281
                marker.mark(Marker.MARK_NUMBER, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   282
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   283
            case TokenNameStringLiteral:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   284
                marker.mark(Marker.MARK_STRING, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   285
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   286
            case TokenNameCharacterLiteral:                
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   287
                marker.mark(Marker.MARK_CHARACTER, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   288
                break; 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   289
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   290
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   291
            return t;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   292
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   293
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   294
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   295
    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   296
}