1 /* 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 package javafx.css; 26 27 import com.sun.javafx.css.parser.Token; 28 import com.sun.javafx.css.parser.TokenShim; 29 import java.io.Reader; 30 31 public class CssLexerShim { 32 33 public final static int STRING = CssLexer.STRING; 34 public final static int IDENT = CssLexer.IDENT; 35 public final static int FUNCTION = CssLexer.FUNCTION; 36 public final static int NUMBER = CssLexer.NUMBER; 37 public final static int CM = CssLexer.CM; 38 public final static int EMS = CssLexer.EMS; 39 public final static int EXS = CssLexer.EXS; 40 public final static int IN = CssLexer.IN; 41 public final static int MM = CssLexer.MM; 42 public final static int PC = CssLexer.PC; 43 public final static int PT = CssLexer.PT; 44 public final static int PX = CssLexer.PX; 45 public final static int PERCENTAGE = CssLexer.PERCENTAGE; 46 public final static int DEG = CssLexer.DEG; 47 public final static int GRAD = CssLexer.GRAD; 48 public final static int RAD = CssLexer.RAD; 49 public final static int TURN = CssLexer.TURN; 50 public final static int GREATER = CssLexer.GREATER; 51 public final static int LBRACE = CssLexer.LBRACE; 52 public final static int RBRACE = CssLexer.RBRACE; 53 public final static int SEMI = CssLexer.SEMI; 54 public final static int COLON = CssLexer.COLON; 55 public final static int SOLIDUS = CssLexer.SOLIDUS; 56 public final static int STAR = CssLexer.STAR; 57 public final static int LPAREN = CssLexer.LPAREN; 58 public final static int RPAREN = CssLexer.RPAREN; 59 public final static int COMMA = CssLexer.COMMA; 60 public final static int HASH = CssLexer.HASH; 61 public final static int DOT = CssLexer.DOT; 62 public final static int IMPORTANT_SYM = CssLexer.IMPORTANT_SYM; 63 public final static int WS = CssLexer.WS; 64 public final static int NL = CssLexer.NL; 65 public final static int FONT_FACE = CssLexer.FONT_FACE; 66 public final static int URL = CssLexer.URL; 67 public final static int IMPORT = CssLexer.IMPORT; 68 public final static int SECONDS = CssLexer.SECONDS; 69 public final static int MS = CssLexer.MS; 70 public final static int AT_KEYWORD = CssLexer.AT_KEYWORD; 71 72 73 CssLexer lexer; 74 75 public CssLexerShim(CssLexer lexer) { 76 this.lexer = lexer; 77 } 78 79 public CssLexerShim() { 80 this.lexer = new CssLexer(); 81 } 82 83 public TokenShim nextToken() { 84 Token t = this.lexer.nextToken(); 85 return new TokenShim(t); 86 } 87 88 public void setReader(Reader reader) { 89 lexer.setReader(reader); 90 } 91 92 //------------ 93 94 public static TokenShim nextToken(CssLexerShim l) { 95 Token t = l.lexer.nextToken(); 96 return new TokenShim(t); 97 } 98 99 100 }