1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FRAMEWORKS_WMSERVER_SRC_WMLAYOUT_SCSS_PARSER_SCANNER_H 17 #define FRAMEWORKS_WMSERVER_SRC_WMLAYOUT_SCSS_PARSER_SCANNER_H 18 19 #ifndef yyFlexLexerOnce 20 #undef yyFlexLexer 21 #define yyFlexLexer OHOSFlexLexer 22 23 #include <FlexLexer.h> 24 25 #endif // yyFlexLexerOnce 26 27 #undef YY_DECL 28 #define YY_DECL OHOS::Parser::symbol_type OHOS::Scanner::nextToken() 29 30 #include "parser.hpp" 31 32 namespace OHOS { 33 class Driver; 34 class Scanner : public yyFlexLexer { 35 public: 36 explicit Scanner(Driver &d); 37 virtual ~Scanner() = default; 38 39 // implement by YY_DECL 40 virtual Parser::symbol_type nextToken(); 41 42 private: 43 Driver &driver; 44 }; 45 } // namespace OHOS 46 47 #endif // FRAMEWORKS_WMSERVER_SRC_WMLAYOUT_SCSS_PARSER_SCANNER_H 48