Example #1
0
        public void Initialize()
        {
            _interpreter.AddImmediateWord("CATCH", CatchAction);
            _interpreter.AddPrimitiveWord("THROW", ThrowAction);

            _interpreter.AddPrimitiveWord("ABORT", AbortAction);
            _interpreter.AddImmediateWord("ABORT\"", AbortWithMessageAction);
        }
Example #2
0
 public void Initialize()
 {
     _interpreter.AddPrimitiveWord(">FLOAT", ToNumberAction);
     _interpreter.AddPrimitiveWord("D>F", DToFAction);
     _interpreter.AddPrimitiveWord("F!", FStoreAction);
     _interpreter.AddPrimitiveWord("F*", FStarAction);
     _interpreter.AddPrimitiveWord("F+", FPlusAction);
     _interpreter.AddPrimitiveWord("F-", FMinusAction);
     _interpreter.AddPrimitiveWord("F/", FSlashAction);
     _interpreter.AddPrimitiveWord("F0<", FZeroLessThanAction);
     _interpreter.AddPrimitiveWord("F0=", FZeroEqualsAction);
     _interpreter.AddPrimitiveWord("F<", FLessThanAction);
     _interpreter.AddPrimitiveWord("F>D", FToDAction);
     _interpreter.AddPrimitiveWord("F@", FFetchAction);
     _interpreter.AddPrimitiveWord("FALIGN", FAlignAction);
     _interpreter.AddPrimitiveWord("FALIGNED", FAlignedAction);
     _interpreter.AddPrimitiveWord("FCONSTANT", FConstantAction);
     _interpreter.AddPrimitiveWord("FDEPTH", FDepthAction);
     _interpreter.AddPrimitiveWord("FDROP", FDropAction);
     _interpreter.AddPrimitiveWord("FDUP", FDupAction);
     _interpreter.AddPrimitiveWord("FDUP", FDupAction);
     _interpreter.AddImmediateWord("FLITERAL", FLiteralAction);
     _interpreter.AddPrimitiveWord("FLOAT+", FloatPlusAction);
     _interpreter.AddPrimitiveWord("FLOATS", FloatsAction);
     _interpreter.AddPrimitiveWord("FLOOR", FloorAction);
     _interpreter.AddPrimitiveWord("FMAX", FMaxAction);
     _interpreter.AddPrimitiveWord("FMIN", FMinAction);
     _interpreter.AddPrimitiveWord("FNEGATE", FNegateAction);
     _interpreter.AddPrimitiveWord("FOVER", FOverAction);
     _interpreter.AddPrimitiveWord("FROT", FRoteAction);
     _interpreter.AddPrimitiveWord("FROUND", FRoundAction);
     _interpreter.AddPrimitiveWord("FSWAP", FSwapAction);
     _interpreter.AddPrimitiveWord("FVARIABLE", FVariableAction);
 }
