Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationCustom keywords

YASS is a flexible language that supports custom keywords. For instance:

YASS
test x
        

test has been recognised as a keyword by the compiler in the example above. The compiler knows this is a keyword because a plugin exists that specifies this keyword. The plugin has the following Java code:

Java
import jamiebalfour.zpe.core.AST;
import jamiebalfour.zpe.core.ZenithEngine;
public class ZenithCustomModule implements jamiebalfour.zpe.core.ZenithCustomModule {

  @Override
  public String GetName() {
      return "test";
  }
  @Override
  public AST CompileToAST(ZenithEngine z) {

      AST node = new AST();
      z.ExternalMethods.EatSymbol();
      node.value = z.ExternalMethods.GetCurrentCompilerWord();

      return node;
  }
  @Override
  public void Traverse(ZenithEngine z, AST node) {

      System.out.println(node.value);

  }
}
Comments

There are no comments on this page.

New comment

Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you.

Comments powered by BalfComment

Feedback 👍
Comments are sent via email to me.