<?php
namespace Claromentis\Infocapture\ExpressionLanguage;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_31767d7a" . "d58e706db" . "f47b7a51a" . "0fe6c4" => base64_decode("Y291b" . "nQ="), "_b331a8392a9" . "0bfa7f141f7b" . "ab6d5b48d" => base64_decode("ICA" . "gIA" . "=="), "_1bee3d4d1d0df49e0fcf8b9ed2ecb8" . "fa" => base64_decode("ZXhwbG9" . "kZQ=="), "_b742a00ae87756f850c" . "77e0daf4e7a3a" => base64_decode("Cg" . "=="), "_38f12d8b8c719a8ce0fc2fa" . "efc225f35" => base64_decode("YXJyYXlfbWF" . "w"), "_c133e11" . "5f1ce8ed" . "7b5a6bce" . "d4c87486" . "2" => base64_decode("YXJyYX" . "lfcG9w"), "_4d707fab93bebb00bb" . "e69e8159697c90" => base64_decode(""), "_2e7835f9a232a7" . "9cbcea739330911" . "3d7" => base64_decode("c3Ry" . "X3Jl" . "cGVh" . "dA=="), "_5159b3572969eca46acd1b2e14" . "18459c" => base64_decode("aW1wbG9" . "kZQ=="));
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["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_c133e115f1ce8ed7b5a6bce" . "d4c874862"]($this->stack);
        $_11f3c924d824315dce0dd92fe145d030 = $this->AssembleState($_5c59c380aa5c5e5f18f039ad7757fe97, $values);
        $this->stack[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_31767d7ad58e70" . "6dbf47b7a51a0fe" . "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["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_2e7835f9a232a79cbcea" . "7393309113d7"]($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_b331a8392a90bfa7f141" . "f7bab6d5b48d"], $_6cf2b68798f07ee3973ee4cd723f19a0);
        return $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_5159b3572969eca" . "46acd1b2e1418459" . "c"]($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_b742a00ae87756f850c" . "77e0daf4e7a3a"], $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_38f12d8b8c7" . "19a8ce0fc2fa" . "efc225f35"](function ($_a2da5768d1ad9473e979acaaeb98624c) use($_936247127c6ca6ff0763bbf48d31c6a0) {
            return $_936247127c6ca6ff0763bbf48d31c6a0 . $_a2da5768d1ad9473e979acaaeb98624c;
        }, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_1bee3d4d1d0df49e" . "0fcf8b9ed2ecb8fa"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_b742a00" . "ae87756f" . "850c77e0" . "daf4e7a3" . "a"], $code)));
    }
    protected function GenerateUnknown(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_4d707fab93b" . "ebb00bbe69e8" . "159697c90"];
    }
}