IncludedGrammar.java revision 325
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore/*
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5aec55eb0591d2fcdd38d7dd5408a6ff3456e596Garrett D'Amore *
5aec55eb0591d2fcdd38d7dd5408a6ff3456e596Garrett D'Amore * This code is free software; you can redistribute it and/or modify it
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * under the terms of the GNU General Public License version 2 only, as
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * published by the Free Software Foundation. Oracle designates this
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * particular file as subject to the "Classpath" exception as provided
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * by Oracle in the LICENSE file that accompanied this code.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * This code is distributed in the hope that it will be useful, but WITHOUT
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
017c01f878134ff71877f2c67cca171a4ad2cd93Yuri Pankov * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amore * version 2 for more details (a copy is included in the LICENSE file that
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amore * accompanied this code).
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * You should have received a copy of the GNU General Public License version
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * 2 along with this work; if not, write to the Free Software Foundation,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * or visit www.oracle.com if you need additional information or have any
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * questions.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore */
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore/*
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * Copyright (C) 2004-2011
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * Permission is hereby granted, free of charge, to any person obtaining a copy
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * of this software and associated documentation files (the "Software"), to deal
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * in the Software without restriction, including without limitation the rights
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amore * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * copies of the Software, and to permit persons to whom the Software is
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * furnished to do so, subject to the following conditions:
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * The above copyright notice and this permission notice shall be included in
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * all copies or substantial portions of the Software.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * THE SOFTWARE.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore */
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amorepackage com.sun.xml.internal.rngom.ast.builder;
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amoreimport com.sun.xml.internal.rngom.ast.om.Location;
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amoreimport com.sun.xml.internal.rngom.ast.om.ParsedPattern;
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amoreimport com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation;
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amoreimport com.sun.xml.internal.rngom.parse.Parseable;
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amore
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amore/**
2da1cd3a39e2d3da7f9d15071ea9462919c011acGarrett D'Amore * {@link Scope} for <grammar> element of the <include>d grammar.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * <p>
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * This object builds &lt;define>s in the included grammar that
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * override the definitions in the original grammar.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore */
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amorepublic interface IncludedGrammar<
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore P extends ParsedPattern,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore E extends ParsedElementAnnotation,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore L extends Location,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore A extends Annotations<E,L,CL>,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore CL extends CommentList<L>> extends GrammarSection<P,E,L,A,CL>, Scope<P,E,L,A,CL> {
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore /**
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * @return
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * technically, an included gramamr does not produce a pattern,
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * but this allows {@link Parseable#parseInclude(String, SchemaBuilder, IncludedGrammar, String)}
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * to return the result from {@link IncludedGrammar} nicely.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore *
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * <p>
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore * The value returned from this method will be returned from the abovementioned method.
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore */
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore P endIncludedGrammar(L loc, A anno) throws BuildException;
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore}
6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648Garrett D'Amore