Glyph Language

Glyph Language Rules:

  • Expressions are the basic element.
  • Expressions are separated by whitespace. Additional whitespace is ignored. Whitespace includes space, tab and newlines.
  • Comments are written using #

Expressions

  • Type:Value => Register
    Defines a constant value and stores it in Register.
  • Register1 => Register2
    Retrieves the value from Register1 and stores it in Register2.
  • processing_operation(parameter1 .. parameterN) => Register
    Performs operation with parameter1 to parameterN and stores the result in Register.
  • -> label
    Label declaration. Provides a point where jump instructions can jump to.
  • when comparison_operation(parameter1 .. parameterN) jump label
    If the comparison operation returns true, perform a jump to the named label. Otherwise, normal program flow continues.
  • jump label
    Jump unconditionally to the specified label.

Processing Operations

  • combine(param1, param2)
    Combines param1 with param2 and returns the result.
    The following happens when combining:
    • type(param1) == type(param2) > param1 + param2
    • type(param1) == inv(param2) > param1 - param2
    • else > param1
  • append(param1, param2)
    Creates an aggregate from param1 and param2.
    The following happens with an aggregate:
    • If param1 and param2 are particles, the result becomes an atom.
    • If param1 or param2 are atoms the result becomes a molecule.,

Comparison Operations

  • empty(param1)
    Returns true if param1 is empty, false if not.
  • notempty(param1)
    Returns true if param1 is not empty.
  • equals(param1, param2)
    Returns true if param1 equals param2, both in number and type. Will always return false if either param1 or param2 is empty.
  • greater(param1, param2)
    Returns true if param1 is the same type as param2 and param1 is greater than param2. Will return false if either param1 or param2 is empty or if the types do not match.
  • less(param1, param2)
    Returns true if param1 is the same type as param2 and param1 is less than param2. Will return false if either param1 or param2 is empty or if the types do not match.
  • same_type(param1, param2)
    Returns true if the type of param1 is the same as the type of param2.

Tags

Laatst aangepast op ma, 16/08/2021 21:35 door Brian Bors
Aangemaakt op do, 09/10/2014 22:59 door Anoniem

Recente Wijzigingen