AARCHMRS Schema 2.5.3

↚ Home

AST.Function object

A model representing an arbitrary function call:

  • IsSecure()
  • HaveEL(EL2)
  • SomeFunction(SomeNestedFunction(EL1, 0x10), n > 5)

object

Properties Type Description
_meta Meta
See Meta for more information.
_type
Enum
AST.Function
arguments
array [
BinaryOp
]

The function's arguments.

Default
[]
name

The function name.

Pattern
/^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)*$/
Additional Properties
Not Allowed
◊ Required
Properties marked with ◊ are required properties.
Examples
{
    "_type": "AST.Function", 
    "name": "IsSecure"
}
{
    "_type": "AST.Function", 
    "name": "HaveEL", 
    "arguments": [
        {
            "_type": "AST.Identifier", 
            "value": "EL2"
        }
    ]
}
{
    "_type": "AST.Function", 
    "name": "HaveEL", 
    "arguments": [
        {
            "_type": "AST.Identifier", 
            "value": "EL2"
        }
    ]
}
{
    "_type": "AST.Function", 
    "name": "SomeFunction", 
    "arguments": [
        {
            "_type": "AST.Function", 
            "name": "SomeNestedFunction", 
            "arguments": [
                {
                    "_type": "AST.Identifier", 
                    "value": "EL1"
                }
            ]
        }, 
        {
            "_type": "AST.BinaryOp", 
            "left": {
                "_type": "AST.Identifier", 
                "value": "n"
            }, 
            "op": ">", 
            "right": {
                "_type": "AST.Integer", 
                "value": 5
            }
        }
    ]
}

Schema http://json-schema.org/draft-04/schema#

{
  "additionalProperties": false,
  "examples": [
    {
      "_type": "AST.Function",
      "name": "IsSecure"
    },
    {
      "_type": "AST.Function",
      "name": "HaveEL",
      "arguments": [
        {
          "_type": "AST.Identifier",
          "value": "EL2"
        }
      ]
    },
    {
      "_type": "AST.Function",
      "name": "HaveEL",
      "arguments": [
        {
          "_type": "AST.Identifier",
          "value": "EL2"
        }
      ]
    },
    {
      "_type": "AST.Function",
      "name": "SomeFunction",
      "arguments": [
        {
          "_type": "AST.Function",
          "name": "SomeNestedFunction",
          "arguments": [
            {
              "_type": "AST.Identifier",
              "value": "EL1"
            }
          ]
        },
        {
          "_type": "AST.BinaryOp",
          "left": {
            "_type": "AST.Identifier",
            "value": "n"
          },
          "op": ">",
          "right": {
            "_type": "AST.Integer",
            "value": 5
          }
        }
      ]
    }
  ],
  "info": [
    "A model representing an arbitrary function call:",
    [
      " - `IsSecure()`",
      " - `HaveEL(EL2)`",
      " - `SomeFunction(SomeNestedFunction(EL1, 0x10), n > 5)`"
    ]
  ],
  "properties": {
    "_meta": {
      "$ref": "../Meta.json"
    },
    "_type": {
      "enum": [
        "AST.Function"
      ]
    },
    "name": {
      "info": [
        "The function name."
      ],
      "pattern": "^[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z][A-Za-z0-9_]*)*$"
    },
    "arguments": {
      "info": [
        "The function's arguments."
      ],
      "default": [],
      "type": "array",
      "items": {
        "$ref": "BinaryOp.json#/definitions/expression"
      }
    }
  },
  "required": [
    "name"
  ],
  "title": "Function",
  "type": "object",
  "$schema": "http://json-schema.org/draft-04/schema#"
}