tools/java/src/stx/libjava/tools/text/Highlighter.java
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 08 Oct 2013 09:28:45 +0100
branchdevelopment
changeset 2810 7072f7fb65f6
parent 2797 6936cde374d2
child 2839 6d3bac6f72c7
permissions -rw-r--r--
Support for generic (parametrized) types in source indexer.
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
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
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
     5
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
     6
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
     7
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
     8
import org.eclipse.jdt.internal.compiler.ast.Argument;
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
     9
import org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
    10
import org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
    11
import org.eclipse.jdt.internal.compiler.ast.Assignment;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
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
    13
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
    14
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    15
import org.eclipse.jdt.internal.compiler.ast.FieldReference;
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
    16
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    17
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
    18
import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
2810
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
    19
import org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
    20
import org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
    21
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
    22
import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
    23
import org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
    24
import org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
    26
import org.eclipse.jdt.internal.compiler.lookup.Binding;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    27
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
    28
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
    29
import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    30
import org.eclipse.jdt.internal.compiler.lookup.MethodScope;
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
    31
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
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
    33
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    34
import stx.libjava.tools.parser.Parser;
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    35
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    36
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
    37
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    38
    protected Marker marker;
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    39
    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
    40
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    41
    public Highlighter() {
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    42
        this(new Marker() {            
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
    43
           
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    44
        },
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    45
        new Indexer() {
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
    46
                       
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
        });
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
    
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    50
    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
    51
        this(
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
                new ProblemReporter(
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
                        DefaultErrorHandlingPolicies.proceedWithAllProblems(), 
2797
6936cde374d2 Fix in Java parser: set source level to 1.6 or 1.7 depending on running system.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2786
diff changeset
    54
                        defaultCompilerOptions(), 
6936cde374d2 Fix in Java parser: set source level to 1.6 or 1.7 depending on running system.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2786
diff changeset
    55
                        defaultProblemFactory()),
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
                true, 
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    57
                marker,
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    58
                indexer);
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    61
    public Highlighter(ProblemReporter problemReporter,
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    62
            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
    63
        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
    64
        setMarker(marker);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    65
        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
    66
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    68
    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
    69
        return marker;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    }
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    71
    
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    72
    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
    73
        this.marker = marker;        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    74
        ((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
    75
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    77
    public Indexer getIndexer() {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    78
        return indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    79
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    80
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
    81
    public void setIndexer(Indexer indexer) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    82
        this.indexer = indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    83
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    84
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    85
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    public void initializeScanner(){
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    87
        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
    88
            false /*comment*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
            false /*whitespace*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
            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
    91
            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
    92
            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
    93
            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
    94
            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
    95
            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
    96
    }
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    97
    
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    98
    
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
    99
    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
   100
        CompilationUnitDeclaration cud = super.parse(cu, diet, resolve);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   101
        HighlightingAndIndexingVisitor v = new HighlightingAndIndexingVisitor();
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   102
        cud.ignoreFurtherInvestigation = false;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   103
        v.setMarker(marker);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   104
        v.setIndexer(indexer);
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   105
        cud.traverse(v, (CompilationUnitScope)null);                            
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   106
        return cud;
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   107
    }
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   108
    
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   109
    
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   110
    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
   111
        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
   112
        HighlightingAndIndexingVisitor v = new HighlightingAndIndexingVisitor();
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   113
        v.setMarker(marker);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   114
        v.setIndexer(indexer);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   115
        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
   116
            ASTNode n = nodes[i];            
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   117
            if (n instanceof MethodDeclaration) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   118
                ((MethodDeclaration)n).traverse(v, (ClassScope)null);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   119
            } else {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   120
                nodes[i].traverse(v, null);
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
        return nodes;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   124
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   125
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   126
    
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   127
    public static class HighlightingAndIndexingVisitor extends ASTVisitor {
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   128
        protected Marker marker;        
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   129
        protected Indexer indexer;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   130
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   131
        public Marker getMarker() {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   132
            return marker;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   133
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   134
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   135
        public void setMarker(Marker marker) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   136
            this.marker = marker;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   137
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   138
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   139
        public Indexer getIndexer() {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   140
            return indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   141
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   142
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   143
        public void setIndexer(Indexer indexer) {
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   144
            this.indexer = indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   145
        }
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   146
                     
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   147
        public void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope) {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   148
            marker.mark(Marker.MARK_FIELD, fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   149
            indexer.addFieldDeclaration(fieldDeclaration, fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   150
        }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   151
        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   152
        public void endVisit(LocalDeclaration localDeclaration, BlockScope scope) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   153
            marker.mark(Marker.MARK_LOCAL, localDeclaration.sourceStart, localDeclaration.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   154
            indexer.addLocalDeclaration(localDeclaration, localDeclaration.sourceStart, localDeclaration.sourceEnd);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   155
        }
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   156
        
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   157
        public void endVisit(Argument localDeclaration, BlockScope scope) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   158
            marker.mark(Marker.MARK_LOCAL, localDeclaration.sourceStart, localDeclaration.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   159
            indexer.addLocalDeclaration(localDeclaration, localDeclaration.sourceStart, localDeclaration.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   160
        }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   161
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   162
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   163
        public void endVisit(FieldReference fieldReference, BlockScope scope) {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   164
            int start = (int)(fieldReference.nameSourcePosition >>> 32);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   165
            int stop  = (int)(fieldReference.nameSourcePosition & 0x0000FFFFFFFF);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   166
            marker.mark(Marker.MARK_FIELD, start, stop);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   167
            indexer.addVariableReference(fieldReference, start, stop);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   168
        }
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   169
        public void endVisit(FieldReference fieldReference, ClassScope scope) {
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   170
            int start = (int)(fieldReference.nameSourcePosition >>> 32);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   171
            int stop  = (int)(fieldReference.nameSourcePosition & 0x0000FFFFFFFF);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   172
            marker.mark(Marker.MARK_FIELD, start, stop);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   173
            indexer.addVariableReference(fieldReference, start, stop);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   174
        }
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   175
        
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   176
                
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   177
        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
   178
            int start = (int)(messageSend.nameSourcePosition >>> 32);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   179
            int stop  = (int)(messageSend.nameSourcePosition & 0x0000FFFFFFFF);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   180
            marker.mark(Marker.MARK_SELECTOR, start, stop);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   181
            indexer.addMessageSend(messageSend, start, stop);                                                                        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   182
        }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   183
        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   184
        public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   185
            int start = methodDeclaration.sourceStart;
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   186
            int stop  = start + methodDeclaration.selector.length - 1;
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   187
            marker.mark(Marker.MARK_SELECTOR, start, stop);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   188
            indexer.methodEnter(methodDeclaration);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   189
            return true;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   190
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   191
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   192
        public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   193
            indexer.methodLeave(methodDeclaration);
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   194
        }
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   195
        
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   196
        public void endVisit(
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   197
                SingleTypeReference type,
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   198
                BlockScope scope) {
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   199
            if (type.token == TypeBinding.VOID.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   200
            if (type.token == TypeBinding.BOOLEAN.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   201
            if (type.token == TypeBinding.CHAR.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   202
            if (type.token == TypeBinding.FLOAT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   203
            if (type.token == TypeBinding.DOUBLE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   204
            if (type.token == TypeBinding.BYTE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   205
            if (type.token == TypeBinding.SHORT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   206
            if (type.token == TypeBinding.INT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   207
            if (type.token == TypeBinding.LONG.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   208
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   209
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   210
        }
2810
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   211
        
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   212
        
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   213
        public void endVisit(
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   214
                SingleTypeReference type,
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   215
                ClassScope scope) {
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   216
            if (type.token == TypeBinding.VOID.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   217
            if (type.token == TypeBinding.BOOLEAN.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   218
            if (type.token == TypeBinding.CHAR.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   219
            if (type.token == TypeBinding.FLOAT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   220
            if (type.token == TypeBinding.DOUBLE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   221
            if (type.token == TypeBinding.BYTE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   222
            if (type.token == TypeBinding.SHORT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   223
            if (type.token == TypeBinding.INT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   224
            if (type.token == TypeBinding.LONG.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   225
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   226
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);
2810
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   227
        }
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   228
        
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   229
        public void endVisit(
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   230
                ParameterizedSingleTypeReference type,
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   231
                BlockScope scope) {
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   232
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceStart + type.token.length - 1);
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   233
            indexer.addTypeReference(type, type.sourceStart, type.sourceStart + type.token.length - 1);            
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   234
        }
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   235
2810
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   236
        public void endVisit(
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   237
                ParameterizedSingleTypeReference type,
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   238
                ClassScope scope) {
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   239
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceStart + type.token.length - 1);
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   240
            indexer.addTypeReference(type, type.sourceStart, type.sourceStart + type.token.length - 1);
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   241
            
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   242
        }
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   243
        
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   244
        public void endVisit(ArrayTypeReference type, BlockScope scope) {
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   245
            if (type.token == TypeBinding.VOID.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   246
            if (type.token == TypeBinding.BOOLEAN.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   247
            if (type.token == TypeBinding.CHAR.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   248
            if (type.token == TypeBinding.FLOAT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   249
            if (type.token == TypeBinding.DOUBLE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   250
            if (type.token == TypeBinding.BYTE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   251
            if (type.token == TypeBinding.SHORT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   252
            if (type.token == TypeBinding.INT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   253
            if (type.token == TypeBinding.LONG.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   254
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   255
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   256
        }
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   257
        public void endVisit(ArrayTypeReference type, ClassScope scope) {
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   258
            if (type.token == TypeBinding.VOID.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   259
            if (type.token == TypeBinding.BOOLEAN.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   260
            if (type.token == TypeBinding.CHAR.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   261
            if (type.token == TypeBinding.FLOAT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   262
            if (type.token == TypeBinding.DOUBLE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   263
            if (type.token == TypeBinding.BYTE.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   264
            if (type.token == TypeBinding.SHORT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   265
            if (type.token == TypeBinding.INT.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   266
            if (type.token == TypeBinding.LONG.simpleName) return;
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   267
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   268
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   269
        }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   270
        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   271
        protected void breakpoint() {}
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   272
        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   273
        public void endVisit(
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   274
                SingleNameReference ref,
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   275
                BlockScope scope) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   276
            if (ref.binding == null) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   277
                breakpoint();
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   278
                ref.resolve(scope);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   279
            }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   280
            
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   281
            boolean isField = (ref.bits & ASTNode.RestrictiveFlagMASK) == Binding.FIELD;
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   282
            if (isField) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   283
                marker.mark(Marker.MARK_FIELD, ref.sourceStart,  ref.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   284
            }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   285
            indexer.addVariableReference(ref, ref.sourceStart,  ref.sourceEnd);                      
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   286
        }
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   287
        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   288
        public void endVisit(
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   289
                QualifiedNameReference ref,
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   290
                BlockScope scope) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   291
            if (ref.binding == null) ref.resolve(scope);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   292
/*            
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   293
            Binding[] bindings = ref.getOtherFieldBindings(scope);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   294
            for (int i = 0; i < bindings.length; i++) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   295
                Binding
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   296
            }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   297
            
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   298
            boolean isField = (ref.bits & ASTNode.RestrictiveFlagMASK) == Binding.FIELD;
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   299
            if (isField) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   300
                marker.mark(Marker.MARK_FIELD, ref.sourceStart,  ref.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   301
            }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   302
            indexer.addVariableReference(ref, ref.sourceStart,  ref.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   303
*/
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   304
        }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   305
        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   306
        public void endVisit(Assignment assignment, BlockScope scope) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   307
            if ((assignment.lhs.bits & ASTNode.RestrictiveFlagMASK) == Binding.FIELD) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   308
                marker.mark(Marker.MARK_FIELD_ASSIGNED, assignment.lhs.sourceStart,  assignment.lhs.sourceEnd);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   309
            }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   310
        }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   311
        
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   312
         
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   313
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   314
        
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   315
        public void endVisit(
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   316
                ArrayQualifiedTypeReference type,
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   317
                BlockScope scope) {
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   318
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   319
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   320
        }
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   321
        public void endVisit(
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   322
                ArrayQualifiedTypeReference type,
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   323
                ClassScope scope) {
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   324
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   325
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);                
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   326
        }
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   327
        
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   328
        public void endVisit(
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   329
                QualifiedTypeReference type,
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   330
                BlockScope scope) {            
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   331
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   332
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);                
2774
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   333
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   334
        }
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   335
        public void endVisit(
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   336
                QualifiedTypeReference type,
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   337
                ClassScope scope) {
d68db9271133 Removed examples/jabber from subprojects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2733
diff changeset
   338
            marker.mark(Marker.MARK_CLASS, type.sourceStart, type.sourceEnd);
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   339
            indexer.addTypeReference(type, type.sourceStart, type.sourceEnd);                
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   340
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   341
        
2810
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   342
        public void endVisit(
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   343
                ParameterizedQualifiedTypeReference type,
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   344
                BlockScope scope) {
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   345
            int start = type.sourceEnd;
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   346
            int stop = (int)(type.sourcePositions[type.sourcePositions.length - 1] & 0x0000FFFFFFFF);
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   347
            marker.mark(Marker.MARK_CLASS, start, stop);
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   348
            indexer.addTypeReference(type, start, stop);            
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   349
        }
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   350
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   351
        public void endVisit(
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   352
                ParameterizedQualifiedTypeReference type,
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   353
                ClassScope scope) {
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   354
            int start = type.sourceEnd;
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   355
            int stop = (int)(type.sourcePositions[type.sourcePositions.length - 1] & 0x0000FFFFFFFF);
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   356
            marker.mark(Marker.MARK_CLASS, start, stop);
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   357
            indexer.addTypeReference(type, start, stop);            
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   358
        }
7072f7fb65f6 Support for generic (parametrized) types in source indexer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2797
diff changeset
   359
        
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   360
        public boolean visit(
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   361
                ConstructorDeclaration constructorDeclaration,
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   362
                ClassScope scope) {
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   363
            indexer.methodEnter(constructorDeclaration);
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   364
            return true;
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   365
        }
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   366
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   367
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   368
        public void endVisit(
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   369
                ConstructorDeclaration constructorDeclaration,
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   370
                ClassScope scope) {
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   371
            indexer.methodLeave(constructorDeclaration);
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   372
            int start = constructorDeclaration.sourceStart;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   373
            int stop  = start + constructorDeclaration.selector.length - 1;
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   374
            marker.mark(Marker.MARK_SELECTOR, start, stop);
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   375
            
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   376
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   377
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   378
        
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   379
    }
2723
02802ba0024f Added JavaSourceParser - a base class for JavaSyntaxHighlighter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2714
diff changeset
   380
        
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   381
    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
   382
        
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   383
        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
   384
        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
   385
2733
3d97124aebf5 Fixes for syntax highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2728
diff changeset
   386
        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
   387
                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
   388
                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
   389
            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
   390
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   391
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   392
        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
   393
            // compute position
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   394
            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
   395
            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
   396
            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
   397
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   398
            switch (token) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   399
            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
   400
            case TokenNameCOMMENT_BLOCK:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   401
                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
   402
                break;                 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   403
            case TokenNameCOMMENT_JAVADOC:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   404
                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
   405
                break;             
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   406
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   407
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   408
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   409
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   410
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   411
        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
   412
            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
   413
                               
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   414
            switch (t) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   415
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   416
            case TokenNamebreak:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   417
            case TokenNamecatch:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   418
            case TokenNameelse:    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   419
            case TokenNamefinally:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   420
            case TokenNamecontinue:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   421
            case TokenNamedefault:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   422
            case TokenNamedo:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   423
            case TokenNamefor:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   424
            case TokenNameif:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   425
            case TokenNamecase:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   426
            case TokenNamereturn:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   427
                marker.mark(Marker.MARK_KEYWORD_FLOW, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
2786
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   428
                break;           
241e36a125a9 Added java support code for stx:libjava/libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2774
diff changeset
   429
            case TokenNameabstract:
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   430
            case TokenNameassert:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   431
            case TokenNameboolean:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   432
            case TokenNamebyte:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   433
            case TokenNamechar:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   434
            case TokenNameclass:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   435
            case TokenNamedouble:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   436
            case TokenNameextends:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   437
            case TokenNamefalse:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   438
            case TokenNamefinal:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   439
            case TokenNamethrow:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   440
            case TokenNametry:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   441
            case TokenNamewhile:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   442
            case TokenNameswitch:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   443
            case TokenNamefloat:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   444
            case TokenNameimplements:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   445
            case TokenNameimport:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   446
            case TokenNameinstanceof:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   447
            case TokenNameinterface:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   448
            case TokenNamelong:
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   449
            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
   450
            case TokenNamenative:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   451
            case TokenNamenew:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   452
            case TokenNamenull:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   453
            case TokenNamepackage:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   454
            case TokenNameprivate:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   455
            case TokenNameprotected:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   456
            case TokenNamepublic:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   457
            case TokenNameshort:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   458
            case TokenNamestatic:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   459
            case TokenNamestrictfp:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   460
            case TokenNamesuper:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   461
            case TokenNamesynchronized:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   462
            case TokenNamethis:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   463
            case TokenNamethrows:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   464
            case TokenNametransient:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   465
            case TokenNametrue:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   466
            case TokenNamevoid:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   467
            case TokenNamevolatile:            
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   468
                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
   469
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   470
            case TokenNameIntegerLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   471
            case TokenNameLongLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   472
            case TokenNameFloatingPointLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   473
            case TokenNameDoubleLiteral:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   474
                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
   475
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   476
            case TokenNameStringLiteral:
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   477
                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
   478
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   479
            case TokenNameCharacterLiteral:                
2728
658220e93dc9 Java package reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2727
diff changeset
   480
                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
   481
                break; 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   482
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   483
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   484
            return t;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   485
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   486
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   487
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   488
    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   489
}