001    /* This file was generated by SableCC (http://www.sablecc.org/). */
002    
003    package org.jdmp.core.script.jdmp.node;
004    
005    import org.jdmp.core.script.jdmp.analysis.*;
006    
007    @SuppressWarnings("nls")
008    public final class AFloatingPointLiteral extends PLiteral
009    {
010        private TFloatingPoint _floatingPoint_;
011    
012        public AFloatingPointLiteral()
013        {
014            // Constructor
015        }
016    
017        public AFloatingPointLiteral(
018            @SuppressWarnings("hiding") TFloatingPoint _floatingPoint_)
019        {
020            // Constructor
021            setFloatingPoint(_floatingPoint_);
022    
023        }
024    
025        @Override
026        public Object clone()
027        {
028            return new AFloatingPointLiteral(
029                cloneNode(this._floatingPoint_));
030        }
031    
032        public void apply(Switch sw)
033        {
034            ((Analysis) sw).caseAFloatingPointLiteral(this);
035        }
036    
037        public TFloatingPoint getFloatingPoint()
038        {
039            return this._floatingPoint_;
040        }
041    
042        public void setFloatingPoint(TFloatingPoint node)
043        {
044            if(this._floatingPoint_ != null)
045            {
046                this._floatingPoint_.parent(null);
047            }
048    
049            if(node != null)
050            {
051                if(node.parent() != null)
052                {
053                    node.parent().removeChild(node);
054                }
055    
056                node.parent(this);
057            }
058    
059            this._floatingPoint_ = node;
060        }
061    
062        @Override
063        public String toString()
064        {
065            return ""
066                + toString(this._floatingPoint_);
067        }
068    
069        @Override
070        void removeChild(@SuppressWarnings("unused") Node child)
071        {
072            // Remove child
073            if(this._floatingPoint_ == child)
074            {
075                this._floatingPoint_ = null;
076                return;
077            }
078    
079            throw new RuntimeException("Not a child.");
080        }
081    
082        @Override
083        void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
084        {
085            // Replace child
086            if(this._floatingPoint_ == oldChild)
087            {
088                setFloatingPoint((TFloatingPoint) newChild);
089                return;
090            }
091    
092            throw new RuntimeException("Not a child.");
093        }
094    }