User Tools

Site Tools


commands:parsing

Parsing & Evaluation

This page outlines what happens when a command is executed by Wintermute:

Naming & Reserved Characters

Wintermute uses special characters to navigate the text it executes; as such, when naming Zones, Nodes, Variables, or UIDs or parameters of Dynamic Objects, you should avoid the following characters:

( ) : | ! [ ] = . ~ { } ^ $ @ < >

Spaces can be used - but in the case of Zones and Variables, they won't be able to be involved in variable references

Parsing Process

When a command is received via UDP, the following sequence of events takes place:

variable reference parserobject parser ⇒ Conditonal Evaluation ⇒ Execution

When a command is executed from a macro, an additional first step is added: references are evaluated against local variables contained in the macro.

Note that the sequence of events means that variable references can be used to dynamically refer to dynamic objects, but not the other way around.

Evaluation

Evaluation is the process whereby Wintermute (or any other programming system for that matter) takes statements that refer to other things and gets the value of those things. So, for example, in the conditional:

zone.variable1=foo

…Wintermute evaluates zone.variable1 and checks to see if its value equals “foo”. Simple enough, you might say - but there is more to it:

  • Wintermute will attempt to evaluate both sides of a conditional statement as variables
  • If either side cannot be evaluated as a variable (i.e. a variable of that name does not exist), then the text will be treated as a literal string
  • All this happens after variable references are evaluated

So given a second variable, zone.variable2 with the (literal) value “zone.variable1”, the following statements are true:

  • foo=foo
  • foo=zone.variable1
  • $zone.varialbe2=foo
commands/parsing.txt · Last modified: 2024/09/20 07:47 by 127.0.0.1