package terse.vm;

import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.regex.Pattern;

import terse.vm.Cls.JavaMeth;
import terse.vm.Cls.UsrMeth;
import terse.vm.Cls.Meth;
import terse.vm.Cls.StrMeth;
import terse.vm.Expr.Seq;
import terse.vm.Expr.Send;
import terse.vm.Expr.Top;
import terse.vm.Expr.LvName;
import terse.vm.Expr.LvTuple;
import terse.vm.Expr.LValue;
import terse.vm.Terp.Frame;

import terse.vm.Pro.Blk;
import terse.vm.Pro.Buf;
import terse.vm.Pro.Dict;
import terse.vm.Pro.Undefined;
import terse.vm.Pro.Num;
import terse.vm.Pro.Obj;
import terse.vm.Pro.Str;
import terse.vm.Pro.Sys;
import terse.vm.Pro.Vec;
import terse.vm.Usr.Tmp;

public class Wrap extends Static {

  public void installMethods(final Terp terp) {


    new JavaMeth(terp.wrap.clsPro, "cls", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Pro self = (Pro) r;
        return self.cls;
      }
    };
    new JavaMeth(terp.wrap.clsPro, "peekInstVars", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Pro self = (Pro) r;
        return new Vec(terp, self.instVars);
      }
    };
    // CMD meth Obj nearestInt  "convert a Num to the nearest int, by adding 0.5 and flooring" TYPE int NAME toNearestInt PARAMS 
    // CLS Obj GROUP "nearestInt" METH convert a Num to the nearest int, by adding 0.5 and flooring REMARK ""

    new JavaMeth(terp.wrap.clsObj, "convert a Num to the nearest int", " by adding 0.5 and flooring") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        return terp.newNum(self.toNearestInt ());
      }
    };

    // CMD meth Obj "macro" macro:vec: "Execute the block to return a vector." TYPE Pro NAME macroVec PARAMS {Frame _} { Blk b}
    // CLS Obj GROUP "macro" METH macro:vec: REMARK "Execute the block to return a vector."

    new JavaMeth(terp.wrap.clsObj, "macro:vec:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        return self.macroVec (a, b);
      }
    };

    // CMD meth Obj "macro" macro:dict: "Construct a Dict from list of pairs." TYPE Pro NAME macroDict PARAMS {Frame _} { Blk b}
    // CLS Obj GROUP "macro" METH macro:dict: REMARK "Construct a Dict from list of pairs."

    new JavaMeth(terp.wrap.clsObj, "macro:dict:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        return self.macroDict (a, b);
      }
    };

    // CMD meth Obj "macro" macro:for:do: TYPE Pro NAME macroForDo PARAMS {Frame _} { Blk b} { Blk c}
    // CLS Obj GROUP "macro" METH macro:for:do: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:for:do:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        Blk c = (Blk) args[2];
        return self.macroForDo (a, b, c);
      }
    };

    // CMD meth Obj "macro" macro:for:map: TYPE Pro NAME macroForMap PARAMS {Frame _} { Blk b} { Blk c}
    // CLS Obj GROUP "macro" METH macro:for:map: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:for:map:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        Blk c = (Blk) args[2];
        return self.macroForMap (a, b, c);
      }
    };

    // CMD meth Obj "macro" macro:for:init:reduce: TYPE Pro NAME macroForMap PARAMS {Frame _} { Blk b} { Blk init} { Blk c}
    // CLS Obj GROUP "macro" METH macro:for:init:reduce: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:for:init:reduce:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        Blk c = (Blk) args[2];
        Blk d = (Blk) args[3];
        return self.macroForMap (a, b, c, d);
      }
    };

    // CMD meth Obj "macro" macro:if:then: TYPE Pro NAME macroIfThenElse PARAMS {Frame _} { Blk b} { Blk c}
    // CLS Obj GROUP "macro" METH macro:if:then: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:if:then:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        Blk c = (Blk) args[2];
        return self.macroIfThenElse (a, b, c);
      }
    };

    // CMD meth Obj "macro" macro:if:then:else: TYPE Pro NAME macroIfThenElse PARAMS {Frame _} { Blk b} { Blk c} { Blk d}
    // CLS Obj GROUP "macro" METH macro:if:then:else: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:if:then:else:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        Blk c = (Blk) args[2];
        Blk d = (Blk) args[3];
        return self.macroIfThenElse (a, b, c, d);
      }
    };

    // CMD meth Obj "macro" macro:if:then:elif:then:else: TYPE Pro NAME macroIfThenElse PARAMS {Frame _} { Blk b} { Blk c} { Blk d} { Blk e} { Blk f}
    // CLS Obj GROUP "macro" METH macro:if:then:elif:then:else: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:if:then:elif:then:else:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        Blk c = (Blk) args[2];
        Blk d = (Blk) args[3];
        Blk e = (Blk) args[4];
        Blk f = (Blk) args[5];
        return self.macroIfThenElse (a, b, c, d, e, f);
      }
    };

    // CMD meth Obj "macro" macro:if:then:elif:then: TYPE Pro NAME macroIfThenElse PARAMS {Frame _} { Blk b} { Blk c} { Blk d} { Blk e}
    // CLS Obj GROUP "macro" METH macro:if:then:elif:then: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:if:then:elif:then:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        Blk c = (Blk) args[2];
        Blk d = (Blk) args[3];
        Blk e = (Blk) args[4];
        return self.macroIfThenElse (a, b, c, d, e);
      }
    };

    // CMD meth Obj "macro" macro:and: TYPE Pro NAME macroAnd PARAMS {Frame _} { Blk b}
    // CLS Obj GROUP "macro" METH macro:and: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:and:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        return self.macroAnd (a, b);
      }
    };

    // CMD meth Obj "macro" macro:or: TYPE Pro NAME macroOr PARAMS {Frame _} { Blk b}
    // CLS Obj GROUP "macro" METH macro:or: REMARK ""

    new JavaMeth(terp.wrap.clsObj, "macro:or:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Frame a = (Frame) args[0];
        Blk b = (Blk) args[1];
        return self.macroOr (a, b);
      }
    };

    // CMD meth Obj "eval" eval: "Evaluate a string as code in this receiver." TYPE Pro NAME eval PARAMS {String code}
    // CLS Obj GROUP "eval" METH eval: REMARK "Evaluate a string as code in this receiver."

    new JavaMeth(terp.wrap.clsObj, "eval:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Str a = (Str) args[0];
        return self.eval (a.str);
      }
    };

    // CMD meth Obj "eval" eval:arg:  "Evaluate a string as code in this receiver." TYPE Pro NAME eval PARAMS {String code} { Pro a}
    // CLS Obj GROUP "eval" METH eval:arg: REMARK "Evaluate a string as code in this receiver."

    new JavaMeth(terp.wrap.clsObj, "eval:arg:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Str a = (Str) args[0];
        Pro b = (Pro) args[1];
        return self.eval (a.str, b);
      }
    };

    // CMD meth Obj "eval" eval:arg:arg:  "Evaluate a string as code in this receiver." TYPE Pro NAME eval PARAMS {String code} { Pro a} { Pro b}
    // CLS Obj GROUP "eval" METH eval:arg:arg: REMARK "Evaluate a string as code in this receiver."

    new JavaMeth(terp.wrap.clsObj, "eval:arg:arg:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Obj self = (Obj) r;
        Str a = (Str) args[0];
        Pro b = (Pro) args[1];
        Pro c = (Pro) args[2];
        return self.eval (a.str, b, c);
      }
    };

    // CMD meth SysCls "io" files  "Return list of tuples: names, mtime, length." TYPE Vec NAME files PARAMS {Terp terp}
    // CLS SysCls GROUP "io" METH files REMARK "Return list of tuples: names, mtime, length."

    new JavaMeth(terp.wrap.clsSysCls, "files", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        return Sys.files (terp);
      }
    };

    // CMD meth SysCls "io" read: "Read a text file as one big Str." TYPE Pro NAME readTxt PARAMS {Terp terp} { String filename}
    // CLS SysCls GROUP "io" METH read: REMARK "Read a text file as one big Str."

    new JavaMeth(terp.wrap.clsSysCls, "read:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        Str a = (Str) args[0];
        return Sys.readTxt (terp,a.str);
      }
    };

    // CMD meth SysCls "io" write:value: "Write a text file as one big Str." TYPE void NAME writeTxt PARAMS {Terp terp} { String filename} { String content}
    // CLS SysCls GROUP "io" METH write:value: REMARK "Write a text file as one big Str."

    new JavaMeth(terp.wrap.clsSysCls, "write:value:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        Str a = (Str) args[0];
        Str b = (Str) args[1];
        Sys.writeTxt (terp,a.str, b.str);
        return self;
      }
    };

    // CMD meth SysCls "io" append:value:  "Append a text file as one big Str." TYPE void NAME appendTxt PARAMS {Terp terp} { String filename} { String content}
    // CLS SysCls GROUP "io" METH append:value: REMARK "Append a text file as one big Str."

    new JavaMeth(terp.wrap.clsSysCls, "append:value:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        Str a = (Str) args[0];
        Str b = (Str) args[1];
        Sys.appendTxt (terp,a.str, b.str);
        return self;
      }
    };

    // CMD meth SysCls "io" webFiles "List files on web with mtime and size." TYPE Vec NAME webListFiles PARAMS {Terp terp}
    // CLS SysCls GROUP "io" METH webFiles REMARK "List files on web with mtime and size."

    new JavaMeth(terp.wrap.clsSysCls, "webFiles", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        return Sys.webListFiles (terp);
      }
    };

    // CMD meth SysCls "io" pull: "Pull a file from the Web." TYPE String NAME pull PARAMS {Terp terp} { String filename}
    // CLS SysCls GROUP "io" METH pull: REMARK "Pull a file from the Web."

    new JavaMeth(terp.wrap.clsSysCls, "pull:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        Str a = (Str) args[0];
        String z = Sys.pull (terp,a.str);
        return (z == null) ? terp.instNil : terp.newStr(z);
      }
    };

    // CMD meth SysCls "io" push:value: "Push a file to the Web." TYPE void NAME push PARAMS {Terp terp} { String filename} { String content}
    // CLS SysCls GROUP "io" METH push:value: REMARK "Push a file to the Web."

    new JavaMeth(terp.wrap.clsSysCls, "push:value:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        Str a = (Str) args[0];
        Str b = (Str) args[1];
        Sys.push (terp,a.str, b.str);
        return self;
      }
    };

    // CMD meth SysCls "sys" worldName "which world is loaded" TYPE String NAME _worldName PARAMS {Terp terp}
    // CLS SysCls GROUP "sys" METH worldName REMARK "which world is loaded"

    new JavaMeth(terp.wrap.clsSysCls, "worldName", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        String z = Sys._worldName (terp);
        return (z == null) ? terp.instNil : terp.newStr(z);
      }
    };

    // CMD meth SysCls "sys" worldFileName "which world is loaded" TYPE String NAME _worldFileName PARAMS {Terp terp}
    // CLS SysCls GROUP "sys" METH worldFileName REMARK "which world is loaded"

    new JavaMeth(terp.wrap.clsSysCls, "worldFileName", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        String z = Sys._worldFileName (terp);
        return (z == null) ? terp.instNil : terp.newStr(z);
      }
    };

    // CMD meth SysCls "sys" trigraphs "keyboard character substitution dict" TYPE Pro NAME trigraphs PARAMS {Terp terp}
    // CLS SysCls GROUP "sys" METH trigraphs REMARK "keyboard character substitution dict"

    new JavaMeth(terp.wrap.clsSysCls, "trigraphs", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
        Cls self = terp.wrap.clsSysCls;
        return Sys.trigraphs (terp);
      }
    };

    // CMD meth Blk "param" storeAtParam0: TYPE void NAME storeAtParam0 PARAMS {Pro x}
    // CLS Blk GROUP "param" METH storeAtParam0: REMARK ""

    new JavaMeth(terp.wrap.clsBlk, "storeAtParam0:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Blk self = (Blk) r;
        Pro a = (Pro) args[0];
        self.storeAtParam0 (a);
        return self;
      }
    };

    // CMD meth Blk "param" storeAtParam1: TYPE void NAME storeAtParam1 PARAMS {Pro x}
    // CLS Blk GROUP "param" METH storeAtParam1: REMARK ""

    new JavaMeth(terp.wrap.clsBlk, "storeAtParam1:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Blk self = (Blk) r;
        Pro a = (Pro) args[0];
        self.storeAtParam1 (a);
        return self;
      }
    };

    // CMD meth Blk "param" storeAtParamKV: TYPE void NAME storeAtParamKV PARAMS {Pro k} { Pro v}
    // CLS Blk GROUP "param" METH storeAtParamKV: REMARK ""

    new JavaMeth(terp.wrap.clsBlk, "storeAtParamKV:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Blk self = (Blk) r;
        Pro a = (Pro) args[0];
        Pro b = (Pro) args[1];
        self.storeAtParamKV (a, b);
        return self;
      }
    };

    // CMD meth Blk "eval" value TYPE Pro NAME evalWithoutArgs PARAMS 
    // CLS Blk GROUP "eval" METH value REMARK ""

    new JavaMeth(terp.wrap.clsBlk, "value", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Blk self = (Blk) r;
        return self.evalWithoutArgs ();
      }
    };

    // CMD meth Blk "eval" value: TYPE Pro NAME evalWith1Arg PARAMS {Pro arg0}
    // CLS Blk GROUP "eval" METH value: REMARK ""

    new JavaMeth(terp.wrap.clsBlk, "value:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Blk self = (Blk) r;
        Pro a = (Pro) args[0];
        return self.evalWith1Arg (a);
      }
    };

    // CMD meth Blk "eval" value:value: TYPE Pro NAME evalWith2Args PARAMS {Pro arg0} { Pro arg1}
    // CLS Blk GROUP "eval" METH value:value: REMARK ""

    new JavaMeth(terp.wrap.clsBlk, "value:value:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Blk self = (Blk) r;
        Pro a = (Pro) args[0];
        Pro b = (Pro) args[1];
        return self.evalWith2Args (a, b);
      }
    };

    // CMD meth Num "access" chr  "covert integer to single-char Str with that unicode codepoint" TYPE String NAME chr PARAMS 
    // CLS Num GROUP "access" METH chr REMARK "covert integer to single-char Str with that unicode codepoint"

    new JavaMeth(terp.wrap.clsNum, "chr", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        String z = self.chr ();
        return (z == null) ? terp.instNil : terp.newStr(z);
      }
    };

    // CMD meth Num "binop" == "eq two Nums" TYPE Num NAME _eq_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH == REMARK "eq two Nums"

    new JavaMeth(terp.wrap.clsNum, "==", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._eq_ (a);
      }
    };

    // CMD meth Num "binop" != "ne two Nums" TYPE Num NAME _ne_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH != REMARK "ne two Nums"

    new JavaMeth(terp.wrap.clsNum, "!=", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._ne_ (a);
      }
    };

    // CMD meth Num "binop" < "lt two Nums" TYPE Num NAME _lt_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH < REMARK "lt two Nums"

    new JavaMeth(terp.wrap.clsNum, "<", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._lt_ (a);
      }
    };

    // CMD meth Num "binop" <= "le two Nums" TYPE Num NAME _le_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH <= REMARK "le two Nums"

    new JavaMeth(terp.wrap.clsNum, "<=", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._le_ (a);
      }
    };

    // CMD meth Num "binop" > "gt two Nums" TYPE Num NAME _gt_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH > REMARK "gt two Nums"

    new JavaMeth(terp.wrap.clsNum, ">", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._gt_ (a);
      }
    };

    // CMD meth Num "binop" >= "ge two Nums" TYPE Num NAME _ge_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH >= REMARK "ge two Nums"

    new JavaMeth(terp.wrap.clsNum, ">=", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._ge_ (a);
      }
    };

    // CMD meth Num "binop" + "add two Nums" TYPE Num NAME _pl_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH + REMARK "add two Nums"

    new JavaMeth(terp.wrap.clsNum, "+", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._pl_ (a);
      }
    };

    // CMD meth Num "binop" - "add two Nums" TYPE Num NAME _mi_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH - REMARK "add two Nums"

    new JavaMeth(terp.wrap.clsNum, "-", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._mi_ (a);
      }
    };

    // CMD meth Num "binop" | "bitwise-or two Nums as 32bit integers" TYPE Num NAME _or_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH | REMARK "bitwise-or two Nums as 32bit integers"

    new JavaMeth(terp.wrap.clsNum, "|", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._or_ (a);
      }
    };

    // CMD meth Num "binop" ^ "bitwise-xor two Nums as 32bit integers" TYPE Num NAME _xo_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH ^ REMARK "bitwise-xor two Nums as 32bit integers"

    new JavaMeth(terp.wrap.clsNum, "^", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._xo_ (a);
      }
    };

    // CMD meth Num "binop" * "multiply two Nums" TYPE Num NAME _ti_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH * REMARK "multiply two Nums"

    new JavaMeth(terp.wrap.clsNum, "*", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._ti_ (a);
      }
    };

    // CMD meth Num "binop" / "divide two Nums" TYPE Num NAME _di_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH / REMARK "divide two Nums"

    new JavaMeth(terp.wrap.clsNum, "/", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._di_ (a);
      }
    };

    // CMD meth Num "binop" % "modulo two Nums" TYPE Num NAME _mo_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH % REMARK "modulo two Nums"

    new JavaMeth(terp.wrap.clsNum, "%", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._mo_ (a);
      }
    };

    // CMD meth Num "binop" & "bitwise-and two Nums as 32bit integers" TYPE Num NAME _an_ PARAMS {Num a}
    // CLS Num GROUP "binop" METH & REMARK "bitwise-and two Nums as 32bit integers"

    new JavaMeth(terp.wrap.clsNum, "&", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Num self = (Num) r;
        Num a = (Num) args[0];
        return self._an_ (a);
      }
    };

    // CMD meth Str "access" applySubstitutions "" TYPE Str NAME applySubstitutions PARAMS 
    // CLS Str GROUP "access" METH applySubstitutions REMARK ""

    new JavaMeth(terp.wrap.clsStr, "applySubstitutions", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Str self = (Str) r;
        return self.applySubstitutions ();
      }
    };

    // CMD meth Str "access" ord  "unicode codepoint number of first char in Str" TYPE int NAME ord PARAMS 
    // CLS Str GROUP "access" METH ord REMARK "unicode codepoint number of first char in Str"

    new JavaMeth(terp.wrap.clsStr, "ord", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Str self = (Str) r;
        return terp.newNum(self.ord ());
      }
    };

    // CMD meth Vec "access" len "return length of the Vec" TYPE Num NAME _len PARAMS 
    // CLS Vec GROUP "access" METH len REMARK "return length of the Vec"

    new JavaMeth(terp.wrap.clsVec, "len", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        return self._len ();
      }
    };

    // CMD meth Vec "access" at: "get element at index a, modulo length of Vec" TYPE Pro NAME at_ PARAMS {Num a}
    // CLS Vec GROUP "access" METH at: REMARK "get element at index a, modulo length of Vec"

    new JavaMeth(terp.wrap.clsVec, "at:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        Num a = (Num) args[0];
        return self.at_ (a);
      }
    };

    // CMD meth Vec "access" at:put:,at:p:  "put element b at given a, modulo length of Vec" TYPE void NAME at_put_ PARAMS {Num a} { Pro b}
    // CLS Vec GROUP "access" METH at:put:,at:p: REMARK "put element b at given a, modulo length of Vec"

    new JavaMeth(terp.wrap.clsVec, "at:put:", "at:p:") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        Num a = (Num) args[0];
        Pro b = (Pro) args[1];
        self.at_put_ (a, b);
        return self;
      }
    };

    // CMD meth Vec "access" append:,ap: "add new element ato end of Vec" TYPE void NAME append_ PARAMS {Pro a}
    // CLS Vec GROUP "access" METH append:,ap: REMARK "add new element ato end of Vec"

    new JavaMeth(terp.wrap.clsVec, "append:", "ap:") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        Pro a = (Pro) args[0];
        self.append_ (a);
        return self;
      }
    };

    // CMD meth Vec "string" join:  "Join strings on spaces." TYPE Str NAME join PARAMS {String a}
    // CLS Vec GROUP "string" METH join: REMARK "Join strings on spaces."

    new JavaMeth(terp.wrap.clsVec, "join:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        Str a = (Str) args[0];
        return self.join (a.str);
      }
    };

    // CMD meth Vec "string" join  "Join strings on spaces." TYPE Str NAME join PARAMS 
    // CLS Vec GROUP "string" METH join REMARK "Join strings on spaces."

    new JavaMeth(terp.wrap.clsVec, "join", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        return self.join ();
      }
    };

    // CMD meth Vec "string" jam  "Join strings with no separator char." TYPE Str NAME jam PARAMS 
    // CLS Vec GROUP "string" METH jam REMARK "Join strings with no separator char."

    new JavaMeth(terp.wrap.clsVec, "jam", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        return self.jam ();
      }
    };

    // CMD meth Vec "string" implode,imp  "Implode strings and ints (as chars) and subvectors." TYPE Str NAME implode PARAMS 
    // CLS Vec GROUP "string" METH implode,imp REMARK "Implode strings and ints (as chars) and subvectors."

    new JavaMeth(terp.wrap.clsVec, "implode", "imp") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Vec self = (Vec) r;
        return self.implode ();
      }
    };

    new JavaMeth(terp.wrap.clsFrame, "prevFrame", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Frame self = (Frame) r;
        return self.prev;
      }
    };
    new JavaMeth(terp.wrap.clsFrame, "receiver", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Frame self = (Frame) r;
        return self.self;
      }
    };
    new JavaMeth(terp.wrap.clsFrame, "localVars", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Frame self = (Frame) r;
        return new Vec(terp, self.locals);
      }
    };
    new JavaMeth(terp.wrap.clsFrame, "currentMethodExpr", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Frame self = (Frame) r;
        return self.top;
      }
    };
    new JavaMeth(terp.wrap.clsFrame, "level", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Frame self = (Frame) r;
        return terp.newNum(self.level);
      }
    };
    new JavaMeth(terp.wrap.clsExpr, "white", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Expr self = (Expr) r;
        return terp.newStr(self.white);
      }
    };
    new JavaMeth(terp.wrap.clsExpr, "front", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Expr self = (Expr) r;
        return terp.newStr(self.front);
      }
    };
    new JavaMeth(terp.wrap.clsExpr, "rest", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Expr self = (Expr) r;
        return terp.newStr(self.rest);
      }
    };
    // CMD meth Expr "eval" evalFrame: TYPE Pro NAME eval PARAMS {Frame f);  	final Expr setFront(String front}
    // CLS Expr GROUP "eval" METH evalFrame: REMARK ""

    new JavaMeth(terp.wrap.clsExpr, "evalFrame:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Expr self = (Expr) r;
        Frame a = (Frame) args[0];
        return self.eval (a);
      }
    };

    // CMD meth Expr "parser" depth TYPE int NAME depth PARAMS 
    // CLS Expr GROUP "parser" METH depth REMARK ""

    new JavaMeth(terp.wrap.clsExpr, "depth", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Expr self = (Expr) r;
        return terp.newNum(self.depth ());
      }
    };

    // CMD meth LValue "parser" storeFrame:value: TYPE void NAME store PARAMS {Frame f} { Pro x); 		// =meth LValue "parser" recallFrame: 		public abstract Pro recall(Frame f);  		public abstract void fixIndices(Parser p}
    // CLS LValue GROUP "parser" METH storeFrame:value: REMARK ""

    new JavaMeth(terp.wrap.clsLValue, "storeFrame:value:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      LValue self = (LValue) r;
        Frame a = (Frame) args[0];
        Pro b = (Pro) args[1];
        self.store (a, b);
        return self;
      }
    };

    new JavaMeth(terp.wrap.clsLvName, "name", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        LvName self = (LvName) r;
        return terp.newStr(self.name);
      }
    };
    new JavaMeth(terp.wrap.clsLvName, "index", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        LvName self = (LvName) r;
        return terp.newNum(self.index);
      }
    };
    new JavaMeth(terp.wrap.clsLvTuple, "arr", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        LvTuple self = (LvTuple) r;
        return new Vec(terp, self.arr);
      }
    };
    new JavaMeth(terp.wrap.clsTop, "numLocals", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Top self = (Top) r;
        return terp.newNum(self.numLocals);
      }
    };
    new JavaMeth(terp.wrap.clsTop, "numArgs", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Top self = (Top) r;
        return terp.newNum(self.numArgs);
      }
    };
    new JavaMeth(terp.wrap.clsTop, "onCls", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Top self = (Top) r;
        return self.onCls;
      }
    };
    new JavaMeth(terp.wrap.clsTop, "methName", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Top self = (Top) r;
        return terp.newStr(self.methName);
      }
    };
    new JavaMeth(terp.wrap.clsTop, "body", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Top self = (Top) r;
        return self.body;
      }
    };
    new JavaMeth(terp.wrap.clsTop, "source", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Top self = (Top) r;
        return terp.newStr(self.source);
      }
    };
    new JavaMeth(terp.wrap.clsSend, "rcvr", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Send self = (Send) r;
        return self.rcvr;
      }
    };
    new JavaMeth(terp.wrap.clsSend, "msg", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Send self = (Send) r;
        return terp.newStr(self.msg);
      }
    };
    new JavaMeth(terp.wrap.clsSend, "args", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Send self = (Send) r;
        return new Vec(terp, self.args);
      }
    };
    new JavaMeth(terp.wrap.clsSend, "sourceLoc", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Send self = (Send) r;
        return new Vec(terp, self.sourceLoc);
      }
    };
    // CMD meth Cls "access" allMeths TYPE Dict NAME allMeths PARAMS 
    // CLS Cls GROUP "access" METH allMeths REMARK ""

    new JavaMeth(terp.wrap.clsCls, "allMeths", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Cls self = (Cls) r;
        return self.allMeths ();
      }
    };

    // CMD meth Cls "access" defVars: TYPE void NAME defVars PARAMS {String varNames}
    // CLS Cls GROUP "access" METH defVars: REMARK ""

    new JavaMeth(terp.wrap.clsCls, "defVars:", "") {
      public Pro apply(Frame frame, Pro r, Pro[] args) {
      Cls self = (Cls) r;
        Str a = (Str) args[0];
        self.defVars (a.str);
        return self;
      }
    };

    new JavaMeth(terp.wrap.clsMeth, "onCls", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Meth self = (Meth) r;
        return self.onCls;
      }
    };
    new JavaMeth(terp.wrap.clsMeth, "name", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Meth self = (Meth) r;
        return terp.newStr(self.name);
      }
    };
    new JavaMeth(terp.wrap.clsMeth, "abbrev", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Meth self = (Meth) r;
        return terp.newStr(self.abbrev);
      }
    };
    new JavaMeth(terp.wrap.clsMeth, "doc", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        Meth self = (Meth) r;
        return terp.newStr(self.doc);
      }
    };
    new JavaMeth(terp.wrap.clsUsrMeth, "src", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        UsrMeth self = (UsrMeth) r;
        return terp.newStr(self.src);
      }
    };
    new JavaMeth(terp.wrap.clsUsrMeth, "top", "") {
      public Pro apply(Frame f, Pro r, Pro[] args) {
        UsrMeth self = (UsrMeth) r;
        return self.top;
      }
    };

  }


  public void installClasses(final Terp terp) {
    this.clsProCls = terp.tProCls;
    this.clsPro = terp.tPro;

    
    this.clsSuperCls = terp.clss.get("supercls");
    if (this.clsSuperCls == null) {
      this.clsSuperCls = new Cls(terp.tMetaclsCls, terp, "SuperCls", this.clsProCls);
    }
    this.clsSuper      = terp.clss.get("super");
    if (this.clsSuper == null) {
      this.clsSuper = new Cls(this.clsSuperCls, terp, "Super", this.clsPro);
    }
          
    this.clsObjCls = terp.clss.get("objcls");
    if (this.clsObjCls == null) {
      this.clsObjCls = new Cls(terp.tMetaclsCls, terp, "ObjCls", this.clsProCls);
    }
    this.clsObj      = terp.clss.get("obj");
    if (this.clsObj == null) {
      this.clsObj = new Cls(this.clsObjCls, terp, "Obj", this.clsPro);
    }
          
    this.clsSysCls = terp.clss.get("syscls");
    if (this.clsSysCls == null) {
      this.clsSysCls = new Cls(terp.tMetaclsCls, terp, "SysCls", this.clsObjCls);
    }
    this.clsSys      = terp.clss.get("sys");
    if (this.clsSys == null) {
      this.clsSys = new Cls(this.clsSysCls, terp, "Sys", this.clsObj);
    }
          
    this.clsBogusCls = terp.clss.get("boguscls");
    if (this.clsBogusCls == null) {
      this.clsBogusCls = new Cls(terp.tMetaclsCls, terp, "BogusCls", this.clsSysCls);
    }
    this.clsBogus      = terp.clss.get("bogus");
    if (this.clsBogus == null) {
      this.clsBogus = new Cls(this.clsBogusCls, terp, "Bogus", this.clsSys);
    }
          
    this.clsBogus.defVars("slot1 slot2 slot3");
            
    this.clsUndefinedCls = terp.clss.get("undefinedcls");
    if (this.clsUndefinedCls == null) {
      this.clsUndefinedCls = new Cls(terp.tMetaclsCls, terp, "UndefinedCls", this.clsObjCls);
    }
    this.clsUndefined      = terp.clss.get("undefined");
    if (this.clsUndefined == null) {
      this.clsUndefined = new Cls(this.clsUndefinedCls, terp, "Undefined", this.clsObj);
    }
          
    this.clsBlkCls = terp.clss.get("blkcls");
    if (this.clsBlkCls == null) {
      this.clsBlkCls = new Cls(terp.tMetaclsCls, terp, "BlkCls", this.clsObjCls);
    }
    this.clsBlk      = terp.clss.get("blk");
    if (this.clsBlk == null) {
      this.clsBlk = new Cls(this.clsBlkCls, terp, "Blk", this.clsObj);
    }
          
    this.clsNumCls = terp.clss.get("numcls");
    if (this.clsNumCls == null) {
      this.clsNumCls = new Cls(terp.tMetaclsCls, terp, "NumCls", this.clsObjCls);
    }
    this.clsNum      = terp.clss.get("num");
    if (this.clsNum == null) {
      this.clsNum = new Cls(this.clsNumCls, terp, "Num", this.clsObj);
    }
          
    this.clsBufCls = terp.clss.get("bufcls");
    if (this.clsBufCls == null) {
      this.clsBufCls = new Cls(terp.tMetaclsCls, terp, "BufCls", this.clsObjCls);
    }
    this.clsBuf      = terp.clss.get("buf");
    if (this.clsBuf == null) {
      this.clsBuf = new Cls(this.clsBufCls, terp, "Buf", this.clsObj);
    }
          
    this.clsStrCls = terp.clss.get("strcls");
    if (this.clsStrCls == null) {
      this.clsStrCls = new Cls(terp.tMetaclsCls, terp, "StrCls", this.clsObjCls);
    }
    this.clsStr      = terp.clss.get("str");
    if (this.clsStr == null) {
      this.clsStr = new Cls(this.clsStrCls, terp, "Str", this.clsObj);
    }
          
    this.clsVecCls = terp.clss.get("veccls");
    if (this.clsVecCls == null) {
      this.clsVecCls = new Cls(terp.tMetaclsCls, terp, "VecCls", this.clsObjCls);
    }
    this.clsVec      = terp.clss.get("vec");
    if (this.clsVec == null) {
      this.clsVec = new Cls(this.clsVecCls, terp, "Vec", this.clsObj);
    }
          
    this.clsDictCls = terp.clss.get("dictcls");
    if (this.clsDictCls == null) {
      this.clsDictCls = new Cls(terp.tMetaclsCls, terp, "DictCls", this.clsObjCls);
    }
    this.clsDict      = terp.clss.get("dict");
    if (this.clsDict == null) {
      this.clsDict = new Cls(this.clsDictCls, terp, "Dict", this.clsObj);
    }
          
    this.clsFrameCls = terp.clss.get("framecls");
    if (this.clsFrameCls == null) {
      this.clsFrameCls = new Cls(terp.tMetaclsCls, terp, "FrameCls", this.clsObjCls);
    }
    this.clsFrame      = terp.clss.get("frame");
    if (this.clsFrame == null) {
      this.clsFrame = new Cls(this.clsFrameCls, terp, "Frame", this.clsObj);
    }
          
    this.clsExprCls = terp.clss.get("exprcls");
    if (this.clsExprCls == null) {
      this.clsExprCls = new Cls(terp.tMetaclsCls, terp, "ExprCls", this.clsObjCls);
    }
    this.clsExpr      = terp.clss.get("expr");
    if (this.clsExpr == null) {
      this.clsExpr = new Cls(this.clsExprCls, terp, "Expr", this.clsObj);
    }
          
    this.clsLValueCls = terp.clss.get("lvaluecls");
    if (this.clsLValueCls == null) {
      this.clsLValueCls = new Cls(terp.tMetaclsCls, terp, "LValueCls", this.clsExprCls);
    }
    this.clsLValue      = terp.clss.get("lvalue");
    if (this.clsLValue == null) {
      this.clsLValue = new Cls(this.clsLValueCls, terp, "LValue", this.clsExpr);
    }
          
    this.clsLvNameCls = terp.clss.get("lvnamecls");
    if (this.clsLvNameCls == null) {
      this.clsLvNameCls = new Cls(terp.tMetaclsCls, terp, "LvNameCls", this.clsLValueCls);
    }
    this.clsLvName      = terp.clss.get("lvname");
    if (this.clsLvName == null) {
      this.clsLvName = new Cls(this.clsLvNameCls, terp, "LvName", this.clsLValue);
    }
          
    this.clsLvLocalNameCls = terp.clss.get("lvlocalnamecls");
    if (this.clsLvLocalNameCls == null) {
      this.clsLvLocalNameCls = new Cls(terp.tMetaclsCls, terp, "LvLocalNameCls", this.clsLvNameCls);
    }
    this.clsLvLocalName      = terp.clss.get("lvlocalname");
    if (this.clsLvLocalName == null) {
      this.clsLvLocalName = new Cls(this.clsLvLocalNameCls, terp, "LvLocalName", this.clsLvName);
    }
          
    this.clsLvInstNameCls = terp.clss.get("lvinstnamecls");
    if (this.clsLvInstNameCls == null) {
      this.clsLvInstNameCls = new Cls(terp.tMetaclsCls, terp, "LvInstNameCls", this.clsLvNameCls);
    }
    this.clsLvInstName      = terp.clss.get("lvinstname");
    if (this.clsLvInstName == null) {
      this.clsLvInstName = new Cls(this.clsLvInstNameCls, terp, "LvInstName", this.clsLvName);
    }
          
    this.clsLvTupleCls = terp.clss.get("lvtuplecls");
    if (this.clsLvTupleCls == null) {
      this.clsLvTupleCls = new Cls(terp.tMetaclsCls, terp, "LvTupleCls", this.clsLValueCls);
    }
    this.clsLvTuple      = terp.clss.get("lvtuple");
    if (this.clsLvTuple == null) {
      this.clsLvTuple = new Cls(this.clsLvTupleCls, terp, "LvTuple", this.clsLValue);
    }
          
    this.clsLvListCls = terp.clss.get("lvlistcls");
    if (this.clsLvListCls == null) {
      this.clsLvListCls = new Cls(terp.tMetaclsCls, terp, "LvListCls", this.clsLvTupleCls);
    }
    this.clsLvList      = terp.clss.get("lvlist");
    if (this.clsLvList == null) {
      this.clsLvList = new Cls(this.clsLvListCls, terp, "LvList", this.clsLvTuple);
    }
          
    this.clsTopCls = terp.clss.get("topcls");
    if (this.clsTopCls == null) {
      this.clsTopCls = new Cls(terp.tMetaclsCls, terp, "TopCls", this.clsExprCls);
    }
    this.clsTop      = terp.clss.get("top");
    if (this.clsTop == null) {
      this.clsTop = new Cls(this.clsTopCls, terp, "Top", this.clsExpr);
    }
          
    this.clsPutLValueCls = terp.clss.get("putlvaluecls");
    if (this.clsPutLValueCls == null) {
      this.clsPutLValueCls = new Cls(terp.tMetaclsCls, terp, "PutLValueCls", this.clsExprCls);
    }
    this.clsPutLValue      = terp.clss.get("putlvalue");
    if (this.clsPutLValue == null) {
      this.clsPutLValue = new Cls(this.clsPutLValueCls, terp, "PutLValue", this.clsExpr);
    }
          
    this.clsPutInstVarCls = terp.clss.get("putinstvarcls");
    if (this.clsPutInstVarCls == null) {
      this.clsPutInstVarCls = new Cls(terp.tMetaclsCls, terp, "PutInstVarCls", this.clsExprCls);
    }
    this.clsPutInstVar      = terp.clss.get("putinstvar");
    if (this.clsPutInstVar == null) {
      this.clsPutInstVar = new Cls(this.clsPutInstVarCls, terp, "PutInstVar", this.clsExpr);
    }
          
    this.clsGetInstVarCls = terp.clss.get("getinstvarcls");
    if (this.clsGetInstVarCls == null) {
      this.clsGetInstVarCls = new Cls(terp.tMetaclsCls, terp, "GetInstVarCls", this.clsExprCls);
    }
    this.clsGetInstVar      = terp.clss.get("getinstvar");
    if (this.clsGetInstVar == null) {
      this.clsGetInstVar = new Cls(this.clsGetInstVarCls, terp, "GetInstVar", this.clsExpr);
    }
          
    this.clsGetLocalVarCls = terp.clss.get("getlocalvarcls");
    if (this.clsGetLocalVarCls == null) {
      this.clsGetLocalVarCls = new Cls(terp.tMetaclsCls, terp, "GetLocalVarCls", this.clsExprCls);
    }
    this.clsGetLocalVar      = terp.clss.get("getlocalvar");
    if (this.clsGetLocalVar == null) {
      this.clsGetLocalVar = new Cls(this.clsGetLocalVarCls, terp, "GetLocalVar", this.clsExpr);
    }
          
    this.clsGetSelfCls = terp.clss.get("getselfcls");
    if (this.clsGetSelfCls == null) {
      this.clsGetSelfCls = new Cls(terp.tMetaclsCls, terp, "GetSelfCls", this.clsExprCls);
    }
    this.clsGetSelf      = terp.clss.get("getself");
    if (this.clsGetSelf == null) {
      this.clsGetSelf = new Cls(this.clsGetSelfCls, terp, "GetSelf", this.clsExpr);
    }
          
    this.clsGetFrameCls = terp.clss.get("getframecls");
    if (this.clsGetFrameCls == null) {
      this.clsGetFrameCls = new Cls(terp.tMetaclsCls, terp, "GetFrameCls", this.clsExprCls);
    }
    this.clsGetFrame      = terp.clss.get("getframe");
    if (this.clsGetFrame == null) {
      this.clsGetFrame = new Cls(this.clsGetFrameCls, terp, "GetFrame", this.clsExpr);
    }
          
    this.clsGetGlobalVarCls = terp.clss.get("getglobalvarcls");
    if (this.clsGetGlobalVarCls == null) {
      this.clsGetGlobalVarCls = new Cls(terp.tMetaclsCls, terp, "GetGlobalVarCls", this.clsExprCls);
    }
    this.clsGetGlobalVar      = terp.clss.get("getglobalvar");
    if (this.clsGetGlobalVar == null) {
      this.clsGetGlobalVar = new Cls(this.clsGetGlobalVarCls, terp, "GetGlobalVar", this.clsExpr);
    }
          
    this.clsPutLocalVarCls = terp.clss.get("putlocalvarcls");
    if (this.clsPutLocalVarCls == null) {
      this.clsPutLocalVarCls = new Cls(terp.tMetaclsCls, terp, "PutLocalVarCls", this.clsExprCls);
    }
    this.clsPutLocalVar      = terp.clss.get("putlocalvar");
    if (this.clsPutLocalVar == null) {
      this.clsPutLocalVar = new Cls(this.clsPutLocalVarCls, terp, "PutLocalVar", this.clsExpr);
    }
          
    this.clsSendCls = terp.clss.get("sendcls");
    if (this.clsSendCls == null) {
      this.clsSendCls = new Cls(terp.tMetaclsCls, terp, "SendCls", this.clsExprCls);
    }
    this.clsSend      = terp.clss.get("send");
    if (this.clsSend == null) {
      this.clsSend = new Cls(this.clsSendCls, terp, "Send", this.clsExpr);
    }
          
    this.clsBlockCls = terp.clss.get("blockcls");
    if (this.clsBlockCls == null) {
      this.clsBlockCls = new Cls(terp.tMetaclsCls, terp, "BlockCls", this.clsExprCls);
    }
    this.clsBlock      = terp.clss.get("block");
    if (this.clsBlock == null) {
      this.clsBlock = new Cls(this.clsBlockCls, terp, "Block", this.clsExpr);
    }
          
    this.clsSeqCls = terp.clss.get("seqcls");
    if (this.clsSeqCls == null) {
      this.clsSeqCls = new Cls(terp.tMetaclsCls, terp, "SeqCls", this.clsExprCls);
    }
    this.clsSeq      = terp.clss.get("seq");
    if (this.clsSeq == null) {
      this.clsSeq = new Cls(this.clsSeqCls, terp, "Seq", this.clsExpr);
    }
          
    this.clsMakeVecCls = terp.clss.get("makeveccls");
    if (this.clsMakeVecCls == null) {
      this.clsMakeVecCls = new Cls(terp.tMetaclsCls, terp, "MakeVecCls", this.clsExprCls);
    }
    this.clsMakeVec      = terp.clss.get("makevec");
    if (this.clsMakeVec == null) {
      this.clsMakeVec = new Cls(this.clsMakeVecCls, terp, "MakeVec", this.clsExpr);
    }
          
    this.clsLitCls = terp.clss.get("litcls");
    if (this.clsLitCls == null) {
      this.clsLitCls = new Cls(terp.tMetaclsCls, terp, "LitCls", this.clsExprCls);
    }
    this.clsLit      = terp.clss.get("lit");
    if (this.clsLit == null) {
      this.clsLit = new Cls(this.clsLitCls, terp, "Lit", this.clsExpr);
    }
          
    this.clsEmptyExprListCls = terp.clss.get("emptyexprlistcls");
    if (this.clsEmptyExprListCls == null) {
      this.clsEmptyExprListCls = new Cls(terp.tMetaclsCls, terp, "EmptyExprListCls", this.clsExprCls);
    }
    this.clsEmptyExprList      = terp.clss.get("emptyexprlist");
    if (this.clsEmptyExprList == null) {
      this.clsEmptyExprList = new Cls(this.clsEmptyExprListCls, terp, "EmptyExprList", this.clsExpr);
    }
          
    this.clsClsCls = terp.clss.get("clscls");
    if (this.clsClsCls == null) {
      this.clsClsCls = new Cls(terp.tMetaclsCls, terp, "ClsCls", this.clsObjCls);
    }
    this.clsCls      = terp.clss.get("cls");
    if (this.clsCls == null) {
      this.clsCls = new Cls(this.clsClsCls, terp, "Cls", this.clsObj);
    }
          
    this.clsMethCls = terp.clss.get("methcls");
    if (this.clsMethCls == null) {
      this.clsMethCls = new Cls(terp.tMetaclsCls, terp, "MethCls", this.clsObjCls);
    }
    this.clsMeth      = terp.clss.get("meth");
    if (this.clsMeth == null) {
      this.clsMeth = new Cls(this.clsMethCls, terp, "Meth", this.clsObj);
    }
          
    this.clsJavaMethCls = terp.clss.get("javamethcls");
    if (this.clsJavaMethCls == null) {
      this.clsJavaMethCls = new Cls(terp.tMetaclsCls, terp, "JavaMethCls", this.clsMethCls);
    }
    this.clsJavaMeth      = terp.clss.get("javameth");
    if (this.clsJavaMeth == null) {
      this.clsJavaMeth = new Cls(this.clsJavaMethCls, terp, "JavaMeth", this.clsMeth);
    }
          
    this.clsStrMethCls = terp.clss.get("strmethcls");
    if (this.clsStrMethCls == null) {
      this.clsStrMethCls = new Cls(terp.tMetaclsCls, terp, "StrMethCls", this.clsMethCls);
    }
    this.clsStrMeth      = terp.clss.get("strmeth");
    if (this.clsStrMeth == null) {
      this.clsStrMeth = new Cls(this.clsStrMethCls, terp, "StrMeth", this.clsMeth);
    }
          
    this.clsUsrMethCls = terp.clss.get("usrmethcls");
    if (this.clsUsrMethCls == null) {
      this.clsUsrMethCls = new Cls(terp.tMetaclsCls, terp, "UsrMethCls", this.clsMethCls);
    }
    this.clsUsrMeth      = terp.clss.get("usrmeth");
    if (this.clsUsrMeth == null) {
      this.clsUsrMeth = new Cls(this.clsUsrMethCls, terp, "UsrMeth", this.clsMeth);
    }
          
    this.clsParserCls = terp.clss.get("parsercls");
    if (this.clsParserCls == null) {
      this.clsParserCls = new Cls(terp.tMetaclsCls, terp, "ParserCls", this.clsObjCls);
    }
    this.clsParser      = terp.clss.get("parser");
    if (this.clsParser == null) {
      this.clsParser = new Cls(this.clsParserCls, terp, "Parser", this.clsObj);
    }
          
  }
  
  public Cls clsProCls;
  public Cls clsPro;
        
  public Cls clsSuperCls;
  public Cls clsSuper;
        
  public Cls clsObjCls;
  public Cls clsObj;
        
  public Cls clsSysCls;
  public Cls clsSys;
        
  public Cls clsBogusCls;
  public Cls clsBogus;
        
  public Cls clsUndefinedCls;
  public Cls clsUndefined;
        
  public Cls clsBlkCls;
  public Cls clsBlk;
        
  public Cls clsNumCls;
  public Cls clsNum;
        
  public Cls clsBufCls;
  public Cls clsBuf;
        
  public Cls clsStrCls;
  public Cls clsStr;
        
  public Cls clsVecCls;
  public Cls clsVec;
        
  public Cls clsDictCls;
  public Cls clsDict;
        
  public Cls clsFrameCls;
  public Cls clsFrame;
        
  public Cls clsExprCls;
  public Cls clsExpr;
        
  public Cls clsLValueCls;
  public Cls clsLValue;
        
  public Cls clsLvNameCls;
  public Cls clsLvName;
        
  public Cls clsLvLocalNameCls;
  public Cls clsLvLocalName;
        
  public Cls clsLvInstNameCls;
  public Cls clsLvInstName;
        
  public Cls clsLvTupleCls;
  public Cls clsLvTuple;
        
  public Cls clsLvListCls;
  public Cls clsLvList;
        
  public Cls clsTopCls;
  public Cls clsTop;
        
  public Cls clsPutLValueCls;
  public Cls clsPutLValue;
        
  public Cls clsPutInstVarCls;
  public Cls clsPutInstVar;
        
  public Cls clsGetInstVarCls;
  public Cls clsGetInstVar;
        
  public Cls clsGetLocalVarCls;
  public Cls clsGetLocalVar;
        
  public Cls clsGetSelfCls;
  public Cls clsGetSelf;
        
  public Cls clsGetFrameCls;
  public Cls clsGetFrame;
        
  public Cls clsGetGlobalVarCls;
  public Cls clsGetGlobalVar;
        
  public Cls clsPutLocalVarCls;
  public Cls clsPutLocalVar;
        
  public Cls clsSendCls;
  public Cls clsSend;
        
  public Cls clsBlockCls;
  public Cls clsBlock;
        
  public Cls clsSeqCls;
  public Cls clsSeq;
        
  public Cls clsMakeVecCls;
  public Cls clsMakeVec;
        
  public Cls clsLitCls;
  public Cls clsLit;
        
  public Cls clsEmptyExprListCls;
  public Cls clsEmptyExprList;
        
  public Cls clsClsCls;
  public Cls clsCls;
        
  public Cls clsMethCls;
  public Cls clsMeth;
        
  public Cls clsJavaMethCls;
  public Cls clsJavaMeth;
        
  public Cls clsStrMethCls;
  public Cls clsStrMeth;
        
  public Cls clsUsrMethCls;
  public Cls clsUsrMeth;
        
  public Cls clsParserCls;
  public Cls clsParser;
        


}

