001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.transformer.bytecode;
020
021import lucee.runtime.exp.TemplateException;
022import lucee.transformer.bytecode.statement.FlowControlFinal;
023
024
025
026/**
027 * A single Statement
028 */
029public interface Statement {
030        
031    /**
032     * sets parent statement to statement
033     * @param parent
034     */
035    public void setParent(Statement parent);
036
037    public boolean hasFlowController();
038    public void setHasFlowController(boolean has);
039    
040    /**
041     * @return returns the parent statement
042     */
043    public Statement getParent();
044    
045    /**
046     * write out the stament to adapter
047     * @param adapter
048     * @throws TemplateException
049     */
050    public void writeOut(BytecodeContext bc) throws BytecodeException;    
051
052    
053    /**
054     * sets the line value.
055     * @param line The line to set.
056     */
057    public void setStart(Position startLine);
058
059    /**
060     * sets the line value.
061     * @param line The line to set.
062     */
063    public void setEnd(Position endLine);
064    
065    /**
066         * @return the startLine
067         */
068        public Position getStart();
069        
070        /**
071         * @return the endLine
072         */
073        public Position getEnd();
074        
075
076        /**
077         * @return return the label where the finally block of this tags starts, IF there is a finally block, otherwise return null; 
078         */
079        public FlowControlFinal getFlowControlFinal();
080}