<?php
namespace Claromentis\Infocapture\ExpressionLanguage;

$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] ?: array()) + array("_38f12d8b8c7" . "19a8ce0fc2fa" . "efc225f35" => base64_decode("YXJyYXlfb" . "WFw"), "_4d707fab93beb" . "b00bbe69e81596" . "97c90" => base64_decode(""), "_31767d7ad58e7" . "06dbf47b7a51a0" . "fe6c4" => base64_decode("Y291" . "bnQ="), "_b331a8392a90b" . "fa7f141f7bab6d" . "5b48d" => base64_decode("ICAg" . "IA=="), "_2e7835f9a23" . "2a79cbcea739" . "3309113d7" => base64_decode("c3RyX3Jlc" . "GVhdA=="), "_1bee3d4d1d0df49e0fcf8b9ed2ecb8" . "fa" => base64_decode("ZXhwbG9kZQ=" . "="), "_5159b357" . "2969eca46" . "acd1b2e14" . "18459c" => base64_decode("aW1w" . "bG9k" . "ZQ=="), "_b742a00ae87756f850c77e0daf4e" . "7a3a" => base64_decode("C" . "g" . "=" . "="), "_c133e115f1ce8e" . "d7b5a6bced4c874" . "862" => base64_decode("YXJ" . "yYX" . "lfc" . "G9w"));
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["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_c133e115f1ce8ed7b5a6bced4c" . "874862"]($this->stack);
        $_11f3c924d824315dce0dd92fe145d030 = $this->AssembleState($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        $this->stack[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_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["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_2e7835f9a2" . "32a79cbcea7" . "393309113d7"]($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_b331a8392a90bfa7f1" . "41f7bab6d5b48d"], $_6cf2b68798f07ee3973ee4cd723f19a0);
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_5159b3572969eca4" . "6acd1b2e1418459c"]($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_b742a00a" . "e87756f85" . "0c77e0daf" . "4e7a3a"], $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_38f12d8b8c719a8c" . "e0fc2faefc225f35"](function ($_a2da5768d1ad9473e979acaaeb98624c) use($_936247127c6ca6ff0763bbf48d31c6a0) {
            return $_936247127c6ca6ff0763bbf48d31c6a0 . $_a2da5768d1ad9473e979acaaeb98624c;
        }, $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_1bee3d4d1d0" . "df49e0fcf8b9" . "ed2ecb8fa"]($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_b742a00ae87756f850c77e0d" . "af4e7a3a"], $code)));
    }
    protected function GenerateUnknown(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_4d707fab93bebb00bbe69e81" . "59697c90"];
    }
}