// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // TODO(terry): Need to be consistent with tokens either they're ASCII tokens // e.g., ASTERISK or they're CSS e.g., PSEUDO, COMBINATOR_*. class TokenKind { // Common shared tokens used in TokenizerBase. static final int UNUSED = 0; // Unused place holder... static final int END_OF_FILE = 1; // TODO(terry): Must match base static final int LPAREN = 2; // ( static final int RPAREN = 3; // ) static final int LBRACK = 4; // [ static final int RBRACK = 5; // ] static final int LBRACE = 6; // { static final int RBRACE = 7; // } static final int DOT = 8; // . static final int SEMICOLON = 9; // ; // Unique tokens for CSS. static final int AT = 10; // @ static final int HASH = 11; // # static final int PLUS = 12; // + static final int GREATER = 13; // > static final int TILDE = 14; // ~ static final int ASTERISK = 15; // * static final int NAMESPACE = 16; // | static final int COLON = 17; // : static final int PRIVATE_NAME = 18; // _ prefix private class or id static final int COMMA = 19; // , static final int SPACE = 20; static final int TAB = 21; // /t static final int NEWLINE = 22; // /n static final int RETURN = 23; // /r static final int PERCENT = 24; // % static final int SINGLE_QUOTE = 25; // ' static final int DOUBLE_QUOTE = 26; // " static final int SLASH = 27; // / static final int EQUALS = 28; // = static final int OR = 29; // | static final int CARET = 30; // ^ static final int DOLLAR = 31; // $ static final int LESS = 32; // < static final int BANG = 33; // ! static final int MINUS = 34; // - // WARNING: END_TOKENS must be 1 greater than the last token above (last // character in our list). Also add to kindToString function and the // constructor for TokenKind. static final int END_TOKENS = 35; // Marker for last token in list /** [TokenKind] representing integer tokens. */ static final int INTEGER = 60; // TODO(terry): must match base /** [TokenKind] representing hex integer tokens. */ // static final int HEX_INTEGER = 61; // TODO(terry): must match base /** [TokenKind] representing double tokens. */ static final int DOUBLE = 62; // TODO(terry): must match base /** [TokenKind] representing whitespace tokens. */ static final int WHITESPACE = 63; // TODO(terry): must match base /** [TokenKind] representing comment tokens. */ static final int COMMENT = 64; // TODO(terry): must match base /** [TokenKind] representing error tokens. */ static final int ERROR = 65; // TODO(terry): must match base /** [TokenKind] representing incomplete string tokens. */ static final int INCOMPLETE_STRING = 66; // TODO(terry): must match base /** [TokenKind] representing incomplete comment tokens. */ static final int INCOMPLETE_COMMENT = 67; // TODO(terry): must match base // Synthesized Tokens (no character associated with TOKEN). // TODO(terry): Possible common names used by both Dart and CSS tokenizers. static final int STRING = 500; static final int STRING_PART = 501; static final int NUMBER = 502; static final int HEX_NUMBER = 503; static final int HTML_COMMENT = 504; //