Exemple #1
0
 public static void Tick(Forth f)
 {
     string word = f.getWord(' ');
     ForthDictionaryEntry fde = f.SearchVocabularies(word);
     if (fde == null) throw new InvalidOperationException("attempt to tick undefined word " + word);
     f.dStack.Push(fde.Proc);
 }
Exemple #2
0
 public static void BracketTick(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("bracket-tick is only valid when compiling");
     string word = f.getWord(' ');
     ForthDictionaryEntry fde = f.SearchVocabularies(word);
     if (fde == null) throw new InvalidOperationException("attempt to bracket-tick undefined word " + word);
     f.AppendCode(MakeLiteralOp(fde.Proc));
 }
Exemple #3
0
 public static void Postpone(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("postpone is only valid when compiling");
     string word = f.getWord(' ');
     ForthDictionaryEntry fde = f.SearchVocabularies(word);
     if (fde == null) throw new InvalidOperationException("attempt to postpone undefined word " + word);
     if (fde.IsImmediate)
     {
         f.AppendCode(fde.Proc);
     }
     else
     {
         f.AppendCode(MakeLiteralOp(fde.Proc));
         f.AppendCode(new ExecutionToken(PopAndAppendCode));
     }
 }