<?php
namespace Claromentis\Infocapture\ExpressionLanguage;

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] ?: array()) + array("_b331a8392a90bfa7f141f7ba" . "b6d5b48d" => base64_decode("IC" . "Ag" . "IA" . "=="), "_4d707fab93bebb00bb" . "e69e8159697c90" => base64_decode(""), "_c133e115f1ce8ed7b5a6bced4" . "c874862" => base64_decode("YXJyYXlfc" . "G9w"), "_1bee3d4d1d0df49e0fcf" . "8b9ed2ecb8fa" => base64_decode("ZXhw" . "bG9k" . "ZQ=="), "_31767d7ad58e706dbf47b7" . "a51a0fe6c4" => base64_decode("Y291" . "bnQ="), "_38f12d8b8c719a8ce0fc2faefc2" . "25f35" => base64_decode("YXJy" . "YXlf" . "bWFw"), "_5159b3572969eca46acd1b2e14184" . "59c" => base64_decode("aW1wb" . "G9kZQ" . "=="), "_2e7835f9a232a" . "79cbcea7393309" . "113d7" => base64_decode("c3RyX3JlcGVh" . "dA=="), "_b742a00ae8775" . "6f850c77e0daf4" . "e7a3a" => 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["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_c133e115f1ce8ed7b5a6" . "bced4c874862"]($this->stack);
        $_11f3c924d824315dce0dd92fe145d030 = $this->AssembleState($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        $this->stack[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_31767d7ad58e706dbf47" . "b7a51a0fe6c4"]($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"]["_2e7835f9a232a79cbce" . "a7393309113d7"]($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_b331a8392a90bfa7f14" . "1f7bab6d5b48d"], $_6cf2b68798f07ee3973ee4cd723f19a0);
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_5159b3572969" . "eca46acd1b2e1" . "418459c"]($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_b742a00ae87756f85" . "0c77e0daf4e7a3a"], $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_38f12d8b8c719a8ce" . "0fc2faefc225f35"](function ($_a2da5768d1ad9473e979acaaeb98624c) use($_936247127c6ca6ff0763bbf48d31c6a0) {
            return $_936247127c6ca6ff0763bbf48d31c6a0 . $_a2da5768d1ad9473e979acaaeb98624c;
        }, $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_1bee3d4d1d0df49e0fcf8b9ed2ecb" . "8fa"]($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_b742a00ae87756f850c" . "77e0daf4e7a3a"], $code)));
    }
    protected function GenerateUnknown(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_4d707fab9" . "3bebb00bbe" . "69e8159697" . "c90"];
    }
}