<?php
namespace Claromentis\Infocapture\ExpressionLanguage;

$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] ?: array()) + array("_c133e11" . "5f1ce8ed" . "7b5a6bce" . "d4c87486" . "2" => base64_decode("YXJyYX" . "lfcG9w"), "_2e7835f9a232" . "a79cbcea73933" . "09113d7" => base64_decode("c3RyX3JlcGVhdA=" . "="), "_b331a8392a90bfa7" . "f141f7bab6d5b48d" => base64_decode("ICA" . "gIA" . "=="), "_1bee3d4d1d0df49e0fcf8b9ed" . "2ecb8fa" => base64_decode("ZXhwbG9k" . "ZQ=="), "_4d707fab93bebb00bbe69e815969" . "7c90" => base64_decode(""), "_5159b3572969ec" . "a46acd1b2e14184" . "59c" => base64_decode("aW1wbG9kZ" . "Q=="), "_31767d7ad58e" . "706dbf47b7a51" . "a0fe6c4" => base64_decode("Y2" . "91" . "bn" . "Q="), "_38f12d8b8c719a8ce0" . "fc2faefc225f35" => base64_decode("YXJyYXlfb" . "WFw"), "_b742a00ae87" . "756f850c77e0" . "daf4e7a3a" => base64_decode("Cg=" . "="));
use Claromentis\Infocapture\ExpressionLanguage\Nodes\ArithmeticNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\EncapsulatedStringNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\ExpressionStatementNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\FieldNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\FunctionCallNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\IdentifierNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\NameNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\StatementNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\UnaryNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\ValueNode;
abstract class AbstractVisitor implements Visitor
{
    const NOW_DATE_FIELD = "_now_date_";
    const SPECIAL_FIELDS_SET = [HD_FIELD_STATUS => true, HD_FIELD_ASSIGNED => true, self::NOW_DATE_FIELD => true];
    
    
    
    
    protected $stack;
    
    
    
    
    protected $depth;
    
    
    
    
    protected $returnValue;
    
    
    
    
    
    public function Begin(array $_10061afd9f8abf8912cb3e433440c183) : void
    {
        $this->stack = [[]];
    }
    public function Enter(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97) : void
    {
        $this->stack[] = [];
        ++$this->depth;
    }
    public function Exit(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97) : void
    {
        $values = $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_c133e115f1ce8ed7b5" . "a6bced4c874862"]($this->stack);
        $_11f3c924d824315dce0dd92fe145d030 = $this->AssembleState($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        $this->stack[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_31767d7ad58e706dbf47b7a51a0fe" . "6c4"]($this->stack) - 1][] = $_11f3c924d824315dce0dd92fe145d030;
        --$this->depth;
    }
    
    
    
    
    
    public function End(array $_10061afd9f8abf8912cb3e433440c183) : void
    {
        $this->returnValue = $this->AssembleFinalState($this->stack[0]);
    }
    private function AssembleState(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        if ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof ArithmeticNode) {
            return $this->GenerateArithmetic($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof FunctionCallNode) {
            return $this->GenerateFunctionCall($_5c59c380aa5c5e5f18f039ad7757fe97->FunctionName(), $values);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof NameNode) {
            return $this->GenerateName($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof UnaryNode) {
            return $this->GenerateUnary($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof FieldNode) {
            $_84a47bf606a9998bf4bc4a92343f6543 = $values[0];
            if (isset(self::SPECIAL_FIELDS_SET[$_84a47bf606a9998bf4bc4a92343f6543])) {
                return $this->GeneratePseudoField($_5c59c380aa5c5e5f18f039ad7757fe97, $_84a47bf606a9998bf4bc4a92343f6543);
            }
            return $this->GenerateField($_5c59c380aa5c5e5f18f039ad7757fe97, $_84a47bf606a9998bf4bc4a92343f6543);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof ValueNode) {
            return $this->GenerateValue($_5c59c380aa5c5e5f18f039ad7757fe97);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof IdentifierNode) {
            return $this->GenerateIdent($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof ExpressionStatementNode) {
            return $this->GenerateStatement($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        } elseif ($_5c59c380aa5c5e5f18f039ad7757fe97 instanceof EncapsulatedStringNode) {
            return $this->GenerateEncapsulatedString($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        }
        return $this->GenerateUnknown($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
    }
    protected abstract function GenerateFunctionCall($_9941c765fe74bedc7526c5d099b855b8, $values);
    protected abstract function GenerateName(NameNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values);
    protected abstract function GenerateArithmetic(ArithmeticNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values);
    protected abstract function GenerateIdent(IdentifierNode $_5c59c380aa5c5e5f18f039ad7757fe97, array $values);
    protected abstract function GeneratePseudoField(FieldNode $_5c59c380aa5c5e5f18f039ad7757fe97, string $_84a47bf606a9998bf4bc4a92343f6543);
    protected abstract function GenerateField(FieldNode $_5c59c380aa5c5e5f18f039ad7757fe97, string $_84a47bf606a9998bf4bc4a92343f6543);
    protected abstract function GenerateValue(ValueNode $_5c59c380aa5c5e5f18f039ad7757fe97);
    protected abstract function GenerateUnary(UnaryNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values);
    protected abstract function GenerateStatement(StatementNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values);
    protected abstract function GenerateEncapsulatedString(EncapsulatedStringNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values);
    protected abstract function AssembleFinalState($values);
    
    
    
    
    public function GetReturnValue()
    {
        return $this->returnValue;
    }
    public function Indent(string $code, int $_6cf2b68798f07ee3973ee4cd723f19a0 = 1)
    {
        $_936247127c6ca6ff0763bbf48d31c6a0 = $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_2e7835f9a23" . "2a79cbcea739" . "3309113d7"]($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_b331a8392a90bfa7f141f7" . "bab6d5b48d"], $_6cf2b68798f07ee3973ee4cd723f19a0);
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_5159b3572969eca46acd1b2e14" . "18459c"]($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_b742a00ae87756f850c77e0daf4" . "e7a3a"], $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_38f12d8b8c719a8ce0fc2faefc" . "225f35"](function ($_a2da5768d1ad9473e979acaaeb98624c) use($_936247127c6ca6ff0763bbf48d31c6a0) {
            return $_936247127c6ca6ff0763bbf48d31c6a0 . $_a2da5768d1ad9473e979acaaeb98624c;
        }, $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_1bee3d4d1d0df49" . "e0fcf8b9ed2ecb8f" . "a"]($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_b742a00ae87756f850c77e0daf4" . "e7a3a"], $code)));
    }
    protected function GenerateUnknown(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_4d707fab93bebb0" . "0bbe69e8159697c9" . "0"];
    }
}