Example #3
0
        public void Initialize()
        {
            _interpreter.AddImmediateWord(".(", DotParenAction);
            _interpreter.AddPrimitiveWord("0<>", ZeroNotEqualsAction);
            _interpreter.AddPrimitiveWord("0>", ZeroGreaterAction);
            _interpreter.AddPrimitiveWord("2>R", TwoToRAction);
            _interpreter.AddPrimitiveWord("2R>", TwoRFromAction);
            _interpreter.AddPrimitiveWord("2R@", TwoRFetchAction);
            _interpreter.AddPrimitiveWord(":NONAME", NonameAction);
            _interpreter.AddImmediateWord(";", SemicolonAction);  // Extended version.
            _interpreter.AddPrimitiveWord("<>", NotEqualsAction);
            _interpreter.AddImmediateWord("?DO", QuestionDoAction);
            _interpreter.AddImmediateWord("AGAIN", AgainAction);
            _interpreter.AddPrimitiveWord("HEX", HexAction);
            _interpreter.AddPrimitiveWord("NIP", NipAction);
            _interpreter.AddPrimitiveWord("PICK", PickAction);
            _interpreter.AddPrimitiveWord("ROLL", RollAction);
            _interpreter.AddImmediateWord("S\\\"", SBackslashQuoteAction);  // S\" ..."
            _interpreter.AddPrimitiveWord("TO", ToAction);
            _interpreter.AddPrimitiveWord("TUCK", TuckAction);
            _interpreter.AddPrimitiveWord("VALUE", ValueAction);
            _interpreter.AddWord(new WithinWord(_interpreter));
            _interpreter.AddPrimitiveWord("\\", BackslashAction);


            _interpreter.AddConstantWord("FALSE", 0);
            _interpreter.AddConstantWord("TRUE", -1);

            _interpreter.AddPrimitiveWord("B!", BStoreAction);
            _interpreter.AddPrimitiveWord("B,", BCommaAction);
            _interpreter.AddPrimitiveWord("B@", BFetchAction);
            _interpreter.AddPrimitiveWord("BYTE+", BytePlusAction);
            _interpreter.AddPrimitiveWord("BYTES", BytesAction);

            _interpreter.AddPrimitiveWord("-ROLL", MinusRollAction);
            _interpreter.AddPrimitiveWord("-ROT", MinusRotAction);
            _interpreter.AddPrimitiveWord("2+", TwoPlusAction);
            _interpreter.AddPrimitiveWord("2-", TwoMinusAction);
            _interpreter.AddPrimitiveWord("2NIP", TwoNipAction);
            _interpreter.AddPrimitiveWord("2TUCK", TwoTuckAction);
            _interpreter.AddPrimitiveWord("<=", LessOrEqualsAction);
            _interpreter.AddPrimitiveWord(">=", GreaterOrEqualsAction);
            _interpreter.AddPrimitiveWord("CLEAR", ClearAction);
        }
Example #4
0
 public void Initialize()
 {
     _interpreter.AddPrimitiveWord("2CONSTANT", TwoConstantAction);
     _interpreter.AddImmediateWord("2LITERAL", TwoLiteralAction);
     _interpreter.AddPrimitiveWord("2VARIABLE", TwoVariableAction);
     _interpreter.AddPrimitiveWord("D+", DPlusAction);
     _interpreter.AddPrimitiveWord("D-", DMinusAction);
     _interpreter.AddPrimitiveWord("D.", DDotAction);
     _interpreter.AddPrimitiveWord("D0<", DZeroLessAction);
     _interpreter.AddPrimitiveWord("D0=", DZeroEqualsAction);
     _interpreter.AddPrimitiveWord("D2*", DTwoStarAction);
     _interpreter.AddPrimitiveWord("D2/", DTwoSlashAction);
     _interpreter.AddPrimitiveWord("D<", DLessThanAction);
     _interpreter.AddPrimitiveWord("D=", DEqualsAction);
     _interpreter.AddPrimitiveWord("D>S", DToSAction);
     _interpreter.AddPrimitiveWord("DABS", DAbsAction);
     _interpreter.AddPrimitiveWord("DMAX", DMaxAction);
     _interpreter.AddPrimitiveWord("DMIN", DMinAction);
     _interpreter.AddPrimitiveWord("DNEGATE", DNegateAction);
 }
Example #5
0
 public void Initialize()
 {
     _interpreter.AddWord(new StoreWord(_interpreter));             // !
     _interpreter.AddWord(new NumberSignWord(_interpreter));        // #
     _interpreter.AddWord(new NumberSignGreaterWord(_interpreter)); // #>
     _interpreter.AddWord(new NumberSignSWord(_interpreter));       // #S
     _interpreter.AddWord(new TickWord(_interpreter));              // '
     _interpreter.AddWord(new ParenWord(_interpreter));             // (
     _interpreter.AddWord(new StarWord(_interpreter));              // *
     _interpreter.AddWord(new StarSlashWord(_interpreter));         // */
     _interpreter.AddWord(new StarSlashModWord(_interpreter));      // */MOD
     _interpreter.AddWord(new PlusWord(_interpreter));              // +
     _interpreter.AddWord(new PlusStoreWord(_interpreter));         // +!
     _interpreter.AddWord(new PlusLoopWord(_interpreter));          // +LOOP
     _interpreter.AddWord(new CommaWord(_interpreter));             // ,
     _interpreter.AddWord(new MinusWord(_interpreter));             // -
     _interpreter.AddWord(new DotWord(_interpreter));               // .
     _interpreter.AddWord(new DotQuoteWord(_interpreter));          // ."
     _interpreter.AddPrimitiveWord("/", SlashAction);
     _interpreter.AddWord(new SlashModWord(_interpreter));          // /MOD
     _interpreter.AddPrimitiveWord("0<", ZeroLessAction);
     _interpreter.AddPrimitiveWord("0=", ZeroEqualsAction);
     _interpreter.AddPrimitiveWord("1+", OnePlusAction);
     _interpreter.AddPrimitiveWord("1-", OneMinusAction);
     _interpreter.AddPrimitiveWord("2!", TwoStoreAction);
     _interpreter.AddPrimitiveWord("2*", TwoStarAction);
     _interpreter.AddPrimitiveWord("2/", TwoSlashAction);
     _interpreter.AddPrimitiveWord("2@", TwoFetchAction);
     _interpreter.AddPrimitiveWord("2DROP", TwoDropAction);
     _interpreter.AddPrimitiveWord("2DUP", TwoDupAction);
     _interpreter.AddPrimitiveWord("2OVER", TwoOverAction);
     _interpreter.AddPrimitiveWord("2SWAP", TwoSwapAction);
     _interpreter.AddPrimitiveWord(":", ColonAction);
     _interpreter.AddImmediateWord(";", SemicolonAction);
     _interpreter.AddPrimitiveWord("<", LessThanAction);
     _interpreter.AddWord(new LessNumberSignWord(_interpreter));   // <#
     _interpreter.AddPrimitiveWord("=", EqualsAction);
     _interpreter.AddPrimitiveWord(">", GreaterThanAction);
     _interpreter.AddPrimitiveWord(">BODY", ToBodyAction);
     _interpreter.AddPrimitiveWord(">NUMBER", ToNumberAction);
     _interpreter.AddPrimitiveWord(">R", ToRAction);
     _interpreter.AddPrimitiveWord("?DUP", QuestionDupeAction);
     _interpreter.AddPrimitiveWord("@", FetchAction);
     _interpreter.AddPrimitiveWord("ABORT", AbortAction);
     _interpreter.AddImmediateWord("ABORT\"", AbortWithMessageAction);
     _interpreter.AddPrimitiveWord("ABS", AbsAction);
     _interpreter.AddPrimitiveWord("ALIGN", AlignAction);
     _interpreter.AddPrimitiveWord("ALIGNED", AlignedAction);
     _interpreter.AddPrimitiveWord("ALLOT", AllotAction);
     _interpreter.AddPrimitiveWord("AND", AndAction);
     _interpreter.AddPrimitiveWord("BASE", BaseAction);
     _interpreter.AddImmediateWord("BEGIN", BeginAction);
     _interpreter.AddConstantWord("BL", ' ');
     _interpreter.AddPrimitiveWord("C!", CStoreAction);
     _interpreter.AddPrimitiveWord("C,", CCommaAction);
     _interpreter.AddPrimitiveWord("C@", CFetchAction);
     _interpreter.AddPrimitiveWord("CELL+", CellPlusAction);
     _interpreter.AddPrimitiveWord("CELLS", CellsAction);
     _interpreter.AddPrimitiveWord("CHAR", CharAction);
     _interpreter.AddPrimitiveWord("CHAR+", CharPlusAction);
     _interpreter.AddPrimitiveWord("CHARS", CharsAction);
     _interpreter.AddPrimitiveWord("CONSTANT", ConstantAction);
     _interpreter.AddPrimitiveWord("COUNT", CountAction);
     _interpreter.AddPrimitiveWord("CR", CrAction);
     _interpreter.AddPrimitiveWord("CREATE", CreateAction);
     _interpreter.AddPrimitiveWord("DECIMAL", DecimalAction);
     _interpreter.AddPrimitiveWord("DEPTH", DepthAction);
     _interpreter.AddImmediateWord("DO", DoAction);
     _interpreter.AddImmediateWord("DOES>", DoesAction);
     _interpreter.AddPrimitiveWord("DROP", DropAction);
     _interpreter.AddPrimitiveWord("DUP", DupAction);
     _interpreter.AddImmediateWord("ELSE", ElseAction);
     _interpreter.AddPrimitiveWord("EMIT", EmitAction);
     _interpreter.AddPrimitiveWord("EVALUATE", EvaluateAction);
     _interpreter.AddPrimitiveWord("EXECUTE", ExecuteAction);
     _interpreter.AddImmediateWord("EXIT", ExitAction);
     _interpreter.AddWord(new FillWord(_interpreter));       // FILL
     _interpreter.AddPrimitiveWord("FIND", FindAction);
     _interpreter.AddPrimitiveWord("FM/MOD", FMSlashModAction);
     _interpreter.AddPrimitiveWord("HERE", HereAction);
     _interpreter.AddWord(new HoldWord(_interpreter));       // HOLD
     _interpreter.AddImmediateWord("I", GetInnerIndexAction);
     _interpreter.AddImmediateWord("IF", IfAction);
     _interpreter.AddPrimitiveWord("IMMEDIATE", ImmediateAction);
     _interpreter.AddPrimitiveWord("INVERT", InvertAction);
     _interpreter.AddImmediateWord("J", GetOuterIndexAction);
     _interpreter.AddImmediateWord("LEAVE", LeaveAction);
     _interpreter.AddImmediateWord("LITERAL", LiteralAction);
     _interpreter.AddPrimitiveWord("LSHIFT", LShiftAction);
     _interpreter.AddPrimitiveWord("M*", MStarAction);
     _interpreter.AddImmediateWord("LOOP", LoopAction);
     _interpreter.AddPrimitiveWord("MAX", MaxAction);
     _interpreter.AddPrimitiveWord("MIN", MinAction);
     _interpreter.AddPrimitiveWord("MOD", ModAction);
     _interpreter.AddPrimitiveWord("MOVE", MoveAction);
     _interpreter.AddPrimitiveWord("NEGATE", NegateAction);
     _interpreter.AddPrimitiveWord("OR", OrAction);
     _interpreter.AddPrimitiveWord("OVER", OverAction);
     _interpreter.AddImmediateWord("POSTPONE", PostponeAction);
     _interpreter.AddPrimitiveWord("QUIT", QuitAction);
     _interpreter.AddPrimitiveWord("R>", RFromAction);
     _interpreter.AddPrimitiveWord("R@", RFetchAction);
     _interpreter.AddImmediateWord("RECURSE", RecurseAction);
     _interpreter.AddImmediateWord("REPEAT", RepeatAction);
     _interpreter.AddPrimitiveWord("ROT", RoteAction);
     _interpreter.AddPrimitiveWord("RSHIFT", RShiftAction);
     _interpreter.AddImmediateWord("S\"", SQuoteAction);
     _interpreter.AddPrimitiveWord("S>D", SToDAction);
     _interpreter.AddWord(new SignWord(_interpreter));   // SIGN
     _interpreter.AddPrimitiveWord("SM/REM", SMSlashRemAction);
     _interpreter.AddPrimitiveWord("SPACE", SpaceAction);
     _interpreter.AddPrimitiveWord("SPACES", SpacesAction);
     _interpreter.AddPrimitiveWord("STATE", StateAction);
     _interpreter.AddPrimitiveWord("SWAP", SwapAction);
     _interpreter.AddImmediateWord("THEN", ThenAction);
     _interpreter.AddPrimitiveWord("TYPE", TypeAction);
     _interpreter.AddPrimitiveWord("U.", UDotAction);
     _interpreter.AddPrimitiveWord("U<", ULessThanAction);
     _interpreter.AddPrimitiveWord("UM*", UMStarAction);
     _interpreter.AddPrimitiveWord("UM/MOD", UMSlashModAction);
     _interpreter.AddImmediateWord("UNLOOP", UnloopAction);
     _interpreter.AddImmediateWord("UNTIL", UntilAction);
     _interpreter.AddPrimitiveWord("VARIABLE", VariableAction);
     _interpreter.AddImmediateWord("WHILE", WhileAction);
     _interpreter.AddPrimitiveWord("WORD", WordAction);
     _interpreter.AddPrimitiveWord("XOR", XorAction);
     _interpreter.AddImmediateWord("[", LeftBracketAction);
     _interpreter.AddImmediateWord("[']", BracketTickAction);
     _interpreter.AddImmediateWord("[CHAR]", BracketCharAction);
     _interpreter.AddImmediateWord("]", RightBracketAction);
 }