object-introspection/oi/OILexer.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
C
Raw Normal View History

2022-12-19 14:37:51 +00:00
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
/* It looks like the yyFlexLexerOnce method is not the correct way of doing
this but it works for now. Fix it in the future. */
#if !defined(yyFlexLexerOnce)
#include <FlexLexer.h>
#endif
/* #pragma once
#include <FlexLexer.h> */
#include "OIParser.tab.hh"
#include "location.hh"
namespace oi::detail {
2022-12-19 14:37:51 +00:00
class OIScanner : public yyFlexLexer {
public:
OIScanner(std::istream* in) : yyFlexLexer(in) {};
2022-12-19 14:37:51 +00:00
virtual ~OIScanner() {};
2022-12-19 14:37:51 +00:00
// get rid of override virtual function warning
using FlexLexer::yylex;
virtual int yylex(OIParser::semantic_type* const lval,
OIParser::location_type* location);
2022-12-19 14:37:51 +00:00
// YY_DECL defined in OILexer.l
// Method body created by flex in OILexer.yy.cc
private:
/* yyval ptr */
OIParser::semantic_type* yylval = nullptr;
2022-12-19 14:37:51 +00:00
};
} // namespace oi::detail