// -*- C++ -*-1// Copyright (C) 2013, Gabriel Dos Reis.2// All rights reserved.3// Written by Gabriel Dos Reis.4//5// Redistribution and use in source and binary forms, with or without6// modification, are permitted provided that the following conditions are7// met:8//9// - Redistributions of source code must retain the above copyright10// notice, this list of conditions and the following disclaimer.11//12// - Redistributions in binary form must reproduce the above copyright13// notice, this list of conditions and the following disclaimer in14// the documentation and/or other materials provided with the15// distribution.16//17// - Neither the name of OpenAxiom, nor the names of its contributors may18// be used to endorse or promote products derived from this software19// without specific prior written permission.20//21// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS22// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED23// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A24// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER25// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,26// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,27// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR28// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF29// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING30// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS31// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3233#include <open-axiom/Input>3435namespace OpenAxiom {36// -- Input::NonEmptyText --37Input::NonEmptyLine::NonEmptyLine(Ordinal n, const Text& t)38: structure::binary<Ordinal, Text>(n, t)39{ }4041// -- Input::Line --42const Input::NonEmptyLine&43Input::Line::get() const {44return source()->at(index());45}4647// -- Input::Source --48Input::Line49Input::Source::line(LineNumber n, const Text& t) {50Index idx = size();51emplace_back(n, t);52return { this, idx };53}54}555657