/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * This file is part of SableCC.                             *
 * See the file "LICENSE" for copyright information and the  *
 * terms and conditions for copying, distribution and        *
 * modification of SableCC.                                  *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Macro:AnalysisHeader
/* This file was generated by SableCC (http://www.sablecc.org/). */

package $0$;

import $1$.*;

public interface Analysis extends Switch
{
    Object getIn(Node node);
    void setIn(Node node, Object o);
    Object getOut(Node node);
    void setOut(Node node, Object o);


$
Macro:AnalysisStart
    void caseStart(Start node);

$

Macro:AnalysisBody
    void case$0$($0$ node);

$

Macro:AnalysisTail
    void caseEOF(EOF node);
}

$

Macro:AnalysisAdapterHeader
/* This file was generated by SableCC (http://www.sablecc.org/). */

package $0$;

import java.util.*;
import $1$.*;

public class AnalysisAdapter implements Analysis
{
    private Hashtable<Node,Object> in;
    private Hashtable<Node,Object> out;

    public Object getIn(Node node)
    {
        if(this.in == null)
        {
            return null;
        }

        return this.in.get(node);
    }

    public void setIn(Node node, Object o)
    {
        if(this.in == null)
        {
            this.in = new Hashtable<Node,Object>(1);
        }

        if(o != null)
        {
            this.in.put(node, o);
        }
        else
        {
            this.in.remove(node);
        }
    }

    public Object getOut(Node node)
    {
        if(this.out == null)
        {
            return null;
        }

        return this.out.get(node);
    }

    public void setOut(Node node, Object o)
    {
        if(this.out == null)
        {
            this.out = new Hashtable<Node,Object>(1);
        }

        if(o != null)
        {
            this.out.put(node, o);
        }
        else
        {
            this.out.remove(node);
        }
    }

$

Macro:AnalysisAdapterStart

    public void caseStart(Start node)
    {
        defaultCase(node);
    }

$

Macro:AnalysisAdapterBody

    public void case$0$($0$ node)
    {
        defaultCase(node);
    }

$

Macro:AnalysisAdapterTail

    public void caseEOF(EOF node)
    {
        defaultCase(node);
    }

    public void defaultCase(@SuppressWarnings("unused") Node node)
    {
        // do nothing
    }
}

$

Macro:DepthFirstAdapterHeader
/* This file was generated by SableCC (http://www.sablecc.org/). */

package $0$;

import java.util.*;
import $1$.*;

public class DepthFirstAdapter extends AnalysisAdapter
{
    public void inStart(Start node)
    {
        defaultIn(node);
    }

    public void outStart(Start node)
    {
        defaultOut(node);
    }

    public void defaultIn(@SuppressWarnings("unused") Node node)
    {
        // Do nothing
    }

    public void defaultOut(@SuppressWarnings("unused") Node node)
    {
        // Do nothing
    }

    @Override
    public void caseStart(Start node)
    {
        inStart(node);
        node.get$2$().apply(this);
        node.getEOF().apply(this);
        outStart(node);
    }

$

Macro:ReversedDepthFirstAdapterHeader
/* This file was generated by SableCC (http://www.sablecc.org/). */

package $0$;

import java.util.*;
import $1$.*;

public class ReversedDepthFirstAdapter extends AnalysisAdapter
{
    public void inStart(Start node)
    {
        defaultIn(node);
    }

    public void outStart(Start node)
    {
        defaultOut(node);
    }

    public void defaultIn(@SuppressWarnings("unused") Node node)
    {
        // Do nothing
    }

    public void defaultOut(@SuppressWarnings("unused") Node node)
    {
        // Do nothing
    }

    @Override
    public void caseStart(Start node)
    {
        inStart(node);
        node.getEOF().apply(this);
        node.get$2$().apply(this);
        outStart(node);
    }

$

Macro:DepthFirstAdapterInOut

    public void in$0$($0$ node)
    {
        defaultIn(node);
    }

    public void out$0$($0$ node)
    {
        defaultOut(node);
    }

$

Macro:DepthFirstAdapterCaseHeader

    @Override
    public void case$0$($0$ node)
    {
        in$0$(node);

$

Macro:DepthFirstAdapterCaseBodyNode
        if(node.get$0$() != null)
        {
            node.get$0$().apply(this);
        }

$

Macro:DepthFirstAdapterCaseBodyList
        {
            List<$1$> copy = new ArrayList<$1$>(node.get$0$());
            for($1$ e : copy)
            {
                e.apply(this);
            }
        }

$

Macro:ReversedDepthFirstAdapterCaseBodyList
        {
            List<$1$> copy = new ArrayList<$1$>(node.get$0$());
            Collections.reverse(copy);
            for($1$ e : copy)
            {
                e.apply(this);
            }
        }

$

Macro:DepthFirstAdapterCaseTail
        out$0$(node);
    }

$

Macro:DepthFirstAdapterTail
}

$
