<?php
namespace Claromentis\Infocapture\ExpressionLanguage;

$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] ?: array()) + array("_38f12d8b8c719a8ce0fc2faefc22" . "5f35" => base64_decode("YXJyYXlfbWF" . "w"), "_4d707fab93bebb00bbe6" . "9e8159697c90" => base64_decode(""), "_b331a8392a90bfa7f141f7b" . "ab6d5b48d" => base64_decode("ICAgIA=" . "="), "_b742a00ae87756f85" . "0c77e0daf4e7a3a" => base64_decode("Cg" . "=="), "_5159b3572969eca46ac" . "d1b2e1418459c" => base64_decode("aW1wbG9kZQ" . "=="), "_1bee3d4d1d0df49e0fcf" . "8b9ed2ecb8fa" => base64_decode("ZXhw" . "bG9k" . "ZQ=="), "_c133e115f1ce8ed7b5a" . "6bced4c874862" => base64_decode("YXJyYXlfcG9" . "w"), "_31767d7ad58e7" . "06dbf47b7a51a0" . "fe6c4" => base64_decode("Y291" . "bnQ="), "_2e7835f9a232a" . "79cbcea7393309" . "113d7" => base64_decode("c3RyX3JlcGV" . "hdA=="));
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["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_c133e115f1ce8ed" . "7b5a6bced4c87486" . "2"]($this->stack);
        $_11f3c924d824315dce0dd92fe145d030 = $this->AssembleState($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        $this->stack[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_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["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_2e7835f9a232a79cbcea73933" . "09113d7"]($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_b331a8392a90bfa7f141f7" . "bab6d5b48d"], $_6cf2b68798f07ee3973ee4cd723f19a0);
        return $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_5159b3572" . "969eca46ac" . "d1b2e14184" . "59c"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_b742a00ae87756f850c77e0d" . "af4e7a3a"], $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_38f12d8b8c71" . "9a8ce0fc2faef" . "c225f35"](function ($_a2da5768d1ad9473e979acaaeb98624c) use($_936247127c6ca6ff0763bbf48d31c6a0) {
            return $_936247127c6ca6ff0763bbf48d31c6a0 . $_a2da5768d1ad9473e979acaaeb98624c;
        }, $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_1bee3d4d1d0df49e0fcf8b9ed2ecb" . "8fa"]($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_b742a00ae8" . "7756f850c77" . "e0daf4e7a3a"], $code)));
    }
    protected function GenerateUnknown(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_4d707fab93bebb0" . "0bbe69e8159697c9" . "0"];
    }
}