<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: ast.proto

namespace Proto;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Generated from protobuf message <code>proto.AstNode</code>
 */
class AstNode extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.proto.AstNode.NodeType type = 1;</code>
     */
    private $type = 0;
    /**
     * Generated from protobuf field <code>string name = 2;</code>
     */
    private $name = '';
    /**
     * Generated from protobuf field <code>string full_name = 3;</code>
     */
    private $full_name = '';
    /**
     * Generated from protobuf field <code>string base_type = 4;</code>
     */
    private $base_type = '';
    /**
     * The module name used to include the base class/type
     *
     * Generated from protobuf field <code>string module = 5;</code>
     */
    private $module = '';
    /**
     * The right value if current ast node is an assign expression
     *
     * Generated from protobuf field <code>string value = 6;</code>
     */
    private $value = '';
    /**
     * The definition if current ast node is class/function definition
     *
     * Generated from protobuf field <code>string definition = 7;</code>
     */
    private $definition = '';
    /**
     **
     * The arg nodes used for matching APIs, id indicates their index, name/value can be set.
     * (1) If value is specified, the parent node should be kept only if the value matches.
     * (2) If only value/index is specified, the specified args are sinks in taint analysis.
     *
     * Generated from protobuf field <code>repeated .proto.AstNode arg_nodes = 8;</code>
     */
    private $arg_nodes;
    /**
     * The value of arguments if current ast node is function calls
     *
     * Generated from protobuf field <code>repeated string arguments = 9;</code>
     */
    private $arguments;
    /**
     * All the statements related to current ast node
     *
     * Generated from protobuf field <code>string source = 10;</code>
     */
    private $source = '';
    /**
     * Collect the range/locations of the node
     *
     * Generated from protobuf field <code>.proto.SourceRange range = 11;</code>
     */
    private $range = null;
    /**
     * Map each AstNode to a unique number, and allow flexible constraints expressed in SMT.
     *
     * Generated from protobuf field <code>int32 id = 12;</code>
     */
    private $id = 0;
    /**
     * Each API should either be source, sink or danger. Note: danger APIs are mostly sinks, e.g. rmdir.
     *
     * Generated from protobuf field <code>.proto.Functionality functionality = 13;</code>
     */
    private $functionality = 0;
    /**
     * Record children of the current node
     *
     * Generated from protobuf field <code>repeated .proto.AstNode child_nodes = 18;</code>
     */
    private $child_nodes;
    /**
     * Whether the base_type can be instantiated or not. This can be used in func_only mode to improve API matching.
     *
     * Generated from protobuf field <code>bool instantiatable = 19;</code>
     */
    private $instantiatable = false;
    protected $accurate_functionality;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *     @type string $name
     *     @type string $full_name
     *     @type string $base_type
     *     @type string $module
     *           The module name used to include the base class/type
     *     @type string $value
     *           The right value if current ast node is an assign expression
     *     @type string $definition
     *           The definition if current ast node is class/function definition
     *     @type \Proto\AstNode[]|\Google\Protobuf\Internal\RepeatedField $arg_nodes
     *          *
     *           The arg nodes used for matching APIs, id indicates their index, name/value can be set.
     *           (1) If value is specified, the parent node should be kept only if the value matches.
     *           (2) If only value/index is specified, the specified args are sinks in taint analysis.
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $arguments
     *           The value of arguments if current ast node is function calls
     *     @type string $source
     *           All the statements related to current ast node
     *     @type \Proto\SourceRange $range
     *           Collect the range/locations of the node
     *     @type int $id
     *           Map each AstNode to a unique number, and allow flexible constraints expressed in SMT.
     *     @type int $functionality
     *           Each API should either be source, sink or danger. Note: danger APIs are mostly sinks, e.g. rmdir.
     *     @type int $source_type
     *     @type int $sink_type
     *     @type int $danger_type
     *     @type int $propagate_type
     *     @type \Proto\AstNode[]|\Google\Protobuf\Internal\RepeatedField $child_nodes
     *           Record children of the current node
     *     @type bool $instantiatable
     *           Whether the base_type can be instantiated or not. This can be used in func_only mode to improve API matching.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Ast::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.proto.AstNode.NodeType type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Generated from protobuf field <code>.proto.AstNode.NodeType type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Proto\AstNode_NodeType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string full_name = 3;</code>
     * @return string
     */
    public function getFullName()
    {
        return $this->full_name;
    }

    /**
     * Generated from protobuf field <code>string full_name = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setFullName($var)
    {
        GPBUtil::checkString($var, True);
        $this->full_name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string base_type = 4;</code>
     * @return string
     */
    public function getBaseType()
    {
        return $this->base_type;
    }

    /**
     * Generated from protobuf field <code>string base_type = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setBaseType($var)
    {
        GPBUtil::checkString($var, True);
        $this->base_type = $var;

        return $this;
    }

    /**
     * The module name used to include the base class/type
     *
     * Generated from protobuf field <code>string module = 5;</code>
     * @return string
     */
    public function getModule()
    {
        return $this->module;
    }

    /**
     * The module name used to include the base class/type
     *
     * Generated from protobuf field <code>string module = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setModule($var)
    {
        GPBUtil::checkString($var, True);
        $this->module = $var;

        return $this;
    }

    /**
     * The right value if current ast node is an assign expression
     *
     * Generated from protobuf field <code>string value = 6;</code>
     * @return string
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * The right value if current ast node is an assign expression
     *
     * Generated from protobuf field <code>string value = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->value = $var;

        return $this;
    }

    /**
     * The definition if current ast node is class/function definition
     *
     * Generated from protobuf field <code>string definition = 7;</code>
     * @return string
     */
    public function getDefinition()
    {
        return $this->definition;
    }

    /**
     * The definition if current ast node is class/function definition
     *
     * Generated from protobuf field <code>string definition = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setDefinition($var)
    {
        GPBUtil::checkString($var, True);
        $this->definition = $var;

        return $this;
    }

    /**
     **
     * The arg nodes used for matching APIs, id indicates their index, name/value can be set.
     * (1) If value is specified, the parent node should be kept only if the value matches.
     * (2) If only value/index is specified, the specified args are sinks in taint analysis.
     *
     * Generated from protobuf field <code>repeated .proto.AstNode arg_nodes = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getArgNodes()
    {
        return $this->arg_nodes;
    }

    /**
     **
     * The arg nodes used for matching APIs, id indicates their index, name/value can be set.
     * (1) If value is specified, the parent node should be kept only if the value matches.
     * (2) If only value/index is specified, the specified args are sinks in taint analysis.
     *
     * Generated from protobuf field <code>repeated .proto.AstNode arg_nodes = 8;</code>
     * @param \Proto\AstNode[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setArgNodes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Proto\AstNode::class);
        $this->arg_nodes = $arr;

        return $this;
    }

    /**
     * The value of arguments if current ast node is function calls
     *
     * Generated from protobuf field <code>repeated string arguments = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getArguments()
    {
        return $this->arguments;
    }

    /**
     * The value of arguments if current ast node is function calls
     *
     * Generated from protobuf field <code>repeated string arguments = 9;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setArguments($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->arguments = $arr;

        return $this;
    }

    /**
     * All the statements related to current ast node
     *
     * Generated from protobuf field <code>string source = 10;</code>
     * @return string
     */
    public function getSource()
    {
        return $this->source;
    }

    /**
     * All the statements related to current ast node
     *
     * Generated from protobuf field <code>string source = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setSource($var)
    {
        GPBUtil::checkString($var, True);
        $this->source = $var;

        return $this;
    }

    /**
     * Collect the range/locations of the node
     *
     * Generated from protobuf field <code>.proto.SourceRange range = 11;</code>
     * @return \Proto\SourceRange
     */
    public function getRange()
    {
        return $this->range;
    }

    /**
     * Collect the range/locations of the node
     *
     * Generated from protobuf field <code>.proto.SourceRange range = 11;</code>
     * @param \Proto\SourceRange $var
     * @return $this
     */
    public function setRange($var)
    {
        GPBUtil::checkMessage($var, \Proto\SourceRange::class);
        $this->range = $var;

        return $this;
    }

    /**
     * Map each AstNode to a unique number, and allow flexible constraints expressed in SMT.
     *
     * Generated from protobuf field <code>int32 id = 12;</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Map each AstNode to a unique number, and allow flexible constraints expressed in SMT.
     *
     * Generated from protobuf field <code>int32 id = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

    /**
     * Each API should either be source, sink or danger. Note: danger APIs are mostly sinks, e.g. rmdir.
     *
     * Generated from protobuf field <code>.proto.Functionality functionality = 13;</code>
     * @return int
     */
    public function getFunctionality()
    {
        return $this->functionality;
    }

    /**
     * Each API should either be source, sink or danger. Note: danger APIs are mostly sinks, e.g. rmdir.
     *
     * Generated from protobuf field <code>.proto.Functionality functionality = 13;</code>
     * @param int $var
     * @return $this
     */
    public function setFunctionality($var)
    {
        GPBUtil::checkEnum($var, \Proto\Functionality::class);
        $this->functionality = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.SourceType source_type = 14;</code>
     * @return int
     */
    public function getSourceType()
    {
        return $this->readOneof(14);
    }

    /**
     * Generated from protobuf field <code>.proto.SourceType source_type = 14;</code>
     * @param int $var
     * @return $this
     */
    public function setSourceType($var)
    {
        GPBUtil::checkEnum($var, \Proto\SourceType::class);
        $this->writeOneof(14, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.SinkType sink_type = 15;</code>
     * @return int
     */
    public function getSinkType()
    {
        return $this->readOneof(15);
    }

    /**
     * Generated from protobuf field <code>.proto.SinkType sink_type = 15;</code>
     * @param int $var
     * @return $this
     */
    public function setSinkType($var)
    {
        GPBUtil::checkEnum($var, \Proto\SinkType::class);
        $this->writeOneof(15, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.DangerType danger_type = 16;</code>
     * @return int
     */
    public function getDangerType()
    {
        return $this->readOneof(16);
    }

    /**
     * Generated from protobuf field <code>.proto.DangerType danger_type = 16;</code>
     * @param int $var
     * @return $this
     */
    public function setDangerType($var)
    {
        GPBUtil::checkEnum($var, \Proto\DangerType::class);
        $this->writeOneof(16, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.PropagateType propagate_type = 17;</code>
     * @return int
     */
    public function getPropagateType()
    {
        return $this->readOneof(17);
    }

    /**
     * Generated from protobuf field <code>.proto.PropagateType propagate_type = 17;</code>
     * @param int $var
     * @return $this
     */
    public function setPropagateType($var)
    {
        GPBUtil::checkEnum($var, \Proto\PropagateType::class);
        $this->writeOneof(17, $var);

        return $this;
    }

    /**
     * Record children of the current node
     *
     * Generated from protobuf field <code>repeated .proto.AstNode child_nodes = 18;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getChildNodes()
    {
        return $this->child_nodes;
    }

    /**
     * Record children of the current node
     *
     * Generated from protobuf field <code>repeated .proto.AstNode child_nodes = 18;</code>
     * @param \Proto\AstNode[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setChildNodes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Proto\AstNode::class);
        $this->child_nodes = $arr;

        return $this;
    }

    /**
     * Whether the base_type can be instantiated or not. This can be used in func_only mode to improve API matching.
     *
     * Generated from protobuf field <code>bool instantiatable = 19;</code>
     * @return bool
     */
    public function getInstantiatable()
    {
        return $this->instantiatable;
    }

    /**
     * Whether the base_type can be instantiated or not. This can be used in func_only mode to improve API matching.
     *
     * Generated from protobuf field <code>bool instantiatable = 19;</code>
     * @param bool $var
     * @return $this
     */
    public function setInstantiatable($var)
    {
        GPBUtil::checkBool($var);
        $this->instantiatable = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getAccurateFunctionality()
    {
        return $this->whichOneof("accurate_functionality");
    }

}

