tools/java/src/stx/libjava/tools/source/JavaSourceHighlighter.java
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 11 Sep 2013 11:36:27 +0100
branchdevelopment
changeset 2727 0d4d725cc712
parent 2723 02802ba0024f
permissions -rw-r--r--
Initial support for selector highlighting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
package stx.libjava.tools.source;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
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
     4
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
     5
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
     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;
2714
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.ast.CompilationUnitDeclaration;
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.ConstructorDeclaration;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    10
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
    11
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
    12
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
    13
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
    14
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
    15
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
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.problem.DefaultProblemFactory;
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.problem.ProblemReporter;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
2723
02802ba0024f Added JavaSourceParser - a base class for JavaSyntaxHighlighter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2714
diff changeset
    19
public class JavaSourceHighlighter extends JavaSourceParser {
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
    protected JavaSourceMarker marker;
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    22
    protected JavaSourceIndexer indexer;
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
    public JavaSourceHighlighter() {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
        this(new JavaSourceMarker() {            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
            @Override
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
            public void mark(int kind, int from, int to) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
                // TODO Auto-generated method stub
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
                
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
        });
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
    public JavaSourceHighlighter(JavaSourceMarker marker) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
        this(
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
                new ProblemReporter(
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
                        DefaultErrorHandlingPolicies.proceedWithAllProblems(), 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
                        new CompilerOptions(), 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
                        new DefaultProblemFactory()),
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
                true, 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
                marker);
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
    }
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
    public JavaSourceHighlighter(ProblemReporter problemReporter,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
            boolean optimizeStringLiterals, JavaSourceMarker marker) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
        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
    47
        setMarker(marker);
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
    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
    public JavaSourceMarker getMarker() {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
        return marker;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    }
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    53
    
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
    public void setMarker(JavaSourceMarker marker) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
        this.marker = marker;        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
        ((Scanner)this.scanner).marker = marker;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    59
    public JavaSourceIndexer getIndexer() {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    60
        return indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    61
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    62
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    63
    public void setIndexer(JavaSourceIndexer indexer) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    64
        this.indexer = indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    65
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    66
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    67
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    public void initializeScanner(){
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
        this.scanner = new JavaSourceHighlighter.Scanner(
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
            false /*comment*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
            false /*whitespace*/,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
            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
    73
            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
    74
            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
    75
            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
    76
            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
    77
            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
    78
    }
2727
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
    
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    81
    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
    82
        ASTNode[] nodes = super.parseClassBodyDeclarations(source, offset, length, unit);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    83
        Visitor v = new Visitor();
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    84
        v.setMarker(marker);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    85
        v.setIndexer(indexer);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    86
        for (int i = 0; i < nodes.length; i++) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    87
            ASTNode n = nodes[i];
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    88
            if (n instanceof MethodDeclaration) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    89
                ((MethodDeclaration)n).traverse(v, (ClassScope)null);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    90
            } else {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    91
                nodes[i].traverse(v, null);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    92
            }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    93
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    94
        return nodes;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    95
    }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    96
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
    public static class Visitor extends ASTVisitor {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
    99
        protected JavaSourceMarker marker;        
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   100
        protected JavaSourceIndexer indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   101
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   102
        public JavaSourceMarker getMarker() {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   103
            return marker;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   104
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   105
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   106
        public void setMarker(JavaSourceMarker marker) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   107
            this.marker = marker;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   108
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   109
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   110
        public JavaSourceIndexer getIndexer() {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   111
            return indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   112
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   113
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   114
        public void setIndexer(JavaSourceIndexer indexer) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   115
            this.indexer = indexer;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   116
        }
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   117
        
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   118
        public boolean visit(MessageSend messageSend, BlockScope scope) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   119
            int start = (int)(messageSend.nameSourcePosition >>> 32);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   120
            int stop  = (int)(messageSend.nameSourcePosition & 0x0000FFFF);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   121
            marker.mark(JavaSourceMarker.MARK_SELECTOR, start, stop);                                                            
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   122
            return true; // continue visiting
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   123
        }
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
        public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   126
            int start = methodDeclaration.sourceStart;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   127
            int stop  = start + methodDeclaration.selector.length - 1;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   128
            marker.mark(JavaSourceMarker.MARK_SELECTOR, start, stop);
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   129
            return true; // do nothing by default, keep traversing
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
        
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   132
        public boolean visit(
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   133
                ConstructorDeclaration constructorDeclaration,
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   134
                ClassScope scope) {
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   135
            int start = constructorDeclaration.sourceStart;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   136
            int stop  = start + constructorDeclaration.selector.length - 1;
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   137
            marker.mark(JavaSourceMarker.MARK_SELECTOR, start, stop);
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
            return true; // do nothing by default, keep traversing
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   140
        }
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
        
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   143
    }
2723
02802ba0024f Added JavaSourceParser - a base class for JavaSyntaxHighlighter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2714
diff changeset
   144
        
2714
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
    public static class Scanner extends org.eclipse.jdt.internal.compiler.parser.Scanner {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
        public JavaSourceMarker marker;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
        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
   149
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
        public Scanner(boolean b, boolean c, boolean d, long sourceLevel,
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
                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
   152
                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
   153
            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
   154
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
        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
   157
            // compute position
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
            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
   159
            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
   160
            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
   161
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
            switch (token) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
            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
   164
            case TokenNameCOMMENT_BLOCK:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
                marker.mark(JavaSourceMarker.MARK_COMMENT, start, stop);
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
                break;                 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
            case TokenNameCOMMENT_JAVADOC:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
                marker.mark(JavaSourceMarker.MARK_JAVADOC, start, stop);
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
                break;             
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
        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
   176
            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
   177
                               
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
            switch (t) {
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
            case TokenNamebreak:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181
            case TokenNamecatch:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
            case TokenNameelse:    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
            case TokenNamefinally:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
            case TokenNamecontinue:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
            case TokenNamedefault:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
            case TokenNamedo:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   187
            case TokenNamefor:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   188
            case TokenNameif:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   189
            case TokenNamecase:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
            case TokenNamereturn:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
                marker.mark(JavaSourceMarker.MARK_KEYWORD_FLOW, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
                break;                                            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
            case TokenNameassert:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
            case TokenNameboolean:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
            case TokenNamebyte:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
            case TokenNamechar:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
            case TokenNameclass:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
            case TokenNamedouble:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
            case TokenNameextends:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
            case TokenNamefalse:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
            case TokenNamefinal:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
            case TokenNamethrow:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
            case TokenNametry:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
            case TokenNamewhile:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
            case TokenNameswitch:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   206
            case TokenNamefloat:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   207
            case TokenNameimplements:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   208
            case TokenNameimport:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   209
            case TokenNameinstanceof:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
            case TokenNameinterface:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
            case TokenNamelong:
2727
0d4d725cc712 Initial support for selector highlighting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2723
diff changeset
   212
            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
   213
            case TokenNamenative:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
            case TokenNamenew:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
            case TokenNamenull:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
            case TokenNamepackage:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
            case TokenNameprivate:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
            case TokenNameprotected:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
            case TokenNamepublic:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
            case TokenNameshort:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
            case TokenNamestatic:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
            case TokenNamestrictfp:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
            case TokenNamesuper:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
            case TokenNamesynchronized:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   225
            case TokenNamethis:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
            case TokenNamethrows:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
            case TokenNametransient:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   228
            case TokenNametrue:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
            case TokenNamevoid:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   230
            case TokenNamevolatile:            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
                marker.mark(JavaSourceMarker.MARK_KEYWORD, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   232
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   233
            case TokenNameIntegerLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   234
            case TokenNameLongLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   235
            case TokenNameFloatingPointLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   236
            case TokenNameDoubleLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   237
                marker.mark(JavaSourceMarker.MARK_NUMBER, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   238
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   239
            case TokenNameStringLiteral:
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   240
                marker.mark(JavaSourceMarker.MARK_STRING, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   241
                break;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   242
            case TokenNameCharacterLiteral:                
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   243
                marker.mark(JavaSourceMarker.MARK_CHARACTER, getCurrentTokenStartPosition(), getCurrentTokenEndPosition());
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   244
                break; 
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   245
            }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   246
            
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   247
            return t;
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   248
        }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   249
        
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   250
    }
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   251
    
fafb688b3073 Upgraded Eclipse compiler and tools to those of Eclipse 4.2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
}