alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
 * Microsystems, Inc. All Rights Reserved.
 */
package org.netbeans.modules.css.text.syntax;

import org.netbeans.editor.BaseTokenCategory;
import org.netbeans.editor.BaseTokenID;
import org.netbeans.editor.TokenContext;
import org.netbeans.editor.TokenContextPath;

import org.netbeans.modules.css.text.syntax.javacc.lib.*;

/**
 * Token-ids and token-categories for CSS.
 *
 * @author  Miloslav Metelka
 * @author  Petr Kuzel
 * @version 1.0
 */
public class CSSTokenContext extends TokenContext {

    public final static int ATKW_ID = 1;
    public final static int COMMENT_ID = 2;
    public final static int EOL_ID = 3;
    public final static int ERROR_ID = 4;
    public final static int PLAIN_ID = 5;
    public final static int PROPERTY_ID = 6;
    public final static int SELECTOR_ID = 7;


    public final static JJTokenID ATKW = new JJTokenID("at-keyword", ATKW_ID); // NOI18N
    public final static JJTokenID COMMENT = new JJTokenID("comment", COMMENT_ID); // NOI18N
    public final static JJTokenID EOL = new JJTokenID("eol", EOL_ID); // NOI18N
    public final static JJTokenID ERROR = new JJTokenID("error", ERROR_ID, true); // NOI18N
    public final static JJTokenID PLAIN = new JJTokenID("plain", PLAIN_ID); // NOI18N
    public final static JJTokenID PROPERTY = new JJTokenID("property", PROPERTY_ID); // NOI18N
    public final static JJTokenID SELECTOR = new JJTokenID("selector", SELECTOR_ID); // NOI18N

    // Context instance declaration
    public static final CSSTokenContext context = new CSSTokenContext();

    public static final TokenContextPath contextPath = context.getContextPath();

    private CSSTokenContext() {
        super("css-"); // NOI18N

        try {
            addDeclaredTokenIDs();
        } catch (Exception e) {
            if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N
                e.printStackTrace();
            }
        }

    }
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.