當前位置: 首頁>>代碼示例>>C#>>正文


C# Forth.AppendCode方法代碼示例

本文整理匯總了C#中SimpleForth.Forth.AppendCode方法的典型用法代碼示例。如果您正苦於以下問題:C# Forth.AppendCode方法的具體用法?C# Forth.AppendCode怎麽用?C# Forth.AppendCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleForth.Forth的用法示例。


在下文中一共展示了Forth.AppendCode方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DotQuote

 public static void DotQuote(Forth f)
 {
     if (f.isCompiling)
     {
         string str = f.getWord('"');
         f.AppendCode
         (
             delegate(Forth g)
             {
                 Console.Write(str);
             }
         );
     }
     else
     {
         string str = f.getWord('"');
         Console.Write(str);
     }
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:19,代碼來源:Forth.cs

示例2: BracketTick

 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));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:8,代碼來源:Forth.cs

示例3: PfBytes

 public static void PfBytes(Forth f)
 {
     if (f.isCompiling)
     {
         string hex = f.getWord(' ');
         f.AppendCode(MakeLiteralOp(HexToBytes(hex)));
     }
     else
     {
         string hex = f.getWord(' ');
         f.dStack.Push(HexToBytes(hex));
     }
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:13,代碼來源:Forth.cs

示例4: PopAndAppendCode

 public static void PopAndAppendCode(Forth f)
 {
     ExecutionToken xt = f.PopExecutionToken();
     f.AppendCode(xt);
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:5,代碼來源:Forth.cs

示例5: Postpone

 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));
     }
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:16,代碼來源:Forth.cs

示例6: UnsignedMinusLoop

 public static void UnsignedMinusLoop(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("u-loop is only valid when compiling");
     f.AppendCode(new ExecutionToken(RuntimeUMinusLoop));
     f.CodeBeingCompiled.LabelForward(f);
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:6,代碼來源:Forth.cs

示例7: Literal

 public static void Literal(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("literal is only valid when compiling");
     object value = f.dStack.Pop();
     f.AppendCode(MakeLiteralOp(value));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:6,代碼來源:Forth.cs

示例8: Unloop

 public static void Unloop(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("unloop is only valid when compiling");
     f.AppendCode
     (
         delegate(Forth g)
         {
             g.loopStack.Drop();
         }
     );
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:11,代碼來源:Forth.cs

示例9: Leave

 public static void Leave(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("leave is only valid when compiling");
     f.AppendCode
     (
         delegate(Forth g)
         {
             g.rStack.Top = g.loopStack.Top.LoopCodeEnd;
             g.loopStack.Drop();
         }
     );
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:12,代碼來源:Forth.cs

示例10: QuestionDo

 public static void QuestionDo(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("?do is only valid when compiling");
     f.CodeBeingCompiled.RefForward(f);
     f.AppendCode(new ExecutionToken(RuntimeQuestionDo));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:6,代碼來源:Forth.cs

示例11: LoopJ

 public static void LoopJ(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("j is only valid when compiling");
     f.AppendCode
     (
         delegate(Forth g)
         {
             g.PushInt64(g.loopStack[1].LoopCounter);
         }
     );
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:11,代碼來源:Forth.cs

示例12: If

 public static void If(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("if / while is only valid when compiling");
     f.CodeBeingCompiled.RefForward(f);
     f.AppendCode(new ExecutionToken(JumpIfFalse));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:6,代碼來源:Forth.cs

示例13: Until

 public static void Until(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("until is only valid when compiling");
     f.CodeBeingCompiled.RefBack(f);
     f.AppendCode(new ExecutionToken(JumpIfFalse));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:6,代碼來源:Forth.cs

示例14: Ahead

 public static void Ahead(Forth f)
 {
     f.CodeBeingCompiled.RefForward(f);
     f.AppendCode(new ExecutionToken(Jump));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:5,代碼來源:Forth.cs

示例15: Again

 public static void Again(Forth f)
 {
     f.CodeBeingCompiled.RefBack(f);
     f.AppendCode(new ExecutionToken(Jump));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:5,代碼來源:Forth.cs


注:本文中的SimpleForth.Forth.AppendCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。