How Stack-Based Languages Work

Introduction

AQL uses a stack when creating queries.

A stack is simply an ordered list of items. Your query will create a stack and return its contents.

When you build your AQL query, you add data and commands to the stack.

Each command will usually take one or more parameters. For example, the ASSET command takes the name of the asset you want to search for as a parameter.

Unlike many programming languages, where your parameters come after the command, in a stack-based language, they come before.

We will walk you through a quick example of what is going on behind-the-scenes over the next couple of pages, starting with the following small script - 'TE101' ASSET, which means 'Find the asset with an ID of 'TE101'.

Example Page 1