/*
This file is part of solidity.
solidity is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
solidity is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with solidity. If not, see .
*/
/**
* Parser for Yul code and data object container.
*/
#pragma once
#include
#include
#include
#include
#include
#include
namespace langutil
{
class Scanner;
}
namespace yul
{
/**
* Yul object parser. Invokes the inline assembly parser.
*/
class ObjectParser: public langutil::ParserBase
{
public:
explicit ObjectParser(
langutil::ErrorReporter& _errorReporter,
yul::AsmFlavour _flavour = yul::AsmFlavour::Loose
):
ParserBase(_errorReporter), m_flavour(_flavour) {}
/// Parses a Yul object.
/// Falls back to code-only parsing if the source starts with `{`.
/// @param _reuseScanner if true, do check for end of input after the last `}`.
/// @returns an empty shared pointer on error.
std::shared_ptr