# -*- coding: UTF-8 -*-
#    This file is part of arena.
#   
#    arena 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.
#
#    arena is distributed in the hope that it will be useful, but
#    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABLITY
#    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 arena.  If not, see <http://www.gnu.org/licenses/>. 

## @file
#  This file defines a class that represents a single statement parsed from a
#  source stream. 

from Library.Parse.Semantic.Statements import AStatement

## A statement parsed from a source stream. 
#    
#  This class is not meant to be directly instantiated; instead, it sets up
#  an environment that allows descendant classes to focus on parsing code.
class ASourceStatement(AStatement):
    ## Constructor
    def __init__(Self, **params):
        AStatement.__init__(Self, **params)
        
        if Self._Parser is not None:
            Self._Language = Self._Parser.Language()
    
    ## Initializer
    def init(Self):
        result = AStatement.init(Self)
        
        if result:
            # Establish private attributes
            # The language used to parse statements
            Self._Language = None
            
        return result
        
    # Properties ---------------------------------------------------------------
    ## Retrieve the language used to parse the statement.
    def Language(Self):
        return Self._Language